# - changed permissions of database.inc.php twice: first to 0644 (before) # then to 0440 (after writing the file) # - changed permissions on a few directories from 0777 to 0755 # (nevermind that there seems to be an error in the path to 'media', # 'studentpages' and 'languages') # - removed three trailing spaces in tablenames in database.inc.php # (sections, studentpages, classes). # - we now properly close the file database.inc.php after writing to it # - changed default value for 'file_permissions' from 0777 to 0755 when # filling configuration table # ############################################################################ # LICENSE INFORMATION # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ############################################################################## define('IN_SAS', true); if (IsSet ($_GET['language'])) { $language = $_GET['language']; } $valid_langs = array ( "NL", "EN", "DE", "ES", "DA", "FR" ); $language = strtoupper($language); if ((in_array($language, $valid_langs)) AND (file_exists($language . ".php"))) { include ($language . ".php"); } else { include ("EN.php"); } include ("../core/common.inc.php"); ?> <?php print $sas_lang['lang_install_1'] ?>
 

 


 

 
">
 
 

 



" . $sas_lang['lang_install_step1'] . "
" . $sas_lang['lang_install_6'] . "
 

" . $serverpath . $userpath . $sas_lang['lang_install_46'] . "
"; exit; } if (is_writable("$serverpath$userpath/configuration/database.inc.php") == FALSE) { print " Step 1
" . $sas_lang['lang_install_6'] . "  
"; if (file_exists("$serverpath$userpath/configuration/database.inc.php") == FALSE) { print "
" . $sas_lang['lang_install_47']; } else { print "
$serverpath$userpath/configuration/database.inc.php " . $sas_lang['lang_install_48']; } print "

" . $sas_lang['lang_install_49'] . "

"; exit; } ?>
 
"; print ""; print ""; print ""; print ""; ?>

 

 

 

 



\n"; $dbsettings = $dbsettings . '$db_server = "'; $dbsettings = $dbsettings . "$dbserver"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$db_name = "'; $dbsettings = $dbsettings . "$dbname"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$db_username = "'; $dbsettings = $dbsettings . "$dbuser"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$db_password = "'; $dbsettings = $dbsettings . "$dbpassword"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$dbprefix = "'; $dbsettings = $dbsettings . "$dbprefix"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_configuration = "'; $dbsettings = $dbsettings . "$table_configuration"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_editors = "'; $dbsettings = $dbsettings . "$table_editors"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_modules = "'; $dbsettings = $dbsettings . "$table_modules"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_users = "'; $dbsettings = $dbsettings . "$table_users"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_pages = "'; $dbsettings = $dbsettings . "$table_pages"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_sections = "'; $dbsettings = $dbsettings . "$table_sections"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_studentpages = "'; $dbsettings = $dbsettings . "$table_studentpages"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . '$table_classes = "'; $dbsettings = $dbsettings . "$table_classes"; $dbsettings = $dbsettings . '";'; $dbsettings = $dbsettings . "\n"; $dbsettings = $dbsettings . ""; // This include file should NOT be 0777! It can be changed to 0440 or even 0400 // after the file is properly closed (!). 2006-05-30/PF @ chmod("$serverpath$userpath/configuration/database.inc.php", 0640); $dbconfig = fopen("$serverpath$userpath/configuration/database.inc.php", "w"); fwrite($dbconfig, "$dbsettings"); fclose($dbconfig); @ chmod("$serverpath$userpath/configuration/database.inc.php", 0440); $link = @ mysql_connect("$dbserver", "$dbuser", "$dbpassword"); // connecting to database if (!$link) { print " Step 1
" . $sas_lang['lang_install_6'] . "  

" . $sas_lang['lang_install_51'] . "
" . mysql_error() . "

" . $sas_lang['lang_install_52'] . "

"; exit; } mysql_query("CREATE DATABASE IF NOT EXISTS $dbname"); mysql_select_db("$dbname"); if (mysql_errno() != 0) { print " " . $sas_lang['lang_install_step1'] . "
" . $sas_lang['lang_install_6'] . "  

Mysql error: " . mysql_error() . "

" . $sas_lang['lang_install_50'] . "

