You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 510 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
PHP-Nuke upgrade scripts

4.3. PHP-Nuke upgrade scripts

What's in an upgrade script? Let's take a few representative examples of code and explain what they do, so that you get an idea of what is going on in such a script[1]:

UPDATE (Version number):

the PHP-Nuke version is updated in the nuke_config table through the UPDATE command:

// <application>PHP-Nuke</application> Version Number Update
$db->sql_query("UPDATE ".$prefix."_config SET Version_Num='6.7'");
UPDATE (Forums):

some forum parameters are modified through the UPDATE command.

// <application>PHP-Nuke</application> Forums Update
$db->sql_query("UPDATE ".$prefix."_bbconfig SET config_value='.0.4' where
config_name='version'");
$db->sql_query("UPDATE ".$prefix."_bbconfig SET config_value='3600' where
config_name='session_length'");
INSERT:

some values are inserted into the nuke_bbconfig table through the INSERT command:

$db->sql_query("INSERT INTO ".$prefix."_bbconfig VALUES ('config_id','1')");
DELETE:

a recorde is deleted from the nuke_headlines table through the DELETE command

$db->sql_query("DELETE FROM ".$prefix."_headlines WHERE
sitename='Linux.com'");
DROP TABLE:

the whole table nuke_priv_msgs is deleted from the database through the DROP TABLE command.

$db->sql_query("DROP TABLE ".$prefix."_priv_msgs");
ALTER TABLE:

the structure of the nuke_users table is modified through the ALTER TABLE command:

$db->sql_query("ALTER TABLE ".$user_prefix."_users CHANGE uname username
VARCHAR(25) NOT NULL");
CREATE TABLE:

a new table (nuke_bbforum_prune) is created through the CREATE TABLE command:

$db->sql_query("CREATE TABLE ".$prefix."_bbforum_prune (prune_id mediumint
(8) unsigned NOT NULL auto_increment, forum_id smallint(5) unsigned NOT NULL
default '0', prune_days tinyint(4) unsigned NOT NULL default '0', prune_freq tinyint
(4) unsigned NOT NULL default '0', PRIMARY KEY (prune_id), KEY forum_id
(forum_id))");

See Section 28.5 for the syntax of SQL code.

Notes

[1]

We will assume all prefixes, like $prefix and $user_prefix to be "nuke".

Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.117 Seconds - 186 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::