/[nuke]/html/upgrades/upgrade1-25.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /html/upgrades/upgrade1-25.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Wed Sep 20 16:40:49 2000 UTC (23 years, 8 months ago) by dpavlin
Branch: dbp, MAIN
CVS Tags: r3_6, HEAD
Changes since 1.1: +0 -0 lines
import of version 3.6

1 <?php
2
3 # File to upgrade PHP-Nuke from 1.0 to 2.5
4 # After use this, you can delete it
5
6 include("config.php");
7 include("mainfile.php");
8 dbconnect();
9
10
11 $result = mysql_query("CREATE TABLE pollcomments (tid int(11) DEFAULT '0' NOT NULL auto_increment, pid int(11) DEFAULT '0', pollID int(11) DEFAULT '0', date datetime, name varchar(60) DEFAULT '' NOT NULL, email varchar(60), url varchar(60), host_name varchar(60), subject varchar(60) DEFAULT '' NOT NULL, comment text NOT NULL, score tinyint(4) DEFAULT '0' NOT NULL, reason tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (tid))");
12 if (!$result) {
13 echo "Creation of pollcomments table failed!<br>" .mysql_errno(). ": ".mysql_error(). "<br>";
14 return;
15 }
16 $result = mysql_query("CREATE TABLE links_categories (cid int(11) DEFAULT '0' NOT NULL auto_increment, title varchar(50) DEFAULT '' NOT NULL, PRIMARY KEY (cid))");
17 if (!$result) {
18 echo "Creation of links_categories table failed!<br>" .mysql_errno(). ": ".mysql_error(). "<br>";
19 return;
20 }
21 $result = mysql_query("CREATE TABLE links_links (lid int(11) DEFAULT '0' NOT NULL auto_increment, cid int(11) DEFAULT '0' NOT NULL, sid int(11) DEFAULT '0' NOT NULL, title varchar(100) DEFAULT '' NOT NULL, url varchar(100) DEFAULT '' NOT NULL, description text NOT NULL, date datetime, name varchar(60) DEFAULT '' NOT NULL, email varchar(60) DEFAULT '' NOT NULL, hits int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (lid))");
22 if (!$result) {
23 echo "Creation of links_links table failed!<br>" .mysql_errno(). ": ".mysql_error(). "<br>";
24 return;
25 }
26 $result = mysql_query("CREATE TABLE links_newlink (lid int(11) DEFAULT '0' NOT NULL auto_increment, cid int(11) DEFAULT '0' NOT NULL, sid int(11) DEFAULT '0' NOT NULL, title varchar(100) DEFAULT '' NOT NULL, url varchar(100) DEFAULT '' NOT NULL, description text NOT NULL, name varchar(60) DEFAULT '' NOT NULL, email varchar(60) DEFAULT '' NOT NULL, PRIMARY KEY (lid))");
27 if (!$result) {
28 echo "Creation of links_newlink table failed!<br>" .mysql_errno(). ": ".mysql_error(). "<br>";
29 return;
30 }
31 $result = mysql_query("CREATE TABLE links_subcategories (sid int(11) DEFAULT '0' NOT NULL auto_increment, cid int(11) DEFAULT '0' NOT NULL, title varchar(50) DEFAULT '' NOT NULL, PRIMARY KEY (sid))");
32 if (!$result) {
33 echo "Creation of links_subcategories table failed!<br>" .mysql_errno(). ": ".mysql_error(). "<br>";
34 return;
35 }
36 $result = mysql_query("ALTER TABLE sections ADD image varchar(50) DEFAULT '' NOT NULL");
37 if (!$result) {
38 echo "Alteration of sections table failed!<br>" .mysql_errno(). ": ".mysql_error(). "<br>";
39 return;
40 } else {
41 $result = mysql_query("select image from sections");
42 while(list($image) = mysql_fetch_row($result)) {
43 mysql_query("update sections set image='template.gif'");
44 }
45 }
46 echo "PHP-Nuke Tables Updated, Ok...";
47 ?>

  ViewVC Help
Powered by ViewVC 1.1.26