Location: PHPKode > projects > News Manager - RSS aggregator > newsmanager/install_mysql.php
<?php
/***************************************************************************
*                           install.php  -  description					   *	
*							Mysql										   *	
****************************************************************************/
?>
<html>
<head>
<title>news.belgium.be</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/frontend.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?php if($_REQUEST['submit_x']!='') {

$dbserver=$_REQUEST['dbserver'];
$dbuser=$_REQUEST['dbuser'];
$dbpass=$_REQUEST['dbpass'];
$dbname=$_REQUEST['dbname'];

 if(!$db = @mysql_connect("$dbserver", "$dbuser", "$dbpass"))
	   die("<font class=\"cont\" color=\"#000000\">Error, I could not connect to the database at $dbserver. Using username $dbuser and password $dbpass.<BR>Please go back and try again.");
	 echo "<font color=\"#000000\" class=\"cont\">DB Connection Good!</FONT><BR>";
 if(!@mysql_select_db("$dbname", $db)) {
	    echo "<font color=\"#000000\" class=\"cont\">Database could not be found</font><BR>";
	    flush();
	    echo "<font color=\"#000000\" class=\"cont\">Attempting to create database $dbname...</font>";
	    flush();
	    if(!$r = mysql_query("CREATE DATABASE $dbname", $db))
	      die("<font color=\"#000000\" class=\"cont\">Error, could not select or create database $dbname, please create it manually or have your system administrator do it for you and try again.");
	    mysql_select_db("$dbname", $db);
	    echo "<font color=\"#000000\" class=\"cont\">Database Created!</font><BR>";
	    flush();
   }else
	   echo "<font color=\"#000000\" class=\"cont\">Database Selected!</font><BR>";
	 flush();
	 echo "<font color=\"#000000\" class=\"cont\">Creating tables an inserting default data...</font><BR>";
	 flush();
	 $tables = array ("admin" => "CREATE TABLE admin (
  									user_id int(11) default NULL,
  									welcome_message text
								)",
					 "category" => "CREATE TABLE category (
									category_id int(11) NOT NULL auto_increment,
									description text,
									category_status char(2) default NULL,
									category_name varchar(50) default NULL,
									language char(2) default NULL,
									short_name varchar(255) default NULL,
									type char(2) default NULL,
									position varchar(20) default NULL,
									PRIMARY KEY  (category_id)
					  			)",
					"events" => "CREATE TABLE events (
  									id int(11) NOT NULL auto_increment,
								    parent int(11) default NULL,
								    name varchar(100) default NULL,
								    description text,
								    PRIMARY KEY  (id)
								)",
					"interface"=> "CREATE TABLE interface (
									 id int(11) NOT NULL auto_increment,
									 position varchar(10) default NULL,
									 image text,
									 url text,
									 PRIMARY KEY  (id)
							)",
					"intro" => "CREATE TABLE intro (
									id int(11) NOT NULL auto_increment,
									search_results_text_chars int(11) default NULL,
									spotlight_text_chars int(11) default NULL,
									image_height int(11) default NULL,
									image_width int(11) default NULL,
									image_position varchar(10) default NULL,
									time_delay	int(11) default NULL,
									allnews_item_home int(11) default NULL,
									allnews_item int(11) default NULL,
									display_spotlight int(11) default NULL,	
									display_allnews int(11) default NULL,
									spotlight_item int(11) default NULL,
									style int(11) default NULL,
									PRIMARY KEY  (id)
							)",
					"language"=> "CREATE TABLE language (
									lang_id char(2) default NULL,
									language_name varchar(50) default NULL
							)",
					"menus"=>"CREATE TABLE menus (
									menu_id int(11) NOT NULL auto_increment,
									menu_name varchar(50) default NULL,
									url text,
									image text,
									position varchar(10) default NULL,
									version int(11) default NULL,
									description varchar(100) default NULL,
									alt_image varchar(20) default NULL,
									language char(2) default NULL,
									PRIMARY KEY  (menu_id)
							)",
					"modules"=>"CREATE TABLE modules (
					  				id int(11) NOT NULL auto_increment,
					  				name varchar(100) default NULL,
					  				PRIMARY KEY  (id)
							)",
					"new_newsitem"=>"CREATE TABLE new_newsitem (
								    newsitem_id int(11) NOT NULL auto_increment,
							        rss_channel_id int(11) default NULL,
									channel_short_name varchar(20) default NULL,
									hour text,
								    language char(2) default NULL,
							  		url_external text,
							  		frontend char(1) default NULL,
							  		body text,
							  		introtext text,
							  		title text,
							  		alt_tag varchar(200) default NULL,
							  		pubdate date default NULL,
							  		PRIMARY KEY  (newsitem_id)
							)",
					"newsitem_category"=>"CREATE TABLE newsitem_category (
								    newsitem_id int(11) default NULL,
	    							category_id int(11) default NULL,
								    subcategory_id int(11) default NULL,
								    id int(11) NOT NULL auto_increment,
								    pubdate datetime default NULL,
								    flag char(1) default NULL,
								    PRIMARY KEY  (id)
							)",
					"popup_settings"=>"CREATE TABLE popup_settings (  
									userid int(11) default NULL,
	    						    selected_id int(11) default NULL,
	  							    category text,
		  						    channel_id text,
			  				  	    category_id text,
			  					    settings_name character varying(20)
						    )",
					"rsschannel"=>"CREATE TABLE rsschannel (
								  channel_id int(11) NOT NULL auto_increment,
								  channel_description text,
								  channel_url text,
								  channel_title text,
								  channel_image text,
								  channel_copyright text,
								  channel_pubdate text,
								  channel_status char(2) default NULL,
								  channel_managing_editor text,
								  channel_generator text,
								  channel_docs text,
								  channel_rating text,
								  channel_text_input text,
								  channel_skiphours text,
								  channel_skipdays text,
								  channel_cloud text,
								  channel_ttl text,
								  channel_webmaster varchar(100) default NULL,
								  channel_language char(2) default NULL,
								  channel_author varchar(100) default NULL,
								  channel_shortname varchar(255) default NULL,
								  channel_lastdate date default NULL,
								  PRIMARY KEY  (channel_id)
						)",
				"rsschannel_category"=>"CREATE TABLE rsschannel_category (
								  rss_channel_id int(11) default NULL,
								  category_id int(11) default NULL,
								  subcategory_id int(11) default NULL
						)",
				"rssurl_newsitem"=>"CREATE TABLE rssurl_newsitem (
								  url_newsitem_id int(11) NOT NULL auto_increment,
								  rss_channel_id int(11) default NULL,
								  news_title text,
								  description text,
								  image text,
								  url text,
								  frontend_export char(1) default NULL,
								  enclosure text,
								  hour text,
								  language char(2) default NULL,
								  pubdate date default NULL,
								  last_builddate date default NULL,
								  pubtime datetime default NULL,
								  category text,		
								  PRIMARY KEY  (url_newsitem_id)
						)",
				"static"=>"CREATE TABLE static (
								  page_id int(11) NOT NULL auto_increment,
								  description text,
								  language char(2) default NULL,
								  position varchar(200) default NULL,
								  version varchar(200) default NULL,
								  image text,
								  title text,
								  PRIMARY KEY  (page_id)
						)",
				"subcategory"=>"CREATE TABLE subcategory (
								  subcategory_id int(11) NOT NULL auto_increment,
								  category_id int(11) default NULL,
								  description text,
								  subcategory_status char(2) default NULL,
								  short_name varchar(255) default NULL,
								  language char(2) default NULL,
								  subcategory_name varchar(50) default NULL,
								  PRIMARY KEY  (subcategory_id)
						)",
				"text"=>"CREATE TABLE text (
								  id int(11) NOT NULL auto_increment,
								  language char(2) default NULL,
								  advanced_search text,
								  your text,
								  allnews text,
								  search_results text,
								  copyright text,
								  home text,
								  yesterday text,
								  today text,
								  category_center text,
								  category_right text,
								  no_news_available text,
								  PRIMARY KEY  (id)
						)",
				"users"=>"CREATE TABLE users (
								  userid int(11) NOT NULL auto_increment,
								  username varchar(50) default NULL,
								  email text,
								  password text,
								  flag char(2) default NULL,
								  PRIMARY KEY  (userid)
						)");

	echo "<TABLE BORDER=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\n";
   while(list($name,$table) = each($tables)) {
	    echo "<TR><TD class=\"cont\">Creating table $name</TD> ";
	    if(!$r = mysql_query($table, $db))
	      die("<TD><font color=\"#FF0000\" class=\"cont\">ERROR! Could not create table. Reason: <b>". mysql_error()."</b></TD></TR></TABLE>");
	    echo "<TD><font color=\"#D30032\" class=\"cont\">[OK]</FONT></TD></TR>";
	    flush();
	 }

	echo "<TR><TD class=\"cont\">Inserting default data</TD>";

