From: <bli...@us...> - 2003-12-06 05:11:53
|
Update of /cvsroot/phpwsscoreboard/scoreboard/boost In directory sc8-pr-cvs1:/tmp/cvs-serv9240/boost Modified Files: install.php uninstall.php update.php Log Message: Changes for phpWebSite 0.9.3-2 Index: install.php =================================================================== RCS file: /cvsroot/phpwsscoreboard/scoreboard/boost/install.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** install.php 30 Jul 2003 14:39:16 -0000 1.1.1.1 --- install.php 6 Dec 2003 05:11:50 -0000 1.2 *************** *** 9,13 **** } ! if($GLOBALS["core"]->sqlImport($GLOBALS["core"]->source_dir . "mod/scoreboard/boost/install.sql", TRUE)) { $content .= "All Scoreboard tables successfully written.<br />"; --- 9,20 ---- } ! // Need to do core version check ! if($GLOBALS["core"]->version < "0.9.3-1") { ! $content .= "This module requires a phpWebSite core version of 0.9.3-1 or greater to install.<br />"; ! $content .= "<br />You are currently using phpWebSite core version " . $GLOBALS["core"]->version . ".<br />"; ! return; ! } ! ! if($GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/scoreboard/boost/install.sql", TRUE)) { $content .= "All Scoreboard tables successfully written.<br />"; Index: uninstall.php =================================================================== RCS file: /cvsroot/phpwsscoreboard/scoreboard/boost/uninstall.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** uninstall.php 30 Jul 2003 14:39:16 -0000 1.1.1.1 --- uninstall.php 6 Dec 2003 05:11:50 -0000 1.2 *************** *** 11,15 **** } ! if ($GLOBALS['core']->sqlImport($GLOBALS['core']->source_dir . "mod/scoreboard/boost/uninstall.sql", 1, 1)) { $content .= "All Scoreboard tables successfully removed.<br />"; --- 11,15 ---- } ! if ($GLOBALS['core']->sqlImport(PHPWS_SOURCE_DIR . "mod/scoreboard/boost/uninstall.sql", 1, 1)) { $content .= "All Scoreboard tables successfully removed.<br />"; Index: update.php =================================================================== RCS file: /cvsroot/phpwsscoreboard/scoreboard/boost/update.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** update.php 30 Jul 2003 14:39:16 -0000 1.1.1.1 --- update.php 6 Dec 2003 05:11:50 -0000 1.2 *************** *** 6,9 **** --- 6,16 ---- } + // Need to do core version check + if($GLOBALS["core"]->version < "0.9.3-1") { + $content .= "This module requires a phpWebSite core version of 0.9.3-1 or greater to install.<br />"; + $content .= "<br />You are currently using phpWebSite core version " . $GLOBALS["core"]->version . ".<br />"; + return; + } + $status = 1; *************** *** 11,15 **** $content .= "Updating Scoreboard to version 0.91<br />"; $content .= "Adding columns \"status\" and \"numCol\" to \"mod_scoreboard_conf\"."; ! $sql = "ALTER TABLE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_conf ADD (status varchar(4) NOT NULL, numCol int NOT NULL)"; --- 18,22 ---- $content .= "Updating Scoreboard to version 0.91<br />"; $content .= "Adding columns \"status\" and \"numCol\" to \"mod_scoreboard_conf\"."; ! $sql = "ALTER TABLE " . PHPWS_TBL_PREFIX . "mod_scoreboard_conf ADD (status varchar(4) NOT NULL, numCol int NOT NULL)"; *************** *** 17,26 **** $content .= "<br />Columns added successfully!<br />"; ! $sql = "UPDATE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_conf SET status=\"on\", numCol=2"; $GLOBALS["core"]->query($sql); $content .= "Configuration settings updated!<br />"; ! $sql = "CREATE TABLE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_links ( scoreID int NOT NULL, announceID int NOT NULL, --- 24,33 ---- $content .= "<br />Columns added successfully!<br />"; ! $sql = "UPDATE " . PHPWS_TBL_PREFIX . "mod_scoreboard_conf SET status=\"on\", numCol=2"; $GLOBALS["core"]->query($sql); $content .= "Configuration settings updated!<br />"; ! $sql = "CREATE TABLE " . PHPWS_TBL_PREFIX . "mod_scoreboard_links ( scoreID int NOT NULL, announceID int NOT NULL, *************** *** 42,56 **** $content .= "Updating Scoreboard to version 0.92<br />"; $content .= "Adding \"ordinal\" column to the \"mod_scoreboard_sports\" table.<br />"; ! $sql = "ALTER TABLE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_sports ADD ordinal int NOT NULL"; $GLOBALS["core"]->query($sql); $content .= "Column added successfully.<br />"; $content .= "Setting ordinals for all sports to their sport ID.<br />"; ! $sql = "SELECT id FROM " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_sports"; $result = $GLOBALS["core"]->getAll($sql); if(sizeof($result) > 0) { $i = 0; foreach($result as $row) { ! $sql = "UPDATE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_sports SET ordinal=id WHERE id=" . $row["id"]; $GLOBALS["core"]->query($sql); $i++; --- 49,63 ---- $content .= "Updating Scoreboard to version 0.92<br />"; $content .= "Adding \"ordinal\" column to the \"mod_scoreboard_sports\" table.<br />"; ! $sql = "ALTER TABLE " . PHPWS_TBL_PREFIX . "mod_scoreboard_sports ADD ordinal int NOT NULL"; $GLOBALS["core"]->query($sql); $content .= "Column added successfully.<br />"; $content .= "Setting ordinals for all sports to their sport ID.<br />"; ! $sql = "SELECT id FROM " . PHPWS_TBL_PREFIX . "mod_scoreboard_sports"; $result = $GLOBALS["core"]->getAll($sql); if(sizeof($result) > 0) { $i = 0; foreach($result as $row) { ! $sql = "UPDATE " . PHPWS_TBL_PREFIX . "mod_scoreboard_sports SET ordinal=id WHERE id=" . $row["id"]; $GLOBALS["core"]->query($sql); $i++; *************** *** 63,71 **** $content .= "Adding \"ordinal\" column to the \"mod_scoreboard_conf\" table.<br />"; ! $sql = "ALTER TABLE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_conf ADD (ordinal varchar(5) NOT NULL)"; $GLOBALS["core"]->query($sql); $content .= "Column added successfully.<br />"; ! $sql = "UPDATE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_conf SET ordinal=\"asc\""; $GLOBALS["core"]->query($sql); --- 70,78 ---- $content .= "Adding \"ordinal\" column to the \"mod_scoreboard_conf\" table.<br />"; ! $sql = "ALTER TABLE " . PHPWS_TBL_PREFIX . "mod_scoreboard_conf ADD (ordinal varchar(5) NOT NULL)"; $GLOBALS["core"]->query($sql); $content .= "Column added successfully.<br />"; ! $sql = "UPDATE " . PHPWS_TBL_PREFIX . "mod_scoreboard_conf SET ordinal=\"asc\""; $GLOBALS["core"]->query($sql); *************** *** 84,92 **** $content .= "Adding \"nextgame\" column to the \"mod_scoreboard_sports\" table.<br />"; ! $sql = "ALTER TABLE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_sports ADD nextgame int"; $GLOBALS["core"]->query($sql); $content .= "Column added successfully.<br />"; ! $sql = "CREATE TABLE " . $GLOBALS["core"]->tbl_prefix . "mod_scoreboard_boxscores ( id int PRIMARY KEY, scoreID int NOT NULL, --- 91,99 ---- $content .= "Adding \"nextgame\" column to the \"mod_scoreboard_sports\" table.<br />"; ! $sql = "ALTER TABLE " . PHPWS_TBL_PREFIX . "mod_scoreboard_sports ADD nextgame int"; $GLOBALS["core"]->query($sql); $content .= "Column added successfully.<br />"; ! $sql = "CREATE TABLE " . PHPWS_TBL_PREFIX . "mod_scoreboard_boxscores ( id int PRIMARY KEY, scoreID int NOT NULL, *************** *** 100,105 **** $GLOBALS["core"]->query($sql); $content .= "Boxscores table created!<br />"; ! $content .= "Update successful!<br />"; } ?> --- 107,116 ---- $GLOBALS["core"]->query($sql); $content .= "Boxscores table created!<br />"; + } ! if($currentVersion < 0.94) { ! $content .= "Scoreboard Updates for Version 0.9.4<br />"; ! $content .= "------------------------------------------<br />"; ! $content .= "- Now compatible with phpWebSite 0.9.3-2<br />"; } ?> |