

CREATE TABLE IF NOT EXISTS `advertisements` (
								  `id` int(12) NOT NULL AUTO_INCREMENT,
								  `title` varchar(255) NOT NULL,
								  `ad_type` varchar(20) NOT NULL,
								  `data_ad_client` varchar(255) NOT NULL,
								  `data_ad_slot` varchar(255) NOT NULL,
								  `image` varchar(255) NOT NULL,
								  `link` varchar(255) NOT NULL,
								  `place` varchar(20) NOT NULL,
								  `active` int(1) NOT NULL,
								  PRIMARY KEY (`id`)
								) ENGINE=MyISAM DEFAULT CHARSET=utf8;
								
CREATE TABLE IF NOT EXISTS `categories` (
							  `id` int(12) NOT NULL AUTO_INCREMENT,
							  `main_id` int(12) NOT NULL,
							  `category` varchar(255) NOT NULL,
							  `image` varchar(255) NOT NULL,
							  `color` varchar(7) NOT NULL,
							  `seo_keywords` varchar(255) NOT NULL,
							  `seo_description` varchar(255) NOT NULL,
							  `category_order` int(12) NOT NULL,
							  PRIMARY KEY (`id`)
							) ENGINE=MyISAM DEFAULT CHARSET=utf8;
							
CREATE TABLE IF NOT EXISTS `links` (
							  `id` int(12) NOT NULL AUTO_INCREMENT,
							  `title` varchar(255) NOT NULL,
							  `link` varchar(255) NOT NULL,
							  `nofollow` int(1) NOT NULL,
							  `target` varchar(10) NOT NULL,
							  `published` int(1) NOT NULL,
							  `link_order` int(12) NOT NULL,
							  `place` int(1) NOT NULL,
							  PRIMARY KEY (`id`)
							) ENGINE=MyISAM DEFAULT CHARSET=utf8;
							
