SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- 
-- Table structure for table `administrators`
-- 

CREATE TABLE `administrators` (
  `ADMINID` bigint(20) NOT NULL auto_increment,
  `email` varchar(80) NOT NULL default '',
  `username` varchar(80) NOT NULL default '',
  `password` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`ADMINID`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

-- 
-- Dumping data for table `administrators`
-- 

INSERT INTO `administrators` VALUES (1, 'webmaster@domain.tld', 'Admin', '3a029e067795a03ac21dfc15935583cb');

-- --------------------------------------------------------

-- 
-- Table structure for table `advertisements`
-- 

CREATE TABLE `advertisements` (
  `AID` bigint(30) NOT NULL auto_increment,
  `description` varchar(200) NOT NULL default '',
  `code` text NOT NULL,
  `active` enum('1','0') NOT NULL default '1',
  PRIMARY KEY  (`AID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

-- 
-- Dumping data for table `advertisements`
-- 

INSERT INTO `advertisements` VALUES (1, '300 x 250 pixels', '<div style="width:300px; height:250px; border:1px solid #DFDFDF;" align="center"><br/><br/>Insert Your<br/>Advertisement Here</div>', '1');
INSERT INTO `advertisements` VALUES (2, '120 x 728 pixels', '<div style="width:120px; height:728px; border:1px solid #DFDFDF;" align="center"><br/><br/>Insert Your Advertisement Here</div>', '1');
INSERT INTO `advertisements` VALUES (3, '728 x 90 pixels', '<div style="width:728px; height:90px; border:1px solid #DFDFDF;" align="center"><br/><br/>Insert Your Advertisement Here</div>', '1');
INSERT INTO `advertisements` VALUES (4, '350 x 90 pixels', '<div style="width:350px; height:90px; border:1px solid #DFDFDF;" align="center"><br/><br/>Insert Your Advertisement Here</div>', '1');
INSERT INTO `advertisements` VALUES (5, '300 x 100 pixels', '<div style="width:300px; height:100px; border:1px solid #DFDFDF;" align="center"><br/><br/>Insert Your Advertisement Here</div>', '1');

-- --------------------------------------------------------

-- 
-- Table structure for table `categories_channels`
-- 

CREATE TABLE `categories_channels` (
  `CATID` bigint(20) NOT NULL auto_increment,
  `name` varchar(120) NOT NULL default '',
  `details` text NOT NULL,
  PRIMARY KEY  (`CATID`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `categories_channels`
-- 

INSERT INTO `categories_channels` VALUES (1, 'Directors', 'Directors Category');
INSERT INTO `categories_channels` VALUES (2, 'Comedians', 'Comedians Category');
INSERT INTO `categories_channels` VALUES (3, 'Musicians', 'Musicians Category');

-- --------------------------------------------------------

-- 
-- Table structure for table `categories_videos`
-- 

CREATE TABLE `categories_videos` (
  `CATID` bigint(20) NOT NULL auto_increment,
  `name` varchar(120) NOT NULL default '',
  `details` text NOT NULL,
  PRIMARY KEY  (`CATID`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `categories_videos`
-- 

INSERT INTO `categories_videos` VALUES (1, 'Entertainment', 'Entertainment Category');
INSERT INTO `categories_videos` VALUES (2, 'Arts', 'Arts Category');
INSERT INTO `categories_videos` VALUES (3, 'Music', 'Music Category');

-- --------------------------------------------------------

-- 
-- Table structure for table `channels`
-- 

CREATE TABLE `channels` (
  `CID` bigint(20) NOT NULL auto_increment,
  `name` varchar(120) NOT NULL default '',
  `details` text NOT NULL,
  `category` varchar(120) NOT NULL default '',
  `photo` varchar(30) NOT NULL default '',
  `time_added` varchar(30) NOT NULL default '',
  `featured` char(1) NOT NULL default '0',
  `MID` bigint(20) NOT NULL default '0',
  `viewcount` bigint(10) NOT NULL default '0',
  `rating` float NOT NULL default '0',
  `ratingcount` bigint(10) NOT NULL default '0',
  `voter_id` varchar(200) NOT NULL default '',
  `commentcount` int(10) NOT NULL default '0',
  `subscriptions` int(20) NOT NULL default '0',
  `bgimage` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`CID`),
  UNIQUE KEY `CID` (`CID`,`MID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


-- --------------------------------------------------------

-- 
-- Table structure for table `channels_comments`
-- 

CREATE TABLE `channels_comments` (
  `COMID` bigint(20) NOT NULL auto_increment,
  `CID` bigint(20) NOT NULL default '0',
  `USERID` bigint(20) NOT NULL default '0',
  `details` text NOT NULL,
  `time_added` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`COMID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `channels_members`
-- 

CREATE TABLE `channels_members` (
  `CMID` bigint(20) NOT NULL auto_increment,
  `CID` bigint(20) NOT NULL default '0',
  `USERID` bigint(20) NOT NULL default '0',
  `time_joined` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`CMID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `channels_videos`
-- 

CREATE TABLE `channels_videos` (
  `CVID` bigint(20) NOT NULL auto_increment,
  `CID` bigint(20) NOT NULL default '0',
  `VIDEOID` bigint(20) NOT NULL default '0',
  `time_added` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`CVID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `config`
-- 

CREATE TABLE `config` (
  `setting` varchar(60) NOT NULL default '',
  `value` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- 
-- Dumping data for table `config`
-- 

INSERT INTO `config` VALUES ('site_email', 'webmaster@yourdomain.com');
INSERT INTO `config` VALUES ('max_search_phrases', '10');
INSERT INTO `config` VALUES ('site_name', 'VideoWatch Pro');
INSERT INTO `config` VALUES ('max_syndicate_results', '25');
INSERT INTO `config` VALUES ('maximum_results', '1000000');
INSERT INTO `config` VALUES ('emailsender', 'Admin');
INSERT INTO `config` VALUES ('max_img_size', '200');
INSERT INTO `config` VALUES ('max_thumb_width', '96');
INSERT INTO `config` VALUES ('max_thumb_height', '72');
INSERT INTO `config` VALUES ('max_display_size', '400');
INSERT INTO `config` VALUES ('items_per_page', '12');
INSERT INTO `config` VALUES ('max_video_size', '300000000');
INSERT INTO `config` VALUES ('rel_video_per_page', '2');
INSERT INTO `config` VALUES ('recently_viewed_video', '12');
INSERT INTO `config` VALUES ('max_viewing_now', '12');
INSERT INTO `config` VALUES ('who_can_download', '0');
INSERT INTO `config` VALUES ('allow_downloads', '1');
INSERT INTO `config` VALUES ('max_recent_main', '20');
INSERT INTO `config` VALUES ('max_feat', '10');
INSERT INTO `config` VALUES ('seo_title_include', '.html');
INSERT INTO `config` VALUES ('only_vote_once', '1');
INSERT INTO `config` VALUES ('max_comments', '5');
INSERT INTO `config` VALUES ('max_avatar_width', '100');
INSERT INTO `config` VALUES ('max_avatar_height', '100');
INSERT INTO `config` VALUES ('approve_videos', '0');
INSERT INTO `config` VALUES ('series_per_page', '5');
INSERT INTO `config` VALUES ('max_comments_profile', '10');
INSERT INTO `config` VALUES ('max_new_videos_pv', '5');
INSERT INTO `config` VALUES ('max_related_videos_pv', '10');
INSERT INTO `config` VALUES ('max_user_videos_pv', '10');
INSERT INTO `config` VALUES ('metadescription', 'VideoWatch Video Sharing Script. The most advanced video sharing script on the planet.');
INSERT INTO `config` VALUES ('metakeywords', 'video,sharing,script,youtube,clone');
INSERT INTO `config` VALUES ('vbitrate', '9600');
INSERT INTO `config` VALUES ('keep_original_video', '0');
INSERT INTO `config` VALUES ('ffmpeg', '/usr/local/bin/ffmpeg');
INSERT INTO `config` VALUES ('mplayer', '/usr/local/bin/mplayer');
INSERT INTO `config` VALUES ('mencoder', '/usr/local/bin/mencoder');
INSERT INTO `config` VALUES ('metainject', '/usr/local/bin/flvtool2');
INSERT INTO `config` VALUES ('phppath', '/usr/local/bin/php');
INSERT INTO `config` VALUES ('sbitrate', '22050');
INSERT INTO `config` VALUES ('resize_video', '0');
INSERT INTO `config` VALUES ('vresize_x', '450');
INSERT INTO `config` VALUES ('vresize_y', '375');
INSERT INTO `config` VALUES ('editors_pick', '18');

-- --------------------------------------------------------

-- 
-- Table structure for table `friends`
-- 

CREATE TABLE `friends` (
  `FID` bigint(20) NOT NULL auto_increment,
  `USERID` bigint(20) NOT NULL default '0',
  `FRIENDID` bigint(20) NOT NULL default '0',
  `time_added` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`FID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `friends_requests`
-- 

CREATE TABLE `friends_requests` (
  `RID` bigint(20) NOT NULL auto_increment,
  `REQUESTER` bigint(20) NOT NULL default '0',
  `REQUESTEE` bigint(20) NOT NULL default '0',
  `message` varchar(200) NOT NULL default '',
  `time` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`RID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `members`
-- 

CREATE TABLE `members` (
  `USERID` bigint(20) NOT NULL auto_increment,
  `email` varchar(80) NOT NULL default '',
  `username` varchar(80) NOT NULL default '',
  `password` varchar(50) NOT NULL default '',
  `firstname` varchar(60) NOT NULL default '',
  `lastname` varchar(60) NOT NULL default '',
  `birthday` date NOT NULL default '0000-00-00',
  `gender` varchar(6) NOT NULL default '',
  `description` text NOT NULL,
  `url` varchar(150) NOT NULL default '',
  `city` varchar(80) NOT NULL default '',
  `country` varchar(100) NOT NULL default '',
  `yourvideosviewed` int(15) NOT NULL default '0',
  `profileviews` int(20) NOT NULL default '0',
  `videosyouviewed` int(15) NOT NULL default '0',
  `addtime` varchar(20) NOT NULL default '',
  `lastlogin` varchar(20) NOT NULL default '',
  `verified` char(1) NOT NULL default '0',
  `status` enum('1','0') NOT NULL default '1',
  `voter_id` varchar(200) NOT NULL default '',
  `ratingcount` bigint(10) NOT NULL default '0',
  `rating` float NOT NULL default '0',
  `profilepicture` varchar(100) NOT NULL default '',
  `familyfilter` char(1) NOT NULL default '1',
  `avatar` varchar(200) NOT NULL default 'noavatar.gif',
  `customavatar` char(1) NOT NULL default '0',
  `bgimage` varchar(100) NOT NULL default '',
  `featured` char(1) NOT NULL default '0',
  PRIMARY KEY  (`USERID`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `members_comments`
-- 

CREATE TABLE `members_comments` (
  `CID` bigint(20) NOT NULL auto_increment,
  `PROFILEID` bigint(20) NOT NULL default '0',
  `USERID` bigint(20) NOT NULL default '0',
  `details` text NOT NULL,
  `time_added` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`CID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `members_passcode`
-- 

CREATE TABLE `members_passcode` (
  `USERID` bigint(20) NOT NULL default '0',
  `code` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`USERID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- 
-- Dumping data for table `members_passcode`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `members_subscribers`
-- 

CREATE TABLE `members_subscribers` (
  `SID` int(8) NOT NULL auto_increment,
  `subscriber` varchar(20) NOT NULL default '',
  `subscribee` varchar(20) NOT NULL default '',
  UNIQUE KEY `SID` (`SID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `members_verifycode`
-- 

CREATE TABLE `members_verifycode` (
  `USERID` bigint(20) NOT NULL default '0',
  `code` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`USERID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

-- 
-- Table structure for table `messages_inbox`
-- 

CREATE TABLE `messages_inbox` (
  `MID` bigint(20) NOT NULL auto_increment,
  `MSGTO` bigint(20) NOT NULL default '0',
  `MSGFROM` bigint(20) NOT NULL default '0',
  `subject` varchar(100) NOT NULL default '',
  `message` varchar(200) NOT NULL default '',
  `time` varchar(20) NOT NULL default '',
  `unread` char(1) NOT NULL default '1',
  PRIMARY KEY  (`MID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `messages_sent`
-- 

CREATE TABLE `messages_sent` (
  `MID` bigint(20) NOT NULL auto_increment,
  `MSGTO` bigint(20) NOT NULL default '0',
  `MSGFROM` bigint(20) NOT NULL default '0',
  `subject` varchar(100) NOT NULL default '',
  `message` varchar(200) NOT NULL default '',
  `time` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`MID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `search_phrases`
-- 

CREATE TABLE `search_phrases` (
  `SID` bigint(20) NOT NULL auto_increment,
  `type` varchar(10) NOT NULL default '',
  `phrase` varchar(100) NOT NULL default '',
  `searchcount` bigint(30) NOT NULL default '1',
  PRIMARY KEY  (`SID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `sendmail`
-- 

CREATE TABLE `sendmail` (
  `EID` varchar(50) NOT NULL default '',
  `subject` varchar(255) NOT NULL default '',
  `template` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`EID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- 
-- Dumping data for table `sendmail`
-- 

INSERT INTO `sendmail` VALUES ('confirmemail', 'E-Mail Verification', 'sendmail/confirmemail.tpl');
INSERT INTO `sendmail` VALUES ('sendnewpassword', 'Your new password for', 'sendmail/sendnewpassword.tpl');
INSERT INTO `sendmail` VALUES ('welcomeemail', 'Welcome to', 'sendmail/welcomeemail.tpl');
INSERT INTO `sendmail` VALUES ('forgotusername', 'Forgot Username', 'sendmail/forgotusername.tpl');
INSERT INTO `sendmail` VALUES ('newmessage', 'New message from', 'sendmail/newmessage.tpl');
INSERT INTO `sendmail` VALUES ('sharevideo', 'wants you to see this video!', 'sendmail/sharevideo.tpl');
INSERT INTO `sendmail` VALUES ('confirmforgotpass', 'Reset Password Link', 'sendmail/confirmforgotpass.tpl');

-- --------------------------------------------------------

-- 
-- Table structure for table `videos`
-- 

CREATE TABLE `videos` (
  `VIDEOID` bigint(20) NOT NULL auto_increment,
  `USERID` bigint(20) NOT NULL default '0',
  `title` varchar(120) NOT NULL default '',
  `description` text NOT NULL,
  `tags` text NOT NULL,
  `categories` varchar(255) NOT NULL default '0|',
  `original_video` varchar(50) NOT NULL default '',
  `video_name` varchar(50) default NULL,
  `runtime` float NOT NULL default '0',
  `filesize` bigint(20) NOT NULL default '0',
  `public` char(1) NOT NULL default '1',
  `time_added` varchar(20) default NULL,
  `date_added` date NOT NULL default '0000-00-00',
  `viewcount` bigint(10) NOT NULL default '0',
  `last_viewed` datetime NOT NULL default '0000-00-00 00:00:00',
  `commentcount` int(8) NOT NULL default '0',
  `favoritecount` int(8) NOT NULL default '0',
  `downloadcount` int(8) NOT NULL default '0',
  `featured` char(1) NOT NULL default '0',
  `ratingcount` bigint(10) NOT NULL default '0',
  `rating` float NOT NULL default '0',
  `filehome` varchar(120) NOT NULL default '',
  `allowcomments` char(1) NOT NULL default '1',
  `allowratings` char(1) NOT NULL default '1',
  `allowembeds` char(1) NOT NULL default '1',
  `allowdownloads` char(1) NOT NULL default '1',
  `voter_id` varchar(200) NOT NULL default '',
  `active` char(1) NOT NULL default '',
  `mature` char(1) NOT NULL default '0',
  `SID` bigint(20) NOT NULL default '0',
  PRIMARY KEY  (`VIDEOID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `videos_comments`
-- 

CREATE TABLE `videos_comments` (
  `CID` bigint(20) NOT NULL auto_increment,
  `VIDEOID` bigint(20) NOT NULL default '0',
  `USERID` bigint(20) NOT NULL default '0',
  `details` text NOT NULL,
  `time_added` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`CID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `videos_favorited`
-- 

CREATE TABLE `videos_favorited` (
  `FID` bigint(20) NOT NULL auto_increment,
  `USERID` bigint(25) NOT NULL default '0',
  `VIDEOID` bigint(25) NOT NULL default '0',
  PRIMARY KEY  (`FID`),
  UNIQUE KEY `USERID` (`USERID`,`VIDEOID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `videos_reports`
-- 

CREATE TABLE `videos_reports` (
  `RID` bigint(20) NOT NULL auto_increment,
  `USERID` bigint(20) NOT NULL default '0',
  `VIDEOID` bigint(20) NOT NULL default '0',
  `reason` varchar(100) NOT NULL default '',
  `remarks` text NOT NULL,
  `date` date NOT NULL default '0000-00-00',
  `time` varchar(20) default NULL,
  PRIMARY KEY  (`RID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `videos_series`
-- 

CREATE TABLE `videos_series` (
  `SID` bigint(20) NOT NULL auto_increment,
  `name` varchar(120) NOT NULL default '',
  `description` text NOT NULL,
  `thumbnail` varchar(120) NOT NULL default 'noseriesthumb.gif',
  `date_created` date NOT NULL default '0000-00-00',
  `time_created` varchar(20) default NULL,
  `last_added` varchar(20) default NULL,
  `USERID` bigint(20) NOT NULL default '0',
  `rating` float NOT NULL default '0',
  `ratingcount` bigint(10) NOT NULL default '0',
  `voter_id` varchar(200) NOT NULL default '',
  `featured` char(1) NOT NULL default '0',
  `subscriptions` int(20) NOT NULL default '0',
  PRIMARY KEY  (`SID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `videos_series_subscribers`
-- 

CREATE TABLE `videos_series_subscribers` (
  `VSID` bigint(20) NOT NULL auto_increment,
  `USERID` bigint(20) NOT NULL default '0',
  `SID` bigint(20) NOT NULL default '0',
  `date` date NOT NULL default '0000-00-00',
  `time` varchar(20) default NULL,
  UNIQUE KEY `VSID` (`VSID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

ALTER TABLE `channels` ADD `seokey` VARCHAR( 120 ) NOT NULL ;
