Last update before closing project. Thank you!

git-svn-id: https://svn.pioder.pl/uf-svn/uF@38 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
pioder
2010-03-27 17:41:57 +00:00
parent 43657534ab
commit 01741920b0
46 changed files with 652 additions and 661 deletions

View File

@@ -8,12 +8,12 @@
* @license see LICENSE.txt
**/
define('IN_uF',true);
include('./../config.php');
include('./../includes/constants.php');
include('./../includes/errors.php');
include('./../includes/db.php');
include('./functions_add.php');
include('./../admin/check_script_data.php');
require('./../config.php');
require('./../includes/constants.php');
require('./../includes/errors.php');
require('./../includes/db.php');
require('./functions_add.php');
require('./../admin/check_script_data.php');
if (ini_get('short_open_tag')==0)
{
@@ -53,7 +53,7 @@ if(!isset($_COOKIE['lang']))
}
if (@is_file('./../lngs/'.$_COOKIE['lang'].'/install.php'))
{
include('./../lngs/'.$_COOKIE['lang'].'/install.php');
require('./../lngs/'.$_COOKIE['lang'].'/install.php');
}
$header = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
@@ -79,7 +79,7 @@ switch($_GET['page'])
{
if (isset($_POST['lang']))
{
setcookie('lang',$_POST['lang'], time()+360000000);
setcookie('lang',$_POST['lang'], $_SERVER['REQUEST_TIME']+360000000);
header('Location: index.php?page=step2');
}
else
@@ -149,7 +149,7 @@ switch($_GET['page'])
'cat3.value'=> (@is_writable($folders[2])) ? '<font color="green">'.$lng['is_writable'].' - OK</font>' : '<font color="red">'.$lng['not_writable'].' Error - No OK</font>',
'successfully' => ($count <1) ? '<font color="green">'.$lng['files_is_good'].' ('.count($script_files).')</font>' : '<font color="red">'.$lng['files_not_good'].' ('.$count.')</font>'
);
include('./tpls/install_check_script.tpl');
require('./tpls/install_check_script.tpl');
for($i=0; $i<count($script_files);$i++)
{
$actual = check_size_md5($script_files[$i]);
@@ -161,7 +161,7 @@ switch($_GET['page'])
'sum_actual'=>$actual,
'L.invalid_md5sum'=>$lng['invalid_md5sum'].' ('.substr($script_files[$i], strrpos($script_files[$i], '/') + 1, strlen($script_files[$i])).')'
);
include('./tpls/invalidfile_body.tpl');
require('./tpls/invalidfile_body.tpl');
}
}
echo '<form action="index.php?page=step3" method="POST"><input type="hidden" name="next">';
@@ -194,7 +194,7 @@ switch($_GET['page'])
@fwrite(@fopen('../config.php','w'),$config_file) or message_die(GENERAL,'Could not write config file. Error with installation!','');
@mysql_query("SET NAMES 'utf8'",$connect);
@mysql_select_db($_POST['database'],$connect) or message_die(GENERAL,'Could not connect to database. Error with installation!',@mysql_error());
include('./../includes/sql_parse.php');
require('./../includes/sql_parse.php');
$sql = @fread(@fopen('uf_tables.sql','r'),@filesize('uf_tables.sql'));
$sql = preg_replace('/uf_/', $_POST['mysql_prefix'], $sql);
$sql = remove_remarks($sql);
@@ -203,7 +203,7 @@ switch($_GET['page'])
{
DataBase::sql_query($sql[$i],'ERROR','Error of SQL Query: '.$sql[$i].' Error with install script!');
}
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".time()."' WHERE `name`='date_install'",GENERAL,'Could not update date install information');
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$_SERVER['REQUEST_TIME']."' WHERE `name`='date_install'",GENERAL,'Could not update date install information');
$patch = substr('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],0 ,-strlen('install/index.php?page=step4'));
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$patch."' WHERE `name`='forumpatch'",GENERAL,'Could not update date install information');
header('Location: index.php?page=step5');
@@ -225,7 +225,7 @@ switch($_GET['page'])
'L.mysql_prefix'=>$lng['mysql_prefix'],
'L.submit'=>$lng['start_install'],
);
include('./tpls/install_step4.tpl');
require('./tpls/install_step4.tpl');
break;
}
case 'step5':
@@ -247,13 +247,13 @@ switch($_GET['page'])
`pass`='".md5(htmlspecialchars($_POST['password']))."',
`email`='".htmlspecialchars($_POST['email'])."',
`lang`= '".$_COOKIE['lang']."',
`regdate`='".time()."',
`lastvisit`='".time()."'
`regdate`='".$_SERVER['REQUEST_TIME']."',
`lastvisit`='".$_SERVER['REQUEST_TIME']."'
WHERE `u_id`='1';";
DataBase::sql_query($sql,CRITICAL,'Could not update user. Error with install script!');
$sql = "UPDATE `".POSTS_TABLE."` SET `ptime`='".time()."' WHERE `p_id`='1'";
$sql = "UPDATE `".POSTS_TABLE."` SET `ptime`='".$_SERVER['REQUEST_TIME']."' WHERE `p_id`='1'";
DataBase::sql_query($sql,CRITICAL,'Could not update post. Error with install script!');
$sql = "UPDATE `".TOPICS_TABLE."` SET `lastpost_time`='".time()."' WHERE `t_id`='1'";
$sql = "UPDATE `".TOPICS_TABLE."` SET `lastpost_time`='".$_SERVER['REQUEST_TIME']."' WHERE `t_id`='1'";
DataBase::sql_query($sql,CRITICAL,'Could not update topic. Error with install script!');
header('Location: index.php?page=step7');
}
@@ -282,7 +282,7 @@ switch($_GET['page'])
'L.email'=>$lng['email'],
'L.submit'=>$lng['save']
);
include('./tpls/install_step6.tpl');
require('./tpls/install_step6.tpl');
break;
}
case 'step7':