"; exit; } mysql_query("CREATE TABLE $table_sessions (ses_id varchar(32) NOT NULL default '', ses_time int(11) NOT NULL default 0, ses_start int(11) NOT NULL default 0, ses_value text NOT NULL, PRIMARY KEY (ses_id))"); mysql_query("CREATE TABLE $table_configuration (config_key varchar(64) not NULL,config_value text not NULL, description varchar(255), PRIMARY KEY (config_key))"); mysql_query("INSERT INTO $table_configuration VALUES ('serverpath', '$serverpath', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('user_path', '$userpath', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('url', '$serverurl', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('sessioncode', '$sessioncode', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('theme', 'editable', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('protected_theme', 'editable', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('sitename', '$sitename', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('startsection', '1', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('protected_startsection', '1', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('highvisual', '0', '')"); //mysql_query("INSERT INTO $table_configuration VALUES ('securitymethod', 'sessions', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('dateformat', '%d-%m-%Y', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('htmlarea_editor_rows', '20', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('number_pupilpages', '3', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('edex_file_name' , '' , '')"); # change by AGJ 30/06/2004 mysql_query("INSERT INTO $table_configuration VALUES ('media_dir', 'media', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('studentpages_dir', 'studentpages', '')"); $today = time(); mysql_query("INSERT INTO $table_configuration VALUES ('last_backup_date', '$today', '')"); mysql_query("CREATE TABLE $table_editors (id int(11) NOT NULL auto_increment, name varchar(40) NOT NULL default '', location varchar(40) NOT NULL default '', description text NOT NULL, PRIMARY KEY (id))"); mysql_query("INSERT INTO $table_editors VALUES (1, 'FCKEditor', 'fckeditor/editor.php', '')"); mysql_query("INSERT INTO $table_editors VALUES (2, 'HTMLarea Editor', 'htmlarea/editor.php', '')"); mysql_query("INSERT INTO $table_editors VALUES (3, 'Plain text Editor', 'sn_plain/editor.php', '')"); mysql_query("CREATE TABLE $table_modules (id int(11) NOT NULL auto_increment, name varchar(60) NOT NULL default '', location varchar(60) NOT NULL default '', options text NOT NULL, admin varchar(40) NOT NULL default '', dbtables text NOT NULL, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $table_pages (id int(11) NOT NULL auto_increment, section varchar(10) NOT NULL default '', name varchar(80) NOT NULL default '', invisible varchar(10) NOT NULL default '', content text NOT NULL, module varchar(80) NOT NULL default '', sort TINYINT(4) NOT NULL default 0, count int(11), createdate date, lastvisitdate date, category char(20) NOT NULL, lastupdate DATETIME, history varchar(20), locked_by int(11) default null, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $table_sections (id int(11) NOT NULL auto_increment, name varchar(80) NOT NULL default '', invisible varchar(20) NOT NULL default '', frontpage int(11) NOT NULL default 0, parent varchar(120) NOT NULL default '', sort tinyint(4) NOT NULL default 0, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $table_users (id int(11) NOT NULL auto_increment, name varchar(60) NOT NULL default '', username varchar(20) NOT NULL default '', password varchar(40) NOT NULL default '', email varchar(80) NOT NULL default '', access varchar(50) NOT NULL default '', highvisibility tinyint(4) NOT NULL default 0, editor varchar(40) NOT NULL default 1, type tinyint(4), class varchar(80), sections varchar(80) NOT NULL default '', project varchar(80), initial tinyint(1) default 0, code varchar(20) default NULL, invalid_logins tinyint(1) default 0, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $table_studentpages (studentid int(11) NOT NULL auto_increment, content text NOT NULL, newcontent text NOT NULL, pcheck tinyint(4) NOT NULL default 1, approved tinyint(4) NOT NULL default 0, send_email tinyint NOT NULL default 0, title varchar(50) NOT NULL, dir_number int(11) NOT NULL, change_date DATE NOT NULL, sort tinyint(4) not null default 0, invisible tinyint(1) not null default 0, PRIMARY KEY (studentid))"); mysql_query("CREATE TABLE $table_classes (id int(11) NOT NULL auto_increment, name varchar(40) NOT NULL default '', teachers text NOT NULL, project tinyint(4) NOT NULL DEFAULT 0, PRIMARY KEY (id))"); //mysql_query("INSERT INTO $table_classes VALUES ('', '--------', '0')"); // version 2.0 mysql_query("CREATE TABLE $table_prot_pages (id int(11) NOT NULL auto_increment, section varchar(10) NOT NULL default '', name varchar(80) NOT NULL default '', invisible varchar(10) NOT NULL default '', content text NOT NULL, module varchar(80) NOT NULL default '', sort TINYINT(4) NOT NULL default 0, count int(11), createdate date, lastvisitdate date, category char(20) NOT NULL, lastupdate DATETIME, history varchar(20), locked_by int(11) default null, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $table_prot_sections (id int(11) NOT NULL auto_increment, name varchar(80) NOT NULL default '', invisible varchar(20) NOT NULL default '', frontpage int(11) NOT NULL default 0, parent varchar(120) NOT NULL default '', sort tinyint(4) NOT NULL default 0, PRIMARY KEY (id))"); //alerts $table_alerts = $dbprefix . "alerts"; mysql_query("INSERT INTO $table_configuration VALUES ('send_alerts', '0', '')"); mysql_query("CREATE TABLE $table_alerts (id int(11) NOT NULL auto_increment, email varchar(80) NOT NULL default '', sections varchar(50) NOT NULL default '', name char(40) NOT NULL default '', PRIMARY KEY (id))"); mysql_query("INSERT INTO $table_configuration VALUES ('send_alerts_per_section', '0', '')"); //stats $table_stats = $dbprefix . "stats"; mysql_query("CREATE TABLE $table_stats (id int(11) NOT NULL auto_increment, ip varchar(15) not null, received date not null, pageid varchar(10) not null, sectionid varchar(10) not null, count int(11) NOT NULL default 0, public tinyint(4), primary key (id) )"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } mysql_query("INSERT INTO $table_configuration VALUES ('stats_ip_filter', '127.0.0.1', '')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } //agenda $agenda_table_events = $dbprefix . "m_agenda_events"; $agenda_table_names = $dbprefix . "m_agenda_names"; mysql_query("CREATE TABLE $agenda_table_names (id int(11) NOT NULL auto_increment, name varchar(75) not null, sort tinyint(4) NOT NULL, username varchar(20) not null, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $agenda_table_events (id int(11) NOT NULL auto_increment, adate date, timeslot tinyint, descr text not null, agenda int(11) NOT NULL, PRIMARY KEY (id))"); $result = mysql_query("SELECT id FROM $table_modules WHERE location = 'sn_agenda'"); $RecordCount = mysql_num_rows($result); if ($RecordCount == 0) { mysql_query("INSERT INTO $table_modules VALUES (NULL, 'Agenda', 'sn_agenda', 'view_agenda.php,View agenda', 'admin.php', '$agenda_table_events,$agenda_table_names')"); } mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time01', '08:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time02', '08:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time03', '08:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time04', '08:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time05', '09:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time06', '09:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time07', '09:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time08', '09:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time09', '10:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time10', '10:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time11', '10:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time12', '10:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time13', '11:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time14', '11:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time15', '11:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time16', '11:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time17', '12:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time18', '12:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time19', '12:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time20', '12:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time21', '13:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time22', '13:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time23', '13:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time24', '13:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time25', '14:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time26', '14:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time27', '14:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time28', '14:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time29', '15:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time30', '15:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time31', '15:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time32', '15:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time33', '16:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time34', '16:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time35', '16:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time36', '16:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time37', '17:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time38', '17:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time39', '17:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time40', '17:45', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time41', '18:00', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time42', '18:15', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time43', '18:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_time44', '18:30', '' )"); mysql_query("INSERT INTO $table_configuration (config_key, config_value, description) VALUES( 'agenda_options', '#9AD894,#D80000,#B29D78,#0080F0,#FFFFFF,#B5D7EF,#BBBBBB,#B5D7EF,#E7E3E7,#E7E3E7,#FFCC33,#00CCFF', '' )"); //ads module mysql_query("CREATE TABLE $modtable_ads (ad_id int(11) NOT NULL auto_increment, email varchar(40) NOT NULL default '', ad_text text NOT NULL, date date, name varchar(45), initial tinyint(1) default 0, PRIMARY KEY (ad_id))"); mysql_query("INSERT INTO $table_configuration VALUES ('ads_email', '', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('ads_expiration_days', '30', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('ads_check_before_post', '0', '')"); //album module $table_module_allbum = $dbprefix . 'm_allbum'; mysql_query("Create Table $table_module_allbum(id int not null auto_increment, type enum('album','subalbum','picture','sound','movie','doc', 'existing_object', 'unknown' ), title LONGTEXT, description LONGTEXT, path LONGTEXT, thumb LONGTEXT, parent LONGTEXT, children LONGTEXT, hidden bool, ispage tinyint(4) NOT NULL DEFAULT 0, public tinyint(4) NOT NULL default 0, primary key (id))"); mysql_query("INSERT INTO $table_configuration VALUES ('allbum_thumbsize_x','150','max hor thumb size (px)')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } mysql_query("INSERT INTO $table_configuration VALUES ('allbum_picsize_x','600','max hor pic size (px)')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } mysql_query("INSERT INTO $table_configuration VALUES ('allbum_max_objects_per_page','10','max objects per page')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } mysql_query("INSERT INTO $table_configuration VALUES ('allbum_max_allbums_per_page','10','max albums per page')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } mysql_query("INSERT INTO $table_configuration VALUES ('allbum_num_objects_per_row','3','number of objects shown per row')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } mysql_query("INSERT INTO $table_configuration VALUES ('allbum_gallery_dir','media/gallery/','relative path (w.r.t. starnet/) to gallery')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } mysql_query("INSERT INTO $table_configuration VALUES ('allbum_num_files','5','Number of files that can be selected for object upload')"); if (mysql_errno() != 0) { echo mysql_errno() . ": " . mysql_error() . "\n"; } //chat $chat_userstable = $dbprefix . "m_chat_users"; $chat_table = $dbprefix . "m_chat"; $chat_messagetable = $dbprefix . "m_chat_log"; mysql_query("CREATE TABLE $chat_userstable ( id int(11) NOT NULL auto_increment, ip varchar(255) NOT NULL default '', user varchar(255) NOT NULL default '', status varchar(6) NOT NULL default '', joined datetime NOT NULL default '0000-00-00 00:00:00', room int(11) default NULL, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $chat_messagetable ( id int(11) NOT NULL auto_increment, user varchar(255) NOT NULL default '', color varchar(255) NOT NULL default 'black', font varchar(255) NOT NULL default 'arial', size int(2) NOT NULL default 2, text varchar(255) NOT NULL default '', posted datetime NOT NULL default '0000-00-00 00:00:00', toperson varchar(16) NOT NULL default '0', system int(1) NOT NULL default '0', room int(11) default NULL, ip varchar(255) NOT NULL default '', PRIMARY KEY (id))"); mysql_query("CREATE TABLE $chat_table ( id int(11) NOT NULL auto_increment, name varchar(50) default NULL, title text, welcome text, width int(5) default NULL, height int(5) default NULL, public tinyint(4) default NULL, password varchar(15) default NULL, refresh int(11) NOT NULL default 2, options varchar(255) NOT NULL default '1', PRIMARY KEY (id)) "); //calendar $calendar_table = $dbprefix . "m_calendar_events"; $calendars_table = $dbprefix . "m_calendars"; mysql_query("CREATE TABLE $calendars_table (id int(11) NOT NULL auto_increment, name varchar(50) NOT NULL, options text NOT NULL, title text, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $calendar_table (id int(11) NOT NULL auto_increment, month tinyint(4) NOT NULL, year int(8), description text, calendar int(11) NOT NULL, PRIMARY KEY (id))"); //Up/download $downloadstable = $dbprefix . "m_downloads"; $downloadcategorytable = $dbprefix . "m_downloads_cat"; mysql_query("CREATE TABLE $downloadcategorytable (id int(11) NOT NULL auto_increment, title varchar(40) NOT NULL default '', ispage tinyint NOT NULL default 0, public tinyint(4) NOT NULL default 0, KEY (id))"); mysql_query("CREATE TABLE $downloadstable (id int(11) NOT NULL auto_increment, description text NOT NULL, category int(11) NOT NULL default 0, creator varchar(80) NOT NULL default '', filename varchar(80) NOT NULL default '', date datetime, counter tinyint(11) default 0, stored_file varchar(40), last_download date, PRIMARY KEY (id))"); //forms module $forms_table = $dbprefix . "m_forms"; $forms_config_table = $dbprefix . "m_forms_config"; //$forms_data_table = $dbprefix . "m_forms_data"; mysql_query("CREATE TABLE $forms_table (id int(11) NOT NULL auto_increment, name text NOT NULL, length varchar(5), form_id tinyint(4) NOT NULL, sort tinyint(4), required tinyint(4) NOT NULL default 0, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $forms_config_table (id int(11) NOT NULL auto_increment, welcome text, email_text text, form_name varchar(60), email text, email_subject varchar(50), send_copy tinyint(4), thank_you text, PRIMARY KEY (id))"); //mysql_query("CREATE TABLE $forms_data_table (form_id tinyint(4) NOT NULL, field_id tinyint(4) NOT NULL, field_content text, data_index int(11) NOT NULL)"); //mysql_query("ALTER TABLE $forms_config_table ADD mode tinyint( 4 )"); //mysql_query("ALTER TABLE $forms_table ADD export tinyint( 1 )"); //forum $table_users = "$dbprefix" . "m_forumuser"; $table_topics = "$dbprefix" . "m_forumtopics"; $table_replies = "$dbprefix" . "m_forumreplies"; $table_cat = "$dbprefix" . "m_forumcat"; mysql_query("CREATE TABLE $table_users(user_index int not null auto_increment, username varchar(50), firstname varchar(20), surname varchar(50), email varchar(50), password varchar(10), showemail tinyint, weburl varchar(100), joindate datetime, lastcontribution datetime, lastlogin datetime, topics int(11), replies int(11), cat_index int(11), primary key (user_index))"); mysql_query("CREATE TABLE $table_topics(topic_index int not null auto_increment, topictitle varchar(100), topicbody mediumtext, userid varchar(50), date datetime, replies int(11), topic_reads int(11), cat_index int(11), send_email varchar(1), primary key (topic_index))"); mysql_query("CREATE TABLE $table_replies(reply_index int not null auto_increment, topicindex int, replybody mediumtext, userid varchar(50), date datetime, cat_index int, primary key (reply_index))"); mysql_query("CREATE TABLE $table_cat(cat_index int not null auto_increment, name varchar(50), type tinyint(1), email varchar(100), primary key (cat_index))"); mysql_query("INSERT INTO $table_configuration VALUES ('forum_header_font_color', '#000000', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('forum_subtitle_background_color', '#638ABD', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('forum_odd_background_color', '#FFFFFF', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('forum_even_background_color', '#C0C0FF', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('forum_max_reply_char', '900', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('forum_max_topic_char', '900', '')"); //guestbook mysql_query("CREATE TABLE $modtable_guestbook (id int(11) NOT NULL auto_increment, name varchar(45) NOT NULL default '',email varchar(80) NOT NULL default '' ,homepage varchar(50) NOT NULL default '',date datetime, message text NOT NULL, initial tinyint(1) default 0, PRIMARY KEY (id))"); mysql_query("INSERT INTO $table_configuration VALUES ('gbook_email', '', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('gbook_max_items', '15', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('gbook_check_before_post', '0', '')"); //mail $table_email = $dbprefix . "m_mail_address"; mysql_query("CREATE TABLE $table_email (id int(11) NOT NULL auto_increment, name varchar(60) NOT NULL default '', description text, email varchar(80) NOT NULL default '', welcometext text, thankyoutext text, sort tinyint(4) NOT NULL default 0, PRIMARY KEY (id))"); mysql_query("INSERT INTO $table_configuration VALUES ('email_picture', 'starnet/graphics/email3.gif', '')"); //message $message_table = $dbprefix . "m_message"; mysql_query("CREATE TABLE $message_table ( id int(11) NOT NULL auto_increment, message text NOT NULL, date datetime default NULL, name varchar(45) default NULL, days int(11) default 0, todate date, public tinyint(4) DEFAULT 0, PRIMARY KEY (id))"); //links $links_table = $dbprefix . "m_links"; $links_cat_table = $dbprefix . "m_links_cat"; mysql_query("CREATE TABLE $links_table ( id int(11) NOT NULL auto_increment, title varchar(50) NOT NULL default '', url varchar(100) NOT NULL default '', description text NOT NULL, pagename int(11) NOT NULL default '0', initial tinyint(1) NOT NULL default '1', sort tinyint(4) NOT NULL default '0', category varchar(30) NOT NULL default '', PRIMARY KEY (id))"); mysql_query("CREATE TABLE $links_cat_table ( id int(11) NOT NULL auto_increment, pagename varchar(50) NOT NULL default '', owner_email varchar(80) NOT NULL default '', row_count tinyint(4) NOT NULL default '0', welcome text NOT NULL, icon varchar(50) NOT NULL default '', propose tinyint(1) NOT NULL default '0', propose_welcome text, showlink tinyint(1) NOT NULL default '0', PRIMARY KEY (id))"); $result = mysql_query("SELECT id FROM $table_modules WHERE location = 'sn_links'"); $RecordCount = mysql_num_rows($result); if ($RecordCount == 0) { mysql_query("INSERT INTO $table_modules VALUES (NULL, 'Links', 'sn_links', 'view_links.php,Show Links on page', 'admin.php', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('links_module_row_count', '1', '')"); mysql_query("INSERT INTO $table_configuration VALUES ('links_module_icon', '/starnet/modules/sn_links/link.gif', '')"); } //news mysql_query("CREATE TABLE $modtable_news_categories (id int(11) NOT NULL auto_increment, title varchar(40) NOT NULL default '', ispage tinyint(4) NOT NULL default 0, header text NOT NULL, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $modtable_news_articles (id int(11) NOT NULL auto_increment, title varchar(80) NOT NULL default '', date varchar(20) NOT NULL default '', category varchar(40) NOT NULL default '', content text NOT NULL, archive tinyint(1) NOT NULL default 0, public tinyint(4) NOT NULL default 0, PRIMARY KEY (id))"); mysql_query("INSERT INTO $table_configuration VALUES ('news_template', 'standard', '')"); //newsletter module $table_newsletter_content = $dbprefix . "m_newsletters"; $table_newsletters = $dbprefix . "m_newsletter_cat"; $table_email_adresses = $dbprefix . "m_newsletter_emails"; mysql_query("CREATE TABLE $table_email_adresses (id int(11) NOT NULL auto_increment,name varchar(100) not null, email varchar(80),remarks varchar(100),newsletter_id varchar(30), date date, enable tinyint(4), surename varchar(35) not null, code varchar(12), PRIMARY KEY (id))"); mysql_query("CREATE TABLE $table_newsletter_content (id int(11) NOT NULL auto_increment, title text, archive tinyint(4) default 0, content text, newsletter_id tinyint(4), date date, published tinyint(4) not null default 0, sent tinyint(4) not null default 0, header text, footer text, public tinyint(4) NOT NULL default 0 , locked_by int(11) default null, PRIMARY KEY (id))"); mysql_query("CREATE TABLE $table_newsletters (id int(11) NOT NULL auto_increment, name varchar(50) , title text, link tinyint(4),email varchar(80) not null, confirm tinyint(4) not null, register_text text ,decline_text text , contribute_text text, contribute tinyint(4), extra_info varchar(40), contribute_thanks text, public tinyint(4) NOT NULL default 0, template text default null, sender_email varchar(80) not null, PRIMARY KEY (id))"); //search mysql_query("INSERT INTO $table_configuration VALUES ('search_module_results', '10', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_name1', 'sn_news,m_news_articles,1,0,0', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_name2', 'sn_newsletter,m_newsletters,1,0,0', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_name3', 'sn_studentpages,m_studentpages,0,0,0', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_name4', 'sn_allbum,m_allbum,1,0,0', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_searchfield1', 'title, content', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_searchfield2', 'title, content', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_searchfield3', 'content,title', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_searchfield4', 'title,description', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_returnfield1', 'id, title, content', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_returnfield2', 'id, title, content', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_returnfield3', 'studentid,title,content', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_returnfield4', 'parent,title,description', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_url1', '&article=@0@', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_url2', '&option=view&newsletter_id=@0@', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_url3', '&student=@0@', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_url4', '&ID=@0@&gallerypage=1', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_pageid1', '2,4,1,1', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_pageid2', '4,11,1,2', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_pageid3', '3,7,1,3', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_pageid4', '5,10,1,4', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_extra_select1', 'AND archive = 0', 'Only search in non archived news')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_extra_select2', 'AND published = 1', 'Only search in public/published newsletters')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_extra_select3', '', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_extra_select4', '', ' ')"); mysql_query("INSERT INTO $table_configuration VALUES ('search_module_invisible', '0', ' ')"); //template editor $template_table = $dbprefix . "m_template"; mysql_query("CREATE TABLE $template_table (script varchar(20) NOT NULL default '', descr text NOT NULL default '', type1 char(1) default NULL, name1 varchar(100) default '', type2 char(1) default NULL, name2 varchar(100) default '', type3 char(1) default NULL, name3 varchar(100) default '', type4 char(1) default NULL, name4 varchar(100) default '', type5 char(1) default NULL, name5 varchar(100) default '', type6 char(1) default NULL, name6 varchar(100) default '', type7 char(1) default NULL, name7 varchar(100) default '', type8 char(1) default NULL, name8 varchar(100) default '')"); $result = mysql_query("SELECT id FROM $table_modules WHERE location = 'sn_templates'"); $RecordCount = mysql_num_rows($result); if ($RecordCount == 0) { mysql_query("INSERT INTO $table_modules VALUES ('', 'Template editor', 'sn_templates', '', 'admin.php', '')"); } //TV module $table_scripts = $dbprefix . "m_scripts"; mysql_query("CREATE TABLE $table_scripts (id int(11) NOT NULL auto_increment, name varchar(50) NOT NULL default '', script varchar(30) NOT NULL default '', active tinyint(4) default NULL, varname1 varchar(15) default NULL, value1 text default NULL, varname2 varchar(15) default NULL, value2 text default NULL, varname3 varchar(15) default NULL, value3 text default NULL, welcome text, loc_id tinyint(11), PRIMARY KEY (id))"); mysql_query("INSERT INTO $table_scripts VALUES (1, 'Scrollscript', 'scroll_page.php', 1, 'Page number', '1', 'Speed', '2', NULL, '', '', '1')"); mysql_query("INSERT INTO $table_scripts VALUES (2, 'Slideshow', 'slideshow_full.php', 0, 'Album name', 'slideshow', 'Speed', '5', 'Width', '300', '', '1')"); mysql_query("INSERT INTO $table_scripts VALUES (3, 'Showpage', 'show_page.php', 0, 'Page number', '1', NULL, '', NULL, '', '', '1')"); mysql_query("INSERT INTO $table_scripts VALUES (4, 'Page slideshow', 'page_slideshow.php', 0, 'Pages', '1', NULL, '', NULL, '', '', '1')"); $result = mysql_query("SELECT id FROM $table_modules WHERE location = 'sn_tvmodule'"); $RecordCount = mysql_num_rows($result); if ($RecordCount == 0) { mysql_query("INSERT INTO $table_modules VALUES (NULL, 'TV Module', 'sn_tvmodule', '', 'admin.php', '')"); } if (file_exists("mysql_" . $language . ".php")) { include ("mysql_" . $language . ".php"); } else { include ("mysql_EN.php"); } mysql_query("INSERT INTO $table_configuration VALUES ('use_encryption', '1', 'Encrypt passwords 1=yes 0=no')"); mysql_query("INSERT INTO $table_configuration VALUES ('sas_version', '2.4', 'Sas main version')"); mysql_query("INSERT INTO $table_configuration VALUES ('sas_patch_version', '10', 'Sas patch version')"); mysql_query("INSERT INTO $table_configuration VALUES ('file_permissions', '0755', 'File permissions for upload')"); //check if all tables are created. $sas_tables[0] = $dbprefix . "configuration"; $sas_tables[1] = $dbprefix . "users"; $sas_tables[2] = $dbprefix . "editors"; $sas_tables[3] = $dbprefix . "pages"; $sas_tables[4] = $dbprefix . "sections"; $sas_tables[5] = $dbprefix . "prot_pages"; $sas_tables[6] = $dbprefix . "prot_sections"; $sas_tables[7] = $dbprefix . "classes"; $sas_tables[8] = $dbprefix . "modules"; $sas_tables[9] = $dbprefix . "stats"; $sas_tables[10] = $dbprefix . "alerts"; $sas_tables[11] = $dbprefix . "m_studentpages"; $sas_tables[12] = $dbprefix . "sessions"; $sas_mod_tables[0] = $dbprefix . "m_gbook"; $sas_mod_tables[1] = $dbprefix . "adtext"; $sas_mod_tables[2] = $dbprefix . "m_mail_address"; $sas_mod_tables[3] = $dbprefix . "m_agenda_events"; $sas_mod_tables[4] = $dbprefix . "m_agenda_names"; $sas_mod_tables[5] = $dbprefix . "m_allbum"; $sas_mod_tables[6] = $dbprefix . "m_template"; $sas_mod_tables[7] = $dbprefix . "m_downloads"; $sas_mod_tables[8] = $dbprefix . "m_downloads_cat"; $sas_mod_tables[9] = $dbprefix . "m_news_articles"; $sas_mod_tables[10] = $dbprefix . "m_news_cat"; $sas_mod_tables[11] = $dbprefix . "m_calendars"; $sas_mod_tables[12] = $dbprefix . "m_calendar_events"; $sas_mod_tables[13] = $dbprefix . "m_newsletters"; $sas_mod_tables[14] = $dbprefix . "m_newsletter_cat"; $sas_mod_tables[15] = $dbprefix . "m_newsletter_emails"; $sas_mod_tables[16] = $dbprefix . "m_forumcat"; $sas_mod_tables[17] = $dbprefix . "m_forumuser"; $sas_mod_tables[18] = $dbprefix . "m_forumreplies"; $sas_mod_tables[19] = $dbprefix . "m_forumtopics"; $sas_mod_tables[20] = $dbprefix . "m_chat"; $sas_mod_tables[21] = $dbprefix . "m_chat_log"; $sas_mod_tables[22] = $dbprefix . "m_chat_users"; $sas_mod_tables[23] = $dbprefix . "m_scripts"; $sas_mod_tables[24] = $dbprefix . "m_template"; $sas_mod_tables[25] = $dbprefix . "m_message"; $sas_mod_tables_name[0] = "sn_gbook"; $sas_mod_tables_name[1] = "sn_ads"; $sas_mod_tables_name[2] = "sn_mailpage"; $sas_mod_tables_name[3] = "sn_agenda"; $sas_mod_tables_name[4] = "sn_agenda"; $sas_mod_tables_name[5] = "sn_allbum"; $sas_mod_tables_name[6] = "sn_template"; $sas_mod_tables_name[7] = "sn_downloads"; $sas_mod_tables_name[8] = "sn_downloads"; $sas_mod_tables_name[9] = "sn_news"; $sas_mod_tables_name[10] = "sn_news"; $sas_mod_tables_name[11] = "sn_calendar"; $sas_mod_tables_name[12] = "sn_calendar"; $sas_mod_tables_name[13] = "sn_newsletter"; $sas_mod_tables_name[14] = "sn_newsletter"; $sas_mod_tables_name[15] = "sn_newsletter"; $sas_mod_tables_name[16] = "sn_forum"; $sas_mod_tables_name[17] = "sn_forum"; $sas_mod_tables_name[18] = "sn_forum"; $sas_mod_tables_name[19] = "sn_forum"; $sas_mod_tables_name[20] = "sn_chat"; $sas_mod_tables_name[21] = "sn_chat"; $sas_mod_tables_name[22] = "sn_chat"; $sas_mod_tables_name[23] = "sn_tvmodule"; $sas_mod_tables_name[24] = "sn_template"; $sas_mod_tables_name[25] = "sn_message"; $error = 0; $count = count($sas_tables); for ($k = 0; $k < $count; $k++) { $check = mysql_query("SELECT * FROM $sas_tables[$k] LIMIT 0,1"); if (!$check) { $error++; $check_result[$error] = "Table NOT installed! " . $sas_tables[$k] . ""; } } $count = count($sas_mod_tables); for ($j = 0; $j < $count; $j++) { $check = mysql_query("SELECT * FROM $sas_mod_tables[$j] LIMIT 0,1"); if (!$check) { $error++; $check_result[$error] = str_replace("%tablename%", $sas_mod_tables[$j], $sas_lang['lang_install_312']); $check_result[$error] = $check_result[$error] . $sas_mod_tables_name[$j]; } } if ($error == 0) //do we have errors? { $msg = $sas_lang['lang_install_311']; } else { $msg = ""; for ($j = 0; $j <= $error; $j++) { $msg .= $check_result[$j] . "
"; } $msg .= "
"; } ?>
 
">

        


 

 

 

 




 
">
here"; ?>
$username
".$sas_lang['lang_install_43']." ".$_POST['password'].""; ?>