$user_data=array("INSERT INTO `users` (username,email,password,flag) VALUES ('admin', 'hide@address.com', '21232f297a57a5a743894a0e4a801fc3', 'S')");

 for($x = 0; $x < count($user_data); $x++) {
	    if(!$r = mysql_query($user_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the users table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

$text_data=array(
		  "INSERT INTO `text` 	(language,advanced_search,your,allnews,search_results,copyright,home,yesterday,today,category_center,category_right,no_news_available) VALUES ('en', 'Advanced search', 'You are here', 'All News', 'Search Results', 'Copyrights © 2005 Belgische Federale Overheidsdiensten', 'Home', 'Yesterday', 'Today', 'Here, the 2 most important news items will be listed with introduction text (and image)', 'Here 5 important news items will be listed','No News Available')",
		 "INSERT INTO `text` (language,advanced_search,your,allnews,search_results,copyright,home,yesterday,today,category_center,category_right,no_news_available) VALUES ('fr', 'Recherche avancée', 'Vous êtes ici', 'Toutes les nouvelles', 'Résultats de recherche', 'Copyrights © 2005 Belgische Federale Overheidsdiensten', 'Home', 'Hier', 'Aujourd’hui', 'Here, the 2 most important news items will be listed with introduction text (and image)', 'Here 5 important news items will be listed','Pas de nouvelles disponibles')",
	  	 "INSERT INTO `text` (language,advanced_search,your,allnews,search_results,copyright,home,yesterday,today,category_center,category_right,no_news_available) VALUES ('de', 'Erweiterte Suche', 'Sie sind hier', 'Alle Nieuws', 'Suchresultate', 'Copyrights © 2005 Belgische Federale Overheidsdiensten', 'Home', 'Gestern', 'Heute', 'Here, the 2 most important news items will be listed with introduction text (and image)', 'Here 5 important news items will be listed','Keine Nachtrichten vorhanden')",
		 "INSERT INTO `text` (language,advanced_search,your,allnews,search_results,copyright,home,yesterday,today,category_center,category_right,no_news_available) VALUES ('nl', 'Geavanceerd zoeken', 'U bent hier', 'Alle nieuwsberichten', 'Zoekresultaten', 'Copyrights © 2005 Belgische Federale Overheidsdiensten', 'Home', 'Gisteren', 'Vandaag', 'Here, the 2 most important news items will be listed with introduction text (and image)', 'Here 5 important news items will be listed','Geen nieuws beschikbaar')");

 for($x = 0; $x < count($text_data); $x++) {
	    if(!$r = mysql_query($text_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the text table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

$static_data=array("INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No Contents Available ', 'en', 'Bottom', '1', '', 'About')",
		   "INSERT INTO `static`  (description,language,position,version,image,title) VALUES ('No Contents ...', 'fr', 'Bottom', '3', '', 'Privacy')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No contents available', 'fr', 'Bottom', '2', '', 'About')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No..', 'fr', 'Top', '2', '', 'Aide')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('', 'nl', 'Top', '2', '', 'Help')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No Contents Available ', 'nl', 'Bottom', '1', '', 'About')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No Contents Available ', 'nl', 'Bottom', '2', '', 'Privacy')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No Contents Available ', 'de', 'Bottom', '1', '', 'About')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No Contents Available', 'de', 'Top', '2', '', 'Hilfe')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No Contents Available ', 'de', 'Bottom', '2', '', 'Privacy')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('Die Wartung dieser Site wird gewährleistet von das \r\nGeneraldirektion Externe Kommunikation des Kanzlei des Premierministers.<br><br>\r\nKontakt :<BR>Bart Van Herreweghe <BR>T. +32 2 287 41 11 <BR>E. <A \r\nclass=contblue \r\nhref=mailto:hide@address.com>hide@address.com</A><BR><br>\r\n<B><U>Adresse des Föderalen Öffentlichen Dienstes \r\n(FÖD) Kanzlei des Premierministers</U></B>\r\n<br>Föderaler Öffentlicher Dienst (FÖD) Kanzlei des Premierministers \r\n<BR>Generaldirektion Externe Kommunikation <BR>Wetstraat 16 rue de la \r\nLoi<BR>1000 Brussel-Bruxelles<BR>T. +32 2 501.02.11<BR>F. +32 2 \r\n512.69.53<BR>', 'de', 'Top', '1', '', 'Contact')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('The maintenance of this web directory is ensured by the Directorate-General \r\nExternal Communication of the Chancery of the Prime Minister.<BR><BR>Contact \r\n:<BR>Bart Van Herreweghe <BR>T. +32 2 287 41 11 <BR>E. <A class=contblue \r\nhref=mailto:hide@address.com>hide@address.com</A><BR><br><B><U>Address \r\nof the Federal Public Service (FPS) Chancery of the Prime \r\nMinister</U></B><BR>Federal Public Service (FPS) Chancery of the Prime \r\nMinister<BR>Directorate-General External Communication <BR>Wetstraat 16 rue de \r\nla Loi<BR>1000 Brussel-Bruxelles<BR>T. +32 2 501.02.11<BR>F. +32 2 512.69.53<BR>', 'en', 'Top', '1', '', 'Contact')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('Deze webgids wordt onderhouden door de Algemene Directie Externe Communicatie \r\nvan de Federale Overheidsdienst (FOD)<BR>Kanselarij van de Eerste \r\nMinister.<BR><BR>Contactpersoon: <BR>Bart Van Herreweghe <BR>T. +32 2 287 41 11 \r\n<BR>E. <A class=contblue \r\nhref=mailto:hide@address.com>hide@address.com</A><BR><BR><B><U>Adres \r\nvan de Federale Overheidsdienst (FOD) Kanselarij van de Eerste \r\nMinister</U></B><BR>Federale Overheidsdienst (FOD) Kanselarij van de Eerste \r\nMinister<BR>Algemene Directie Externe Communicatie <BR>Wetstraat 16<BR>1000 \r\nBrussel<BR>T. +32 2 501.02.11<BR>F. +32 2 512.69.53<BR>', 'nl', 'Top', '1', '', 'Contact')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('\r\n<P>La maintenance de ce guide web est assurée par la Direction générale \r\nCommunication externe de la Chancellerie du Premier Ministre<BR><BR>Personne de \r\ncontact:<BR>Bart Van Herreweghe <BR>T. +32 2 287 41 11 <BR>E. <A class=contblue \r\nhref=mailto:hide@address.com>hide@address.com</A><BR><BR><B><U>Adresse \r\ndu Service public fédéral (SPF) Chancellerie du Premier \r\nMinistre</U></B><br>Service public fédéral (SPF) Chancellerie du Premier \r\nMinistre<BR>Direction générale de la Communication externe<BR>Rue de la Loi, \r\n16<BR>1000 Bruxelles<BR>T. +32 2 501.02.11<BR>F. +32 2 512.69.53<BR></P>', 'fr', 'Top', '1', '', 'Contact')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No Contents Available ', 'en', 'Bottom', '2', '', 'Privacy')",
		   "INSERT INTO `static` (description,language,position,version,image,title) VALUES ('No contents available', 'en', 'Top', '2', '', 'Help')");

for($x = 0; $x < count($static_data); $x++) {
	    if(!$r = mysql_query($static_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the static table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

$modules_data=array("INSERT INTO `modules` VALUES (35, 'Manage Navigation')",
		    "INSERT INTO `modules` VALUES (42, 'Manage static text')",
		    "INSERT INTO `modules` VALUES (32, 'Theme/Category List')",
		    "INSERT INTO `modules` VALUES (30, 'List of Newsitems to categorise')",
		    "INSERT INTO `modules` VALUES (31, 'Add/Edit channel')",
		    "INSERT INTO `modules` VALUES (33, 'New Newsitem')",
		    "INSERT INTO `modules` VALUES (34, 'New Newsitem Overview')",
		    "INSERT INTO `modules` VALUES (36, 'Manage Static Pages')",
		    "INSERT INTO `modules` VALUES (37, 'Manage Messages')",
		    "INSERT INTO `modules` VALUES (28, 'Login')",
		    "INSERT INTO `modules` VALUES (29, 'Channel')",
		    "INSERT INTO `modules` VALUES (38, 'User list & settings')",
		    "INSERT INTO `modules` VALUES (39, 'Forgot password')",
		    "INSERT INTO `modules` VALUES (40, 'Change password')",
		    "INSERT INTO `modules` VALUES (41, 'Manage intro text')");

for($x = 0; $x < count($modules_data); $x++) {
	    if(!$r = mysql_query($modules_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the modules table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }


$menus_data=array("INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Consult Our Archives', 'archive.php?lang=en', 'Nature_Wallpapers-040.jpg', 'right', 1, '', '', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Sites des Autorités Belges', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=DirectoryService&navId=19105&languageParameter=fr', '', 'left', 2, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Services Publics Fédéraux et de Programmation', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=charterPage&navId=0&languageParameter=fr', '', 'left', 1, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Federale en Programmatorische Overheidsdiensten', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=charterPage&navId=0&languageParameter=nl', '', 'left', 1, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Officiële Belgische sites', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=DirectoryService&navId=19105&languageParameter=nl', '', 'left', 2, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Consulteer onze archieven', 'archive.php?lang=nl', '', 'right', 1, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Council of Minister', 'http://www.belgium.be/eportal/application?origin=newsHome.jsp&event=bea.portal.framework.internal.refresh&pageid=comnewslist&navId=5907&languageParameter=nl', '', 'right', 2, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Presscenter', 'http://presscenter.org/fr/home.html', '', 'right', 4, '', 'Presscenter', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Presscenter', 'http://www.presscenter.org/nl/home.html', '', 'right', 4, '', 'Presscenter', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Consult Our Archives', 'archive.php?lang=fr', '', 'right', 1, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Council of Minister', 'http://www.belgium.be/eportal/application?origin=newsHome.jsp&event=bea.portal.framework.internal.refresh&pageid=comnewslist&navId=5907&languageParameter=fr', '', 'right', 2, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Föderale und Programmatorische Öffentliche Dienste', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=charterPage&navId=0&languageParameter=de', '', 'left', 1, '', '', 'de')",
	      "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Offizielle Belgische Seiten', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=DirectoryService&navId=19105&languageParameter=de', '', 'left', 2, '', '', 'de')",
	      "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Consult Our Archives', 'archive.php?lang=de', '', 'right', 1, '', '', 'de')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Presscenter', 'http://www.presscenter.org', '', 'right', 4, '', 'Presscenter', 'de')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Council of Minister', 'http://www.belgium.be/eportal/application?origin=newsHome.jsp&event=bea.portal.framework.internal.refresh&pageid=comnewslist&navId=5907&languageParameter=de', '', 'right', 2, '', '', 'de')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Federal Governement Departements', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=charterPage&navId=0&languageParameter=en', 'Sample.jpg', 'left', 1, '', '', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Council of Minister', 'http://www.belgium.be/eportal/application?origin=newsHome.jsp&event=bea.portal.framework.internal.refresh&pageid=comnewslist&navId=5907&languageParameter=en', '', 'right', 3, '', '', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('RSS Services', 'rss_services.php', '', 'right', 2, '', '', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Services RSS', 'rss_services.php', '', 'right', 3, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('RSS Diensten', 'rss_services.php', '', 'right', 3, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('RSS Diensten', 'rss_services.php', '', 'right', 3, '', '', 'de')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Official Belgian Sites', 'http://www.belgium.be/eportal/application?origin=aboutBelgium.jsp&event=bea.portal.framework.internal.refresh&pageid=DirectoryService&navId=19105&languageParameter=en', '', 'left', 2, '', '', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Presscenter', 'http://www.presscenter.org/en/home.html', 'presscenter_banner_EN.gif', 'right', 4, '', 'Presscenter', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Feeds', 'list_channels.php', '', 'left', 3, '', '', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Feeds', 'list_channels.php', '', 'left', 3, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Feeds', 'list_channels.php', '', 'left', 3, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Feeds', 'list_channels.php', '', 'left', 3, '', '', 'de')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Tags', 'list_tags.php', '', 'left', 4, '', '', 'en')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Tags', 'list_tags.php', '', 'left', 4, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Tags', 'list_tags.php', '', 'left', 4, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Tags', 'list_tags.php', '', 'left', 4, '', '', 'de')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('click here', 'feed_form.php?lang=en', '', 'right', 5, '', '', 'en')",
	  	  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Klik hier', 'feed_form.php?lang=nl', '', 'right', 5, '', '', 'nl')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('Cliquez ici', 'feed_form.php?lang=fr', '', 'right', 5, '', '', 'fr')",
		  "INSERT INTO `menus` (menu_name,url,image,position,version,description,alt_image,language) VALUES ('click here', 'feed_form.php?lang=de', '', 'right', 5, '', '', 'de')"); 


for($x = 0; $x < count($menus_data); $x++) {
	    if(!$r = mysql_query($menus_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the menus table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }


$language_data=array("INSERT INTO `language` VALUES ('en', 'English')",
	                 "INSERT INTO `language` VALUES ('al', 'All Languages')",
                     "INSERT INTO `language` VALUES ('nl', 'Nederlands')",
                     "INSERT INTO `language` VALUES ('de', 'Deutch')",
                     "INSERT INTO `language` VALUES ('fr', 'Français')");

for($x = 0; $x < count($language_data); $x++) {
	    if(!$r = mysql_query($language_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the language     table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

$intro_data=array("INSERT INTO `intro` 			(search_results_text_chars,spotlight_text_chars,image_height,image_width,image_position,time_delay,allnews_item_home,allnews_item,display_spotlight,display_allnews,spotlight_item,style)  VALUES (100, 100, 50, 50,'right',300,15,30,1,2,2,1)");

for($x = 0; $x < count($intro_data); $x++) {
	    if(!$r = mysql_query($intro_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the intro table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

$interface_data=array("INSERT INTO `interface` VALUES (1, 'right', 'new_right.jpg', 'index.php')",
		      "INSERT INTO `interface` VALUES (2, 'left', 'new_mid.jpg', '')");

for($x = 0; $x < count($interface_data); $x++) {
	    if(!$r = mysql_query($interface_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the interface table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

$events_data=array("INSERT INTO `events` VALUES (42, 30, 'categorise', 'Select the newsitems')",
		   "INSERT INTO `events` VALUES (39, 30, 'preview', 'select the newsitems')",
		   "INSERT INTO `events` VALUES (40, 30, 'Resume', 'select the newsitems')",
		   "INSERT INTO `events` VALUES (41, 30, 'Pause', 'Select the newsitems')",
		   "INSERT INTO `events` VALUES (44, 28, 'invalid', 'Invalid Username/Password')",
		   "INSERT INTO `events` VALUES (38, 29, 'url', 'Enter the Value For url')",
		   "INSERT INTO `events` VALUES (45, 29, 'delete', 'Please select any option')",
		   "INSERT INTO `events` VALUES (49, 31, 'description', 'Enter description')",
		   "INSERT INTO `events` VALUES (50, 31, 'shortname', 'Enter the value for shortname')",
		   "INSERT INTO `events` VALUES (47, 31, 'title', 'Enter the value for title')",
		   "INSERT INTO `events` VALUES (48, 31, 'url', 'Enter the value for Url')",
		   "INSERT INTO `events` VALUES (54, 32, 'categoryname', 'Enter category name')",
		   "INSERT INTO `events` VALUES (52, 32, 'description', 'Enter the value for description')",
		   "INSERT INTO `events` VALUES (51, 32, 'shortname', 'Enter the value for shortname')",
		   "INSERT INTO `events` VALUES (53, 32, 'select', 'Select Theme/category')",
		   "INSERT INTO `events` VALUES (59, 33, 'body', 'Enter the value for body')",
		   "INSERT INTO `events` VALUES (60, 33, 'category', 'select category')",
		   "INSERT INTO `events` VALUES (61, 33, 'channel name', 'select channel_name')",
		   "INSERT INTO `events` VALUES (58, 33, 'Intro text', 'Enter the value for intro text')",
		   "INSERT INTO `events` VALUES (56, 33, 'news title', 'Enter the value for news-title')",
		   "INSERT INTO `events` VALUES (62, 33, 'url', 'Enter the value for url')",
		   "INSERT INTO `events` VALUES (57, 33, 'pub date', 'Enter the value for publication date\r\n')",
		   "INSERT INTO `events` VALUES (63, 34, 'delete', 'Are you sure want to delete')",
		   "INSERT INTO `events` VALUES (64, 35, 'delete', 'Are you sure want to delete?')",
		   "INSERT INTO `events` VALUES (65, 35, 'Menu name/url', 'Enter the name/url')",
		   "INSERT INTO `events` VALUES (66, 35, 'side', 'Select side')",
		   "INSERT INTO `events` VALUES (67, 36, 'delete', 'Are you sure want to delete?')",
		   "INSERT INTO `events` VALUES (68, 36, 'side', 'Select Side')",
		   "INSERT INTO `events` VALUES (69, 36, 'Title', 'Enter the value for title')",
		   "INSERT INTO `events` VALUES (70, 37, 'event', 'Select event')",
		   "INSERT INTO `events` VALUES (71, 37, 'screen', 'Select Screen')",
		   "INSERT INTO `events` VALUES (72, 37, 'Text', 'Enter Error Messages')",
		   "INSERT INTO `events` VALUES (75, 28, 'welcome', 'welcome to Newsmanager')",
		   "INSERT INTO `events` VALUES (79, 38, 'delete', 'Are you sure want to Delete?')",
		   "INSERT INTO `events` VALUES (78, 38, 'type', 'Select Type')",
		   "INSERT INTO `events` VALUES (77, 38, 'user email', 'Enter the value for Email')",
		   "INSERT INTO `events` VALUES (76, 38, 'username', 'Enter the value for user name')",
		   "INSERT INTO `events` VALUES (80, 38, 'char only', 'Username Field having numbers.\\nNumbers are not allowed.')",
		   "INSERT INTO `events` VALUES (81, 38, 'invalid email', 'Not an valid Email')",
		   "INSERT INTO `events` VALUES (83, 39, 'invalid email', 'Entered Email is not valid')",
		   "INSERT INTO `events` VALUES (84, 39, 'password sent', 'Your New Password has to be sent to ur mail Id.<br>Check ur mail')",
		   "INSERT INTO `events` VALUES (85, 39, 'email mismatched', 'Your typed Email address is not matched with our Database')",
		   "INSERT INTO `events` VALUES (106, 40, 'confirm password', 'Enter the value for confirm new password')",
		   "INSERT INTO `events` VALUES (100, 40, 'invalid email', 'Entered email is not valid')",
		   "INSERT INTO `events` VALUES (102, 40, 'new password', 'Enter the value for new password')",
		   "INSERT INTO `events` VALUES (105, 40, 'new password length', 'Passwords have maximum 7 characters')",
		   "INSERT INTO `events` VALUES (101, 40, 'old password', 'Enter the value for old password ')",
		   "INSERT INTO `events` VALUES (104, 40, 'old password length', 'Password your typed is not correct')",
		   "INSERT INTO `events` VALUES (103, 40, 'password mismatch', 'This password doesn’t correspond')",
		   "INSERT INTO `events` VALUES (107, 40, 'user email', 'Enter the value for user email')",
		   "INSERT INTO `events` VALUES (109, 41, 'image height', 'Enter the value for image height')",
		   "INSERT INTO `events` VALUES (108, 41, 'image width', 'Enter the value for image width')",
		   "INSERT INTO `events` VALUES (110, 41, 'intro text limit', 'The value for intro text  exceeds the limit')",
		   "INSERT INTO `events` VALUES (112, 41, 'height limit', 'The value for image height exceeds the limit')",
		   "INSERT INTO `events` VALUES (113, 41, 'text length', 'Enter the value for intro text')",
		   "INSERT INTO `events` VALUES (111, 41, 'width limit', 'The value for image width exceeds the limit')",
		   "INSERT INTO `events` VALUES (115, 42, 'allnews', 'Enter the value for allnews')",
		   "INSERT INTO `events` VALUES (114, 42, 'readalso', 'Enter the value for readalso')",
		   "INSERT INTO `events` VALUES (117, 42, 'spotlight', 'Enter the value for spotlight')",
		   "INSERT INTO `events` VALUES (116, 42, 'your', 'Enter the value for your are here ')",
		   "INSERT INTO `events` VALUES (82, 39, 'email null', 'Enter the value for Email')",
		   "INSERT INTO `events` VALUES (118, 32, 'Themes', 'Select Themes')",
		   "INSERT INTO `events` VALUES (55, 32, 'category', 'Select Category or Themes')",
		   "INSERT INTO `events` VALUES (36, 28, 'useremail', 'Please enter the user email  ')",
		   "INSERT INTO `events` VALUES (43, 28, 'password', 'Please enter the Password')",
		   "INSERT INTO `events` VALUES (37, 28, 'username', 'Please enter the username')",
		   "INSERT INTO `events` VALUES (119, 43, 'yesterday', NULL)",
		   "INSERT INTO `events` VALUES (120, 43, 'today', NULL)",
		   "INSERT INTO `events` VALUES (121, 43, 'home', NULL)",
		   "INSERT INTO `events` VALUES (122, 44, 'home', NULL)",
		   "INSERT INTO `events` VALUES (123, 45, 'today', NULL)",
		   "INSERT INTO `events` VALUES (124, 45, 'home', NULL)",
		   "INSERT INTO `events` VALUES (127, 42, 'home', 'Please enter value for home')",
		   "INSERT INTO `events` VALUES (125, 42, 'yesterday', 'Please enter value for yesterday')",
		   "INSERT INTO `events` VALUES (126, 42, 'today', 'Please enter value for today')",
		   "INSERT INTO `events` VALUES (46, 31, 'category', 'Select Theme(s)')");


for($x = 0; $x < count($events_data); $x++) {
	    if(!$r = mysql_query($events_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the events table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

$category_data=array("INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('In the Spotlight', 'n', 'In the Spotlight', 'en', 'In the Spotlight', 'C', 'Center')",
		     "INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('Read also', 'n', 'Read also', 'en', 'Read also', 'C', 'Right')",
		     "INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('In de kijker', 'n', 'In de kijker', 'nl', 'In de kijker', 'C', 'Center')",
		     "INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('ook lezen', 'n', 'Ook lezen', 'nl', 'lezen', 'C', 'Right')",
		     "INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('In the spotlight', 'n', 'In the spotlight', 'de', 'In the spotlight', 'C', 'Center')",
		     "INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('raedad', 'n', 'Read also', 'de', 'Read', 'C', 'Right')",
		     "INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('A lanune', 'n', 'A la Une', 'fr', 'Ala une', 'C', 'Center')",
		     "INSERT INTO `category` (description,category_status,category_name,language,short_name,type,position) VALUES ('Lire', 'n', 'Lire aussi', 'fr', 'Lirew', 'C', 'Right')");

for($x = 0; $x < count($category_data); $x++) {
	    if(!$r = mysql_query($category_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the category table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }


$admin_data=array("INSERT INTO `admin` VALUES (1, '<P><STRONG><FONT color=#66ccff>Welcome to Newsmanager</FONT></STRONG></P>')");

for($x = 0; $x < count($admin_data); $x++) {
	    if(!$r = mysql_query($admin_data[$x], $db))
	      die("<TD class=\"cont\">Error, could not insert data into the admin table. Reason: ". mysql_error() . "</TD></TR></TABLE>");
	 }

	 echo "<TD><font color=\"#D30032\" class=\"cont\">[OK]</FONT></TD></TR>";
	 echo "<TR><TD><font color=\"#D30032\" class=\"cont\">Database Created Successfully!</FONT></TD></TR>";
	 echo "<TR><TD class=\"cont\" hieght=\"10\">&nbsp;</TD></TR>";
     echo "<TR><TD class=\"cont\">Go to <a href=\"login/\" class=\"link\">Admin</a>&nbsp;Backend</TD></TR>";
     echo "<TR><TD class=\"cont\">Go to<a href=\"\" class=\"link\">Homepage</a>&nbsp;Frontend</TD></TR>";
	 echo "</TABLE>";

$class_db .="mysql||";
$class_db .=$dbserver."||";
$class_db .=$dbname."||";
$class_db .=$dbuser."||";
$class_db .=$dbpass."||";

$class_db =rtrim($class_db,"||");
$file=fopen("db/connect_str.php","w");
if(is_writeable("db/connect_str.php"))
 {
     fwrite($file,$class_db);
     fclose($file);
 }

}else{?>
<FORM METHOD="POST" ACTION="<?php echo $PHP_SELF ?>"><br>
	<TABLE BORDER="1" bordercolor="#000000" CELLPADDING="1" CELLSPACING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="50%">
	      <TR>
	      <TD class="cont" BGCOLOR="#FFFFFF">
	      <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="1" WIDTH="100%">
	            <TR BGCOLOR="#FFFFFF"  class="cont" ALIGN="CENTER">
	            <TD COLSPAN="2" class="cont"><b>Newsmanager Installer</b></TD>
	            </TR>
	            <TR BGCOLOR="#FFFFFF" class="cont" ALIGN="LEFT">
	            <TD COLSPAN="2">Thank you for choosing Newsmanager. This install will take only a few minutes of your time and when it is complete you will
	                have a newsmanager homepage.<BR>The first step is to setup your database. In the form below please fill
	                in all areas of the form and press the 'submit' button.
	            </TD>
	            </TR>
	            <TR><TD colspan="2"><HR color="#000000"></TD></TR>
	            <TR ALIGN="LEFT">
                    <TD BGCOLOR="#FFFFFF" class="cont">Database Server Address:</TD>
	            <TD BGCOLOR="#FFFFFF" class="cont"><INPUT TYPE="TEXT" NAME="dbserver" class="cont" SIZE="30" VALUE="<?=$_SERVER['SERVER_NAME']?>"></TD>
	            </TR>
	            <TR>
                    <TD BGCOLOR="#FFFFFF" class="cont">Database Name:</TD>
	            <TD BGCOLOR="#FFFFFF" class="cont"><INPUT TYPE="TEXT" NAME="dbname" class="cont" SIZE="30" VALUE="newsmanager"></TD>
	            <TR>
	            <TD BGCOLOR="#FFFFFF" class="cont">Database User name:</TD>
	            <TD BGCOLOR="#FFFFFF" class="cont"><INPUT TYPE="TEXT" NAME="dbuser" SIZE="30" class="cont" VALUE="root"></TD>
	            </TR>
	            <TR>
                    <TD BGCOLOR="#FFFFFF" class="cont">Database Password:</TD>
	            <TD BGCOLOR="#FFFFFF" class="cont"><INPUT TYPE="PASSWORD" NAME="dbpass" class="cont" value="" SIZE="30"></TD>
	            </TR>
	            <TR BGCOLOR="#FFFFFF" ALIGN="CENTER" class="cont">
	            <TD COLSPAN="2" class="cont"><INPUT TYPE="HIDDEN" NAME="next" VALUE="database"><INPUT TYPE="image" src="images/submit.jpg" name="submit" VALUE="submit"></TD>
	            </TR>
	      </TABLE>
	</TD>
	</TR>
      </TABLE>
    </form>
    <?}?>

    </body>
    </html>
Return current item: News Manager - RSS aggregator