CREATE TABLE IF NOT EXISTS `news` (
						  `id` int(12) NOT NULL AUTO_INCREMENT,
						  `source_type` varchar(40) NOT NULL,
						  `source_domain` varchar(255) NOT NULL,
						  `title` varchar(255) NOT NULL,
						  `permalink` tinytext NOT NULL,
						  `details` text NOT NULL,
						  `thumbnail` varchar(255) NOT NULL,
						  `category_id` int(12) NOT NULL,
						  `sub_category_id` int(12) NOT NULL,
						  `source_id` int(12) NOT NULL,
						  `datetime` int(12) NOT NULL,
						  `day` int(2) NOT NULL,
						  `month` int(2) NOT NULL,
						  `year` int(4) NOT NULL,
						  `hits` int(12) NOT NULL,
						  `votes_up` int(12) NOT NULL,
						  `votes_down` int(12) NOT NULL,
						  `published` int(1) NOT NULL,
						  `deleted` int(1) NOT NULL,
						  `tags` varchar(255) NOT NULL,
						  `featured` int(1) NOT NULL,
						  `video_id` varchar(255) NOT NULL,
						  `duration` int(12) NOT NULL,
						  PRIMARY KEY (`id`)
						) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `news_votes` (
						  `id` int(12) NOT NULL AUTO_INCREMENT,
						  `article_id` int(12) NOT NULL,
						  `ip_address` varchar(30) NOT NULL,
						  `up` int(1) NOT NULL,
						  `down` int(1) NOT NULL,
						  PRIMARY KEY (`id`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
						
CREATE TABLE IF NOT EXISTS `options` (
						  `id` int(12) NOT NULL AUTO_INCREMENT,
						  `option_name` varchar(100) NOT NULL,
						  `option_value` text NOT NULL,
						  `option_default` text NOT NULL,
						  `option_set` varchar(100) NOT NULL,
						  PRIMARY KEY (`id`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
						
INSERT INTO `options` (`id`, `option_name`, `option_value`, `option_default`, `option_set`) VALUES
							(1, 'siteurl', 'http://site.com', 'http://site.com', 'General'),
							(2, 'seo_title', 'RSS-Script LV', 'RSS-Script LV', 'General'),
							(3, 'seo_keywords', 'keyword1,keyword2', 'keyword1,keyword2', 'General'),
							(4, 'seo_description', 'some words as description', 'some words as description', 'General'),
							(5, 'category_sitemap', '1', '1', 'General'),
							(6, 'sitemap_news_number', '200', '200', 'General'),
							(7, 'display_comments', '1', '1', 'Comments'),
							(8, 'disques_shortname', 'nwafd', 'nwafd', 'Comments'),
							(9, 'facebook_account', 'http://facebook.com/rss_script', 'http://facebook.com/rss_script', 'Social'),
							(10, 'twitter_account', 'http://facebook.com/rss_script', 'http://facebook.com/rss_script', 'Social'),
							(11, 'google_plus_account', 'http://facebook.com/rss_script', 'http://facebook.com/rss_script', 'Social'),
							(12, 'youtube_account', 'http://facebook.com/rss_script', 'http://facebook.com/rss_script', 'Social'),
							(13, 'youtube_apikey', '', '', 'Api'),
							(14, 'site_theme', 'default', 'default', 'General'),
							(15, 'category_news_number', '20', '', 'Theme'),
							(16, 'source_news_number', '', '', 'Theme'),
							(17, 'search_news_number', '20', '', 'Theme'),
							(18, 'related_news_number', '6', '1', 'Theme'),
							(19, 'top_news_number', '5', '1', 'Theme'),
							(20, 'heading_font', 'Play', 'Anton', 'Theme'),
							(21, 'paragraph_font', 'Ubuntu', 'Allerta', 'Theme'),
							(22, 'heading_font_size', '18', '20', 'Theme'),
							(23, 'heading_font_weight', 'bold', 'normal', 'Theme'),
							(24, 'paragraph_font_size', '14', '14', 'Theme'),
							(25, 'paragraph_font_weight', 'normal', 'normal', 'Theme'),
							(26, 'display_next_days', '0', '1', 'Weather'),
							(27, 'temperature_degree', 'c', 'f', 'Weather'),
							(28, 'allow_lazyload', '1', '0', 'Theme'),
							(29, 'display_megamenu', '1', '1', 'Theme'),
							(30, 'megamenu_news_number', '3', '12', 'Theme'),
							(31, 'mobile_weather_widget', '0', '0', 'Theme'),
							(32, 'recaptcha_public', '', '', 'API'),
							(33, 'recaptcha_private', '', '', 'API'),
							(34, 'mobile_poll_widget', '1', '1', 'Theme'),
							(35, 'mobile_topnews_widget', '0', '0', 'Theme'),
							(36, 'mobile_archive_widget', '0', '0', 'Theme'),
							(37, 'mobile_social_widget', '1', '1', 'Theme'),
							(38, 'display_breadcrumb', '1', '1', 'Theme'),
							(39, 'site_language', 'english', 'english', 'General'),
							(40, 'rss_news_number', '10', '10', 'General'),
							(41, 'vimeo_account', 'http://vimeo.com', 'http://vimeo.com', 'Social'),
							(42, 'display_sections_categories', '1', '1', 'Theme'),
							(43, 'sections_categories', '4,8,12', '4,12', 'Theme'),
							(44, 'sections_content_type_rss', '1', '1', 'Theme'),
							(45, 'sections_content_type_video', '1', '1', 'Theme'),
							(46, 'sections_content_style', '3', '1', 'Theme'),
							(47, 'tab_weather_widget', '1', '1', 'Theme'),
							(48, 'tab_poll_widget', '0', '0', 'Theme'),
							(49, 'tab_topnews_widget', '0', '0', 'Theme'),
							(50, 'tab_archive_widget', '0', '0', 'Theme'),
							(51, 'tab_social_widget', '1', '1', 'Theme'),
							(52, 'comments_type', 'facebook', 'facebook', 'Comments'),
							(53, 'facebook_colorscheme', 'light', 'dark', 'Comments'),
							(54, 'facebook_order_by', 'time', 'time', 'Comments'),
							(55, 'facebook_num_posts', '5', '3', 'Comments'),
							(56, 'mail_method', 'mail', 'mail', 'Mail'),
							(57, 'send_email', '', '', 'Mail'),
							(58, 'smtp_host', '', '', 'Mail'),
							(59, 'smtp_port', '', '', 'Mail'),
							(60, 'smtp_username', '', '', 'Mail'),
							(61, 'smtp_password', '', '', 'Mail'),
							(62, 'display_poll_widget', '0', '0', 'Polls');
							
CREATE TABLE IF NOT EXISTS `pages` (
							  `id` int(12) NOT NULL AUTO_INCREMENT,
							  `title` varchar(255) NOT NULL,
							  `content` text NOT NULL,
							  `place` int(1) NOT NULL,
							  `page_order` int(12) NOT NULL,
							  `seo_keywords` varchar(255) NOT NULL,
							  `seo_description` text NOT NULL,
							  PRIMARY KEY (`id`)
							) ENGINE=MyISAM DEFAULT CHARSET=utf8;
							
CREATE TABLE IF NOT EXISTS `polls` (
							  `id` int(12) NOT NULL AUTO_INCREMENT,
							  `question` varchar(255) NOT NULL,
							  `image` varchar(255) NOT NULL,
							  PRIMARY KEY (`id`)
							) ENGINE=MyISAM DEFAULT CHARSET=utf8;
							
CREATE TABLE IF NOT EXISTS `polls_answers` (
							  `id` int(12) NOT NULL AUTO_INCREMENT,
							  `poll_id` int(12) NOT NULL,
							  `answer` varchar(255) NOT NULL,
							  PRIMARY KEY (`id`)
							) ENGINE=MyISAM DEFAULT CHARSET=utf8;
							
							
CREATE TABLE IF NOT EXISTS `polls_votes` (
							  `id` int(12) NOT NULL AUTO_INCREMENT,
							  `poll_id` int(12) NOT NULL,
							  `answer_id` int(12) NOT NULL,
							  `ip_address` int(12) NOT NULL,
							  `datetime` int(12) NOT NULL,
							  PRIMARY KEY (`id`)
							) ENGINE=MyISAM DEFAULT CHARSET=utf8;
							
							
CREATE TABLE IF NOT EXISTS `sources` (
							  `id` int(12) NOT NULL AUTO_INCREMENT,
							  `source_type` varchar(30) NOT NULL,
							  `source_domain` varchar(255) NOT NULL,
							  `title` varchar(255) NOT NULL,
							  `rss_link` varchar(255) NOT NULL,
							  `category_id` int(12) NOT NULL,
							  `sub_category_id` int(12) NOT NULL,
							  `thumbnail` varchar(255) NOT NULL,
							  `news_number` int(12) NOT NULL,
							  `add_time` int(12) NOT NULL,
							  `latest_activity` int(12) NOT NULL,
							  `banned_words` text NOT NULL,
							  `is_referal` int(1) NOT NULL,
							  `referal_suffix` varchar(255) NOT NULL,
							  `auto_update` int(1) NOT NULL,
							  `auto_update_period` int(12) NOT NULL,
							  `strip_tags` int(1) NOT NULL,
							  `allowable_tags` varchar(255) NOT NULL,
							  `published` int(1) NOT NULL,
							  PRIMARY KEY (`id`)
							) ENGINE=MyISAM DEFAULT CHARSET=utf8;
							
							
CREATE TABLE IF NOT EXISTS `weather` (
						  `id` int(12) NOT NULL AUTO_INCREMENT,
						  `yahoo_weather_id` varchar(20) NOT NULL,
						  `city` varchar(255) NOT NULL,
						  `published` int(1) NOT NULL,
						  `city_order` int(12) NOT NULL,
						  PRIMARY KEY (`id`)
						) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
						
INSERT INTO `weather` (`id`, `yahoo_weather_id`, `city`, `published`, `city_order`) VALUES
												(1, '638242', 'Berlin / Germany', 1, 1),
												(2, '1105779', 'Sydney / Australia', 1, 2);