From 1b636f0e80c913be17054071596aca8614582750 Mon Sep 17 00:00:00 2001 From: Alec Henriksen Date: Mon, 14 Apr 2008 20:15:02 -0600 Subject: [PATCH] last minute modifications (2.2.0 release) --- install/index.php | 1 - install/upgrade.php | 153 ---------------------------------------------------- 2 files changed, 154 deletions(-) delete mode 100644 install/upgrade.php diff --git a/install/index.php b/install/index.php index c57ba30..ebfc147 100644 --- a/install/index.php +++ b/install/index.php @@ -114,7 +114,6 @@ define("INSTALLING",1);
-
diff --git a/install/upgrade.php b/install/upgrade.php deleted file mode 100644 index 6ade3f7..0000000 --- a/install/upgrade.php +++ /dev/null @@ -1,153 +0,0 @@ - version 2 upgrade script, courtasy of our good friend "Kyle Osborn", a - //contributing developer of phpns. Thanks a lot! :D - - - if(!$_GET[step]){ header("location: ?step=1");} - - define("DEBUG",$_GET[debug]); - - $step = $_GET['step']; - - - // V1 CONNECTION - if(DEBUG){ echo $host ."
\n". $user ."
\n". $password ."
\n". $database ."

";} - - function v1connect() - { - $user = $_POST['db_user']; - $password = $_POST['db_password']; - $host = $_POST['db_host']; - $database = $_POST['db_name']; - $connection = mysql_connect($host, $user, $password) or die ("Connection to the phpns version 1 mysql server failed."); - $db = mysql_select_db($database,$connection) or die (mysql_error()); - } - - - - - - - // V2 CONNECTION - if(DEBUG){ echo $databaseinfo['host'] ."
\n". $databaseinfo['user'] ."
\n". $databaseinfo['password'] ."
\n". $databaseinfo['dbname'] ."

";} - - function v2connect() - { - include("../inc/config.php"); - $mysql['connection'] = mysql_connect($databaseinfo['host'], $databaseinfo['user'], $databaseinfo['password']) or die ($error['connection']); - $mysql['db'] = mysql_select_db($databaseinfo['dbname'],$mysql['connection']) or die ($error['database']); - } - - - - - - if($_POST){ - - - //From v1 userinfo - v1connect(); - $user = "SELECT * FROM userinfo"; - $userresult = mysql_query($user); - $num = mysql_numrows($userresult); - $i = 0; - while ($i < $num) { - - $id = mysql_result($userresult,$i,"id"); - $username = mysql_result($userresult,$i,"username"); - $email = mysql_result($userresult,$i,"email"); - $timestamp = mysql_result($userresult,$i,"date"); - $rank = mysql_result($userresult,$i,"rank"); - if(DEBUG) echo $id ."
\n". $username ."
\n". $email ."
\n". $timestamp ."
\n". $rank; - - //to v2 users - v2connect(); - $insert = "INSERT INTO `users` (`user_name`, `email`, `password`, `timestamp`, `rank_id`) VALUES ('$username', 'CHANGEME', '$email', '$timestamp', '$rank');"; - @mysql_query($insert) or die (mysql_error()); - - $i++; - } - - - //From v1 news - v1connect(); - $news = "SELECT * FROM news"; - $newsresult = mysql_query($news); - $num = mysql_numrows($newsresult); - $i = 0; - while ($i < $num) { - - $title = mysql_result($newsresult,$i,"title"); - $subtitle = mysql_result($newsresult,$i,"subtitle"); - $content = mysql_result($newsresult,$i,"content"); - $extcontent = mysql_result($newsresult,$i,"extcontent"); - $author = mysql_result($newsresult,$i,"author"); - $date = mysql_result($newsresult,$i,"date"); - $cat = mysql_result($newsresult,$i,"cat"); - if(DEBUG) echo $id ."
\n". $title ."
\n". $subtitle ."
\n". $content ."
\n". $extcontent ."
\n". $author ."
\n". $date ."
\n". $cat; - - //to v2 articles - v2connect(); - $insert = "INSERT INTO `articles` (`article_title`, `article_subtitle`, `article_author`, `article_cat`, `article_text`, `article_exptext`, `article_imgid`, `allow_comments`, `start_date`, `end_date`, `active`, `approved`, `timestamp`, `ip`) VALUES ('$title', '$subtitle', '$author', '$cat', '$content', '$extcontent', '', '0', '', '', '0', '0', '$date', '127.0.0.1');"; - @mysql_query($insert) or die (mysql_error()); - - $i++; - } - } - - - - if($step == 1){ - $content = ' -
You need to have phpns 2 already installed for this to work.
-

1.x database information

- '.$error_message.' -

Phpns can upgrade from the version 1.x series, provided the database information from the 1.x version. You can find the database information in "/panel/inc/mysql.php" of the installation.

-
- - (Usually "localhost") - -
- - - - - -
- - - - -
- - - - -
- -
- -
-
- '; - } else if($step == 2){ - $content = ' - -

Upgrade has been completed!

-
-

It is now STRONGLY suggest you remove the /install directory!

'; - } - - -include("install.tmp.php"); -?> -- 2.11.4.GIT