Location: PHPKode > projects > News Manager - RSS aggregator > newsmanager/install_pgsql.php
<?php
/***************************************************************************
*                           install_pgsql.php  -  description
****************************************************************************/
?>
<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'];
$port_no="5432";

 if(!$db = @pg_connect("host=$dbserver port=$port_no user=$dbuser password=$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>";
  	   flush();
	   echo "<font color=\"#000000\" class=\"cont\">Attempting to create database $dbname...</font><br>";
	   flush();
 if(!$r = @pg_query($db,"CREATE DATABASE $dbname"))
       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.");
 else
     $db_new = @pg_connect("host=$dbserver port=$port_no dbname=$dbname user=$dbuser password=$dbpass");

     echo "<font color=\"#000000\" class=\"cont\">Database Created!</font><BR>";
   	 flush();
     echo "<font color=\"#000000\" class=\"cont\">Creating tables an inserting default data...</font><BR>";
	 flush();

$seq_id=array("user_id_seq"=>"CREATE SEQUENCE user_id_seq
    							INCREMENT BY 1
    							NO MAXVALUE
    							NO MINVALUE
    							CACHE 1;",
			  "category_id_seq"=>"CREATE SEQUENCE category_id_seq
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "subcategory_id_seq"=>"CREATE SEQUENCE subcategory_id_seq
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "channel_id_seq"=>"CREATE SEQUENCE channel_id_seq
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "newsitem_id_seq"=>"CREATE SEQUENCE newsitem_id_seq
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "rssurl_id_seq"=>"CREATE SEQUENCE rssurl_id_seq
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
			 					CACHE 1;",
			  "menu_id_seq"=>"CREATE SEQUENCE menu_id_seq
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "news_category_id_seq"=>"CREATE SEQUENCE news_category_id_seq
				     			INCREMENT BY 1
				      			NO MAXVALUE
				      			NO MINVALUE
				    			CACHE 1;",
			  "static_id"=>"CREATE SEQUENCE static_id
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "mod_id"=>"CREATE SEQUENCE mod_id
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "event_id"=>"CREATE SEQUENCE event_id
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "text_id"=>"CREATE SEQUENCE text_id
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "intro_id"=>"CREATE SEQUENCE intro_id
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;",
			  "interface_id"=>"CREATE SEQUENCE interface_id
								INCREMENT BY 1
								NO MAXVALUE
								NO MINVALUE
								CACHE 1;"
    		 );



 $tables = array ("admin" => "CREATE TABLE admin (
  									user_id integer,
  									welcome_message text
								)",
				  "category" => "CREATE TABLE category (
									category_id integer DEFAULT nextval('category_id_seq'::pg_catalog.text),
									description pg_catalog.text,
									category_status character(2),
									category_name character varying(50),
									language character(2),
									short_name character varying(255),
									type character(2),
    								position character varying(20)
					  			)",
				  "events" => "CREATE TABLE events (
  									id integer DEFAULT nextval('event_id'::pg_catalog.text),
									parent integer,
									name character varying(100),
    								description pg_catalog.text
								)",
				  "interface"=> "CREATE TABLE interface (
									id integer DEFAULT nextval('interface_id'::pg_catalog.text),
									position character varying(10),
									image pg_catalog.text,
    								url pg_catalog.text
							)",
				  "intro" => "CREATE TABLE intro (
	  							    id integer DEFAULT nextval('intro_id'::pg_catalog.text),
								    search_results_text_chars integer,
								    spotlight_text_chars integer,
								    image_height integer,
    						        image_width integer,
									image_position character varying(10),
									time_delay	integer,
									allnews_item_home integer,
									allnews_item integer,
									display_spotlight integer,	
									display_allnews integer,
									spotlight_item integer,
									style integer
							)",
				  "language"=> "CREATE TABLE language (
									lang_id character(2),
    								language_name character varying(50)
							)",
				  "menus"=>"CREATE TABLE menus (
									menu_id integer DEFAULT nextval('menu_id_seq'::pg_catalog.text),
									menu_name character varying(50),
									url pg_catalog.text,
									image pg_catalog.text,
									position character varying(10),
									version integer,
									description character varying(100),
									alt_image character varying(20),
    								language character varying(2)
							)",
				  "modules"=>"CREATE TABLE modules (
					  				 id integer DEFAULT nextval('mod_id'::pg_catalog.text),
    								 name character varying(100)
							)",
				  "new_newsitem"=>"CREATE TABLE new_newsitem (
								     newsitem_id integer DEFAULT nextval('newsitem_id_seq'::pg_catalog.text),
									 rss_channel_id integer,
									 channel_short_name character varying(20),
									 hour pg_catalog.text,
									 language character varying(2),
									 url_external pg_catalog.text,
									 frontend character varying(1),
									 body pg_catalog.text,
									 introtext pg_catalog.text,
									 title character varying(300),
									 alt_tag character varying(200),
    								 pubdate date
							)",
				  "newsitem_category"=>"CREATE TABLE newsitem_category (
								     newsitem_id integer,
									 category_id integer,
									 subcategory_id integer,
									 id integer DEFAULT nextval('news_category_id_seq'::pg_catalog.text),
									 pubdate timestamp without time zone,
    								 flag character(1)
							)",
				  "rsschannel"=>"CREATE TABLE rsschannel (
								     channel_id integer DEFAULT nextval('channel_id_seq'::pg_catalog.text),
								     channel_description pg_catalog.text,
								     channel_url pg_catalog.text,
								     channel_title pg_catalog.text,
								     channel_image pg_catalog.text,
								     channel_copyright pg_catalog.text,
								     channel_pubdate pg_catalog.text,
								     channel_status character varying(2),
								     channel_managing_editor pg_catalog.text,
								     channel_generator pg_catalog.text,
								     channel_docs pg_catalog.text,
								     channel_rating pg_catalog.text,
								     channel_text_input pg_catalog.text,
								     channel_skiphours pg_catalog.text,
								     channel_skipdays pg_catalog.text,
								     channel_cloud pg_catalog.text,
								     channel_ttl pg_catalog.text,
								     channel_webmaster character varying(100),
								     channel_language character(2),
								     channel_author character varying(100),
								     channel_shortname character varying(255),
    								 channel_lastdate date
						)",
				  "rsschannel_category"=>"CREATE TABLE rsschannel_category (
								     rss_channel_id integer,
								     category_id integer,
    								 subcategory_id integer
						)",
				  "rssurl_newsitem"=>"CREATE TABLE rssurl_newsitem (
								     url_newsitem_id integer DEFAULT nextval('rssurl_id_seq'::pg_catalog.text),
								     rss_channel_id integer,
								     news_title pg_catalog.text,
								     description pg_catalog.text,
								     image pg_catalog.text,
								     url pg_catalog.text,
								     frontend_export character(1),
								     enclosure pg_catalog.text,
								     hour pg_catalog.text,
								     language character(2),
								     pubdate date,
								     last_builddate date,
									 category pg_catalog.text,
    								 pubtime timestamp without time zone
						)",
				  "static"=>"CREATE TABLE static (
								     page_id integer DEFAULT nextval('static_id'::pg_catalog.text),
								     description pg_catalog.text,
								     language character(2),
								     position character varying(200),
								     version character varying(200),
								     image pg_catalog.text,
    								 title pg_catalog.text
						)",
				  "subcategory"=>"CREATE TABLE subcategory (
								     subcategory_id integer DEFAULT nextval('subcategory_id_seq'::pg_catalog.text),
								     category_id integer,
								     description pg_catalog.text,
								     subcategory_status character(2),
								     short_name character varying(255),
								     language character(2),
                                     subcategory_name character varying(50)
						)",
				  "text"=>"CREATE TABLE text (
								     id integer DEFAULT nextval('text_id'::pg_catalog.text),
								     language character(2),
								     advanced_search pg_catalog.text,
								     your pg_catalog.text,
								     allnews pg_catalog.text,
								     search_results pg_catalog.text,
								     copyright pg_catalog.text,
								     home pg_catalog.text,
								     yesterday pg_catalog.text,
								     today pg_catalog.text,
								     category_center pg_catalog.text,
    							     category_right pg_catalog.text,
    							     no_news_available pg_catalog.text
						)",
				  "users"=>"CREATE TABLE users (
								     userid integer DEFAULT nextval('user_id_seq'::pg_catalog.text),
								     username character varying(50),
								     email pg_catalog.text,
								     password pg_catalog.text,
    							     flag character(2))"
						);


	echo "<TABLE BORDER=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">\n";
  while(list($name,$seq_id_) = each($seq_id)) {
  	    if(!$r = pg_query($db_new,$seq_id_))
  	      die("<TD><font color=\"#FF0000\" class=\"cont\">ERROR! Could not create table. Reason: <b>". mysql_error()."</b></TD></TR></TABLE>");
  	 }

  while(list($name,$table) = each($tables)) {
  	    echo "<TR><TD class=\"cont\">Creating table $name</TD>";
  	    if(!$r = pg_query($db_new,$table))
  	      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 = pg_query($db_new,$user_data[$x]))
	      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 = pg_query($db_new,$text_data[$x]))
	      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 = pg_query($db_new,$static_data[$x]))
	      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 = pg_query($db_new,$modules_data[$x]))
	      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 = pg_query($db_new,$menus_data[$x]))
	      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 = pg_query($db_new,$language_data[$x]))
	      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 = pg_query($db_new,$intro_data[$x]))
	      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 = pg_query($db_new,$interface_data[$x]))
	      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 = pg_query($db_new,$events_data[$x]))
	      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 = pg_query($db_new,$category_data[$x]))
	      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 = pg_query($db_new,$admin_data[$x]))
	      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 .="pgsql||";
$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