From eeea7711a3ba61c72df6bbed36297863e17ad22c Mon Sep 17 00:00:00 2001 From: vbracco Date: Fri, 20 Jul 2007 14:46:10 +0000 Subject: [PATCH] Implementing time offset in install.php and update.php. --- install.php | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++--- update.php | 7 +++++ 2 files changed, 86 insertions(+), 4 deletions(-) diff --git a/install.php b/install.php index 9cbb38e..ca87a3f 100644 --- a/install.php +++ b/install.php @@ -66,10 +66,13 @@ if ($action=="config") { $errors=$errors.$sep_err."3"; $sep_err="|"; } - + $off_r= split("," , $_POST['time_offsets']); + $_POST['offset_time'] = $off_r[0]; + $_POST['offset_city'] = $off_r[1]; + unset($_POST['time_offsets']); if (!$errors) { - if (install_db($_POST['login'], $_POST['password'], $_POST['email'], $_POST['title'], $_POST['description'], $_POST['url_installation'], $_POST['posts_limit'], $_POST['lang'], $_POST['template'], $_POST['website'], $_POST['about'])) { + if (install_db($_POST['login'], $_POST['password'], $_POST['email'], $_POST['title'], $_POST['description'], $_POST['url_installation'], $_POST['posts_limit'], $_POST['lang'], $_POST['template'], $_POST['website'], $_POST['about'], $_POST['offset_city'], $_POST['offset_time'])) { $showForm=false; } else { $errors=$errors.$sep_err."6"; @@ -152,7 +155,71 @@ if ($action=="config") { echo "\n"; } -?> +?> +
  • +
  • +
  • @@ -185,7 +252,7 @@ if ($action=="config") { ejecutarConsulta($sqlStr); + + $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('offset_city', '".$offset_city."');"; + + $db->ejecutarConsulta($sqlStr); + + $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('offset_time', '".$offset_time."');"; + $db->ejecutarConsulta($sqlStr); return true; diff --git a/update.php b/update.php index 91526e3..130f574 100644 --- a/update.php +++ b/update.php @@ -65,6 +65,13 @@ $sqlStr = "ALTER TABLE ".Table_prefix."config DROP rich_text"; $db->ejecutarConsulta($sqlStr); +$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('offset_city', 'Mexico/General');"; + +$db->ejecutarConsulta($sqlStr); + +$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('offset_time', '-6');"; + +$db->ejecutarConsulta($sqlStr); echo "

    Finished!

    "; echo "

    Now you are running on the new version!!!

    ";