Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Sep 06, 2004 8:58 am Reply with quote

Chatserv has provided a fix for a buggy 7.3 to 7.4 upgrade file (upgrade is missing section articles - reported by canadaka) that ships with virgin nuke7.5. See the FULL thread here, as there is more discussion, but here is the code that fixes it.
Code:
<?php 


######################################################
# File to upgrade from PHP-Nuke 7.3 to PHP-Nuke 7.4
# After you used this file, you can safely delete it.
######################################################
#            -= WARNING: PLEASE READ =-
#
# NOTE: This file uses config.php to retrieve needed
# variables values. So, to do the upgrade PLEASE copy
# this file in your server root directory and execute
# it from your browser.
######################################################

include("mainfile.php");

// Forums Table Update
$db->sql_query("UPDATE ".$prefix."_bbconfig SET config_value='.0.10' WHERE config_name='version'");

// IP Ban System Table Creation
$db->sql_query("CREATE TABLE ".$prefix."_banned_ip (id int(11) NOT NULL auto_increment, ip_address varchar(15) NOT NULL default '',  reason varchar(255) NOT NULL default '', date date NOT NULL default '0000-00-00', PRIMARY KEY id (id))");

// Users Table Modification
$db->sql_query("ALTER TABLE ".$user_prefix."_users ADD last_ip VARCHAR(15) DEFAULT '0' NOT NULL");

// PHP-Nuke Version Number Update
$db->sql_query("UPDATE ".$prefix."_config SET Version_Num='7.4'");

// Section to Content conversion
$result = $db->sql_query("SELECT secid, secname FROM ".$prefix."_sections");
while ($row = $db->sql_fetchrow($result)) {
   $db->sql_query("INSERT INTO ".$prefix."_pages_categories VALUES (NULL, '$row[secname]', '')");
}
$result = $db->sql_query("SELECT * FROM ".$prefix."_seccont");
while ($row = $db->sql_fetchrow($result)) {
$sec_cont = addslashes(FixQuotes($row[content]));
   $row2 = $db->sql_fetchrow($db->sql_query("SELECT secname FROM ".$prefix."_sections WHERE secid='$row[secid]'"));
   $row3 = $db->sql_fetchrow($db->sql_query("SELECT cid FROM ".$prefix."_pages_categories WHERE title='$row2[secname]'"));
   $db->sql_query("INSERT INTO ".$prefix."_pages VALUES (NULL, '$row3[cid]', '$row[title]', '', '1', '', '$sec_cont', '', '', now(), '$row[counter]', '$row[slanguage]')");
}
$db->sql_query("DROP TABLE ".$prefix."_sections");
$db->sql_query("DROP TABLE ".$prefix."_seccont");
$db->sql_query("UPDATE ".$prefix."_modules SET active='0' WHERE title='Sections'");

// Ephemerids and Sections field removal from authors table
$db->sql_query("ALTER TABLE ".$prefix."_authors DROP radminsection, DROP radminephem");

echo "PHP-Nuke Update finished!<br><br>"
    ."Please note that SECTIONS modules has been removed on this version. All your data from Sections module has been moved to CONTENT Module.<br><br>"
    ."You should now delete this upgrade file from your server.<br><br>";
?>
 
View user's profile Send private message
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.5

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©