From: Don S. <ri...@us...> - 2004-09-13 21:42:06
|
Update of /cvsroot/phpwsbb/phpwsbb/boost In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29269/boost Modified Files: install.php uninstall.php update.php Log Message: Switching to use single-quotes when possible for faster parsing and PEAR followingness Index: uninstall.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/boost/uninstall.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** uninstall.php 13 Sep 2004 16:31:16 -0000 1.11 --- uninstall.php 13 Sep 2004 21:41:54 -0000 1.12 *************** *** 24,33 **** */ ! require_once(PHPWS_SOURCE_DIR . "core/File.php"); ! require_once(PHPWS_SOURCE_DIR . "mod/language/class/Language.php"); ! require_once(PHPWS_SOURCE_DIR . "mod/help/class/CLS_help.php"); ! if(!$_SESSION["OBJ_user"]->isDeity()) { ! header("location:index.php"); exit(); } --- 24,33 ---- */ ! require_once(PHPWS_SOURCE_DIR . 'core/File.php'); ! require_once(PHPWS_SOURCE_DIR . 'mod/language/class/Language.php'); ! require_once(PHPWS_SOURCE_DIR . 'mod/help/class/CLS_help.php'); ! if(!$_SESSION['OBJ_user']->isDeity()) { ! header('location:index.php'); exit(); } *************** *** 35,60 **** $status = 1; ! if($status = $GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/phpwsbb/boost/uninstall.sql", 1, 1)) { ! $content .= "All Bulletin Board tables successfully removed!<br />"; // Remove search registry for old core ! if($GLOBALS["core"]->version < "0.9.3-2") ! if(isset($_SESSION["OBJ_search"])) ! $status = $GLOBALS["core"]->sqlDelete("mod_search_register", "module", "phpwsbb"); // Remove help information ! CLS_help::uninstall_help("phpwsbb"); // Remove Language ! PHPWS_Language::uninstallLanguages("phpwsbb"); // Remove uservar entries ! $_SESSION["OBJ_user"]->dropUserModule("phpwsbb"); // Remove image dir ! PHPWS_File::rmdir(PHPWS_HOME_DIR . "images/phpwsbb/"); } else { ! $content .= "There was a problem writing to the database.<br />"; $status = 0; } --- 35,60 ---- $status = 1; ! if($status = $GLOBALS['core']->sqlImport(PHPWS_SOURCE_DIR . 'mod/phpwsbb/boost/uninstall.sql', 1, 1)) { ! $content .= 'All Bulletin Board tables successfully removed!<br />'; // Remove search registry for old core ! if($GLOBALS['core']->version < '0.9.3-2') ! if(isset($_SESSION['OBJ_search'])) ! $status = $GLOBALS['core']->sqlDelete('mod_search_register', 'module', 'phpwsbb'); // Remove help information ! CLS_help::uninstall_help('phpwsbb'); // Remove Language ! PHPWS_Language::uninstallLanguages('phpwsbb'); // Remove uservar entries ! $_SESSION['OBJ_user']->dropUserModule('phpwsbb'); // Remove image dir ! PHPWS_File::rmdir(PHPWS_HOME_DIR . 'images/phpwsbb/'); } else { ! $content .= 'There was a problem writing to the database.<br />'; $status = 0; } Index: install.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/boost/install.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** install.php 10 Sep 2004 02:01:33 -0000 1.21 --- install.php 13 Sep 2004 21:41:54 -0000 1.22 *************** *** 24,67 **** */ ! require_once(PHPWS_SOURCE_DIR . "core/File.php"); ! if(!$_SESSION["OBJ_user"]->isDeity()) { ! header("location:index.php"); exit(); } // Need to do core version check ! if(version_compare($GLOBALS["core"]->version, "0.9.3-4") < 0) { ! $content .= "This module requires a phpWebSite core version of 0.9.3-4 or greater to install.<br />"; ! $content .= "<br />You are currently using phpWebSite core version " . $GLOBALS["core"]->version . ".<br />"; return; } ! if($status = $GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/phpwsbb/boost/install.sql", TRUE)) { ! require_once(PHPWS_SOURCE_DIR . "mod/help/class/CLS_help.php"); ! CLS_help::setup_help("phpwsbb"); ! $content .= "All Bulletin Board tables successfully written.<br />"; } else { ! $content .= "There was a problem writing to the database!<br />"; } /* Create image directory */ ! PHPWS_File::makeDir($GLOBALS["core"]->home_dir . "images/phpwsbb"); ! if (is_dir($GLOBALS["core"]->home_dir . "images/phpwsbb")) { ! $content .= "phpwsBB image directory " . $GLOBALS["core"]->home_dir . "images/phpwsbb/ successfully created!<br />"; /* Copy image files */ $images = array(); ! if($handle = opendir(PHPWS_SOURCE_DIR . "mod/phpwsbb/img/")) { while (false !== ($file = readdir($handle))) { ! //if ($file != "." && $file != "..") ! if (is_file(PHPWS_SOURCE_DIR . "mod/phpwsbb/img/$file")) ! if(!copy(PHPWS_SOURCE_DIR . "mod/phpwsbb/img/$file", $GLOBALS["core"]->home_dir . "images/phpwsbb/$file")) ! $content .= "Failed to copy $file<br />\n"; } } } else ! $content .= "phpwsBB could not create the image directory: " . $GLOBALS["core"]->home_dir . "images/phpwsbb/<br />You will have to do this manually!<br />"; --- 24,67 ---- */ ! require_once(PHPWS_SOURCE_DIR . 'core/File.php'); ! if(!$_SESSION['OBJ_user']->isDeity()) { ! header('location:index.php'); exit(); } // Need to do core version check ! if(version_compare($GLOBALS['core']->version, '0.9.3-4') < 0) { ! $content .= 'This module requires a phpWebSite core version of 0.9.3-4 or greater to install.<br />'; ! $content .= '<br />You are currently using phpWebSite core version ' . $GLOBALS['core']->version . '.<br />'; return; } ! if($status = $GLOBALS['core']->sqlImport(PHPWS_SOURCE_DIR . 'mod/phpwsbb/boost/install.sql', TRUE)) { ! require_once(PHPWS_SOURCE_DIR . 'mod/help/class/CLS_help.php'); ! CLS_help::setup_help('phpwsbb'); ! $content .= 'All Bulletin Board tables successfully written.<br />'; } else { ! $content .= 'There was a problem writing to the database!<br />'; } /* Create image directory */ ! PHPWS_File::makeDir($GLOBALS['core']->home_dir . 'images/phpwsbb'); ! if (is_dir($GLOBALS['core']->home_dir . 'images/phpwsbb')) { ! $content .= 'phpwsBB image directory ' . $GLOBALS['core']->home_dir . 'images/phpwsbb/ successfully created!<br />'; /* Copy image files */ $images = array(); ! if($handle = opendir(PHPWS_SOURCE_DIR . 'mod/phpwsbb/img/')) { while (false !== ($file = readdir($handle))) { ! //if ($file != '.' && $file != '..') ! if (is_file(PHPWS_SOURCE_DIR . 'mod/phpwsbb/img/${file}')) ! if(!copy(PHPWS_SOURCE_DIR . 'mod/phpwsbb/img/${file}', $GLOBALS['core']->home_dir . 'images/phpwsbb/${file}')) ! $content .= 'Failed to copy ${file}<br />\n'; } } } else ! $content .= 'phpwsBB could not create the image directory: ' . $GLOBALS['core']->home_dir . 'images/phpwsbb/<br />You will have to do this manually!<br />'; Index: update.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/boost/update.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** update.php 13 Sep 2004 18:23:09 -0000 1.38 --- update.php 13 Sep 2004 21:41:54 -0000 1.39 *************** *** 24,98 **** */ ! if(!$_SESSION["OBJ_user"]->isDeity()) { ! header("location:index.php"); exit(); } // Need to do core version check ! if(version_compare($GLOBALS["core"]->version, "0.9.3-4") < 0) { ! $content .= "This module requires a phpWebSite core version of 0.9.3-4 or greater to install.<br />"; ! $content .= "<br />You are currently using phpWebSite core version " . $GLOBALS["core"]->version . ".<br />"; return; } // Load needed classes ! require_once(PHPWS_SOURCE_DIR . "mod/phpwsbb/class/Manager.php"); // Load help information ! require_once(PHPWS_SOURCE_DIR . "mod/help/class/CLS_help.php"); ! CLS_help::uninstall_help("phpwsbb"); ! CLS_help::setup_help("phpwsbb"); // Update Language ! require_once(PHPWS_SOURCE_DIR . "mod/language/class/Language.php"); ! PHPWS_Language::uninstallLanguages("phpwsbb"); ! PHPWS_Language::installLanguages("phpwsbb"); $status = 1; // This might not exist during update ! if (!isset($_SESSION["PHPWSBB_Manager"])) ! $_SESSION["PHPWSBB_Manager"] = new PHPWSBB_Manager; ! if(version_compare($currentVersion, "0.4.0") < 0) { ! if ($status = $GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/phpwsbb/boost/update040.sql", TRUE)) { ! $content .= "All phpwsBB tables successfully updated.<br />"; } else { ! $content .= "There was a problem writing to the database.<br />"; } } ! if(version_compare($currentVersion, "0.5.0") < 0) { ! if($status = $GLOBALS["core"]->query("ALTER TABLE mod_phpwsbb_settings ADD admin_email varchar(80), ADD email_text text, ADD monitor_posts smallint", TRUE)) { ! $content .= "phpwsBB settings table successfully modified.<br />"; ! if($status = $GLOBALS["core"]->sqlUpdate(array("email_text"=>"The thread [name] has been updated. Go to [url] to view it.", "monitor_posts"=>0), "mod_phpwsbb_settings")) { ! $content .= "phpwsBB settings table successfully updated.<br />"; } else { ! $content .= "There was a problem updating the phpwsBB settings.<br />"; } } else { ! $content .= "There was a problem modifying the phpwsBB settings table.<br />"; } } ! if(version_compare($currentVersion, "0.5.2") < 0) { // Remove hard-coded labels in subjects ! $content .= "Updating labels in sticky and locked threads ...<br />"; ! $sql = "SELECT id FROM mod_phpwsbb_threads where label like '%" . $_SESSION["translate"]->it("STICKY") . "%' or label like '%" . $_SESSION["translate"]->it("LOCKED") . "%'"; ! $result = $GLOBALS["core"]->getCol($sql,TRUE); if($result) { foreach($result as $rowid) { $thread = new PHPWSBB_Thread($rowid); ! if(strpos($thread->_label, $_SESSION["translate"]->it("STICKY"))) { ! $thread->setLabel(str_replace("[" . $_SESSION["translate"]->it("STICKY") . "] ", "", $thread->_label)); $thread->commit(); ! $content .= "Updated sticky thread " . $thread->_label . ".<br />"; } ! if(strpos($thread->_label, $_SESSION["translate"]->it("LOCKED"))) { ! $thread->setLabel(str_replace("[" . $_SESSION["translate"]->it("LOCKED") . "] ", "", $thread->_label)); $thread->commit(); ! $content .= "Updated locked thread " . $thread->_label . ".<br />"; } --- 24,98 ---- */ ! if(!$_SESSION['OBJ_user']->isDeity()) { ! header('location:index.php'); exit(); } // Need to do core version check ! if(version_compare($GLOBALS['core']->version, '0.9.3-4') < 0) { ! $content .= 'This module requires a phpWebSite core version of 0.9.3-4 or greater to install.<br />'; ! $content .= '<br />You are currently using phpWebSite core version ' . $GLOBALS['core']->version . '.<br />'; return; } // Load needed classes ! require_once(PHPWS_SOURCE_DIR . 'mod/phpwsbb/class/Manager.php'); // Load help information ! require_once(PHPWS_SOURCE_DIR . 'mod/help/class/CLS_help.php'); ! CLS_help::uninstall_help('phpwsbb'); ! CLS_help::setup_help('phpwsbb'); // Update Language ! require_once(PHPWS_SOURCE_DIR . 'mod/language/class/Language.php'); ! PHPWS_Language::uninstallLanguages('phpwsbb'); ! PHPWS_Language::installLanguages('phpwsbb'); $status = 1; // This might not exist during update ! if (!isset($_SESSION['PHPWSBB_Manager'])) ! $_SESSION['PHPWSBB_Manager'] = new PHPWSBB_Manager; ! if(version_compare($currentVersion, '0.4.0') < 0) { ! if ($status = $GLOBALS['core']->sqlImport(PHPWS_SOURCE_DIR . 'mod/phpwsbb/boost/update040.sql', TRUE)) { ! $content .= 'All phpwsBB tables successfully updated.<br />'; } else { ! $content .= 'There was a problem writing to the database.<br />'; } } ! if(version_compare($currentVersion, '0.5.0') < 0) { ! if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_settings ADD admin_email varchar(80), ADD email_text text, ADD monitor_posts smallint', TRUE)) { ! $content .= 'phpwsBB settings table successfully modified.<br />'; ! if($status = $GLOBALS['core']->sqlUpdate(array('email_text'=>'The thread [name] has been updated. Go to [url] to view it.', 'monitor_posts'=>0), 'mod_phpwsbb_settings')) { ! $content .= 'phpwsBB settings table successfully updated.<br />'; } else { ! $content .= 'There was a problem updating the phpwsBB settings.<br />'; } } else { ! $content .= 'There was a problem modifying the phpwsBB settings table.<br />'; } } ! if(version_compare($currentVersion, '0.5.2') < 0) { // Remove hard-coded labels in subjects ! $content .= 'Updating labels in sticky and locked threads ...<br />'; ! $sql = "SELECT id FROM mod_phpwsbb_threads where label like '%" . $_SESSION['translate']->it('STICKY') . "%' or label like '%" . $_SESSION['translate']->it('LOCKED') . "%'"; ! $result = $GLOBALS['core']->getCol($sql,TRUE); if($result) { foreach($result as $rowid) { $thread = new PHPWSBB_Thread($rowid); ! if(strpos($thread->_label, $_SESSION['translate']->it('STICKY'))) { ! $thread->setLabel(str_replace('[' . $_SESSION['translate']->it('STICKY') . '] ', '', $thread->_label)); $thread->commit(); ! $content .= 'Updated sticky thread ' . $thread->_label . '.<br />'; } ! if(strpos($thread->_label, $_SESSION['translate']->it('LOCKED'))) { ! $thread->setLabel(str_replace('[' . $_SESSION['translate']->it('LOCKED') . '] ', '', $thread->_label)); $thread->commit(); ! $content .= 'Updated locked thread ' . $thread->_label . '.<br />'; } *************** *** 102,123 **** } ! if(version_compare($currentVersion, "0.5.3") < 0) { // Remove hard-coded labels in subjects ! $content .= "Updating labels in messages ...<br />"; ! $sql = "SELECT id FROM mod_phpwsbb_messages"; ! $result = $GLOBALS["core"]->getCol($sql,TRUE); if($result) { foreach($result as $rowid) { $message = new PHPWSBB_Message($rowid); ! if(strpos($message->_label, $_SESSION["translate"]->it("STICKY"))) { ! $message->setLabel(str_replace("[" . $_SESSION["translate"]->it("STICKY") . "] ", "", $message->_label)); $message->commit(); ! $content .= "Updated message " . $message->_label . ".<br />"; } ! if(strpos($message->_label, $_SESSION["translate"]->it("LOCKED"))) { ! $message->setLabel(str_replace("[" . $_SESSION["translate"]->it("LOCKED") . "] ", "", $message->_label)); $message->commit(); ! $content .= "Updated message " . $message->_label . ".<br />"; } --- 102,123 ---- } ! if(version_compare($currentVersion, '0.5.3') < 0) { // Remove hard-coded labels in subjects ! $content .= 'Updating labels in messages ...<br />'; ! $sql = 'SELECT id FROM mod_phpwsbb_messages'; ! $result = $GLOBALS['core']->getCol($sql,TRUE); if($result) { foreach($result as $rowid) { $message = new PHPWSBB_Message($rowid); ! if(strpos($message->_label, $_SESSION['translate']->it('STICKY'))) { ! $message->setLabel(str_replace('[' . $_SESSION['translate']->it('STICKY') . '] ', '', $message->_label)); $message->commit(); ! $content .= 'Updated message ' . $message->_label . '.<br />'; } ! if(strpos($message->_label, $_SESSION['translate']->it('LOCKED'))) { ! $message->setLabel(str_replace('[' . $_SESSION['translate']->it('LOCKED') . '] ', '', $message->_label)); $message->commit(); ! $content .= 'Updated message ' . $message->_label . '.<br />'; } *************** *** 127,182 **** } ! if(version_compare($currentVersion, "0.6.0") < 0) { ! if ($status = $GLOBALS["core"]->sqlImport(PHPWS_SOURCE_DIR . "mod/phpwsbb/boost/update060.sql", TRUE)) { ! $content .= "All phpwsBB tables successfully updated.<br />"; } else { ! $content .= "There was a problem writing to the database.<br />"; } ! if($status = $GLOBALS["core"]->query("ALTER TABLE mod_phpwsbb_threads ADD fid int NOT NULL default 0", TRUE)) { ! $content .= "Successfully modified the phpwsBB threads table.<br />"; // Add one forum and assign all threads to it. $forum = new PHPWSBB_Forum(); ! $forum->setLabel("General Discussion"); ! $forum->_description = "Topics on anything and everything."; $forum->commit(); ! if($status = $GLOBALS["core"]->sqlUpdate(array("fid"=>$forum->getId()),"mod_phpwsbb_threads")) { ! $content .= "Successfully added default forum and assigned all threads to it.<br />"; $forum->updateForum(); } } else { ! $content .= "There was a problem modifying the phpwsBB threads table.<br />"; } ! $content .= "Setting manager to NULL ... "; ! $_SESSION["PHPWSBB_Manager"] = NULL; ! if(is_null($_SESSION["PHPWSBB_Manager"])) ! $content .= "Done<br />"; else ! $content .= "NO<br />"; ! $content .= "Unsetting manager ... "; ! unset($_SESSION["PHPWSBB_Manager"]); ! if(!isset($_SESSION["PHPWSBB_Manager"])) ! $content .= "Done<br />"; else ! $content .= "NO<br />"; } ! if(version_compare($currentVersion, "0.7.0") < 0) { ! if($status = $GLOBALS["core"]->sqlCreateIndex("mod_phpwsbb_threads",array("fid"))) ! if($status = $GLOBALS["core"]->sqlCreateIndex("mod_phpwsbb_messages",array("tid"))) ! if($status = $GLOBALS["core"]->sqlCreateIndex("mod_phpwsbb_monitors",array("thread_id"))) ! $content .= "Successfully added foreign key indexes.<br />"; } ! if(version_compare($currentVersion, "0.8.0") < 0) { ! if($status = $GLOBALS["core"]->query("ALTER TABLE mod_phpwsbb_threads ADD lastpost int NOT NULL default 0", TRUE)) { ! if($status = $GLOBALS["core"]->query("ALTER TABLE mod_phpwsbb_forums ADD lastpost int NOT NULL default 0", TRUE)) { ! $sql = "SELECT id FROM mod_phpwsbb_threads"; ! $result = $GLOBALS["core"]->getCol($sql,TRUE); if($result) { foreach($result as $rowid) { --- 127,182 ---- } ! if(version_compare($currentVersion, '0.6.0') < 0) { ! if ($status = $GLOBALS['core']->sqlImport(PHPWS_SOURCE_DIR . 'mod/phpwsbb/boost/update060.sql', TRUE)) { ! $content .= 'All phpwsBB tables successfully updated.<br />'; } else { ! $content .= 'There was a problem writing to the database.<br />'; } ! if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_threads ADD fid int NOT NULL default 0', TRUE)) { ! $content .= 'Successfully modified the phpwsBB threads table.<br />'; // Add one forum and assign all threads to it. $forum = new PHPWSBB_Forum(); ! $forum->setLabel('General Discussion'); ! $forum->_description = 'Topics on anything and everything.'; $forum->commit(); ! if($status = $GLOBALS['core']->sqlUpdate(array('fid'=>$forum->getId()),'mod_phpwsbb_threads')) { ! $content .= 'Successfully added default forum and assigned all threads to it.<br />'; $forum->updateForum(); } } else { ! $content .= 'There was a problem modifying the phpwsBB threads table.<br />'; } ! $content .= 'Setting manager to NULL ... '; ! $_SESSION['PHPWSBB_Manager'] = NULL; ! if(is_null($_SESSION['PHPWSBB_Manager'])) ! $content .= 'Done<br />'; else ! $content .= 'NO<br />'; ! $content .= 'Unsetting manager ... '; ! unset($_SESSION['PHPWSBB_Manager']); ! if(!isset($_SESSION['PHPWSBB_Manager'])) ! $content .= 'Done<br />'; else ! $content .= 'NO<br />'; } ! if(version_compare($currentVersion, '0.7.0') < 0) { ! if($status = $GLOBALS['core']->sqlCreateIndex('mod_phpwsbb_threads',array('fid'))) ! if($status = $GLOBALS['core']->sqlCreateIndex('mod_phpwsbb_messages',array('tid'))) ! if($status = $GLOBALS['core']->sqlCreateIndex('mod_phpwsbb_monitors',array('thread_id'))) ! $content .= 'Successfully added foreign key indexes.<br />'; } ! if(version_compare($currentVersion, '0.8.0') < 0) { ! if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_threads ADD lastpost int NOT NULL default 0', TRUE)) { ! if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_forums ADD lastpost int NOT NULL default 0', TRUE)) { ! $sql = 'SELECT id FROM mod_phpwsbb_threads'; ! $result = $GLOBALS['core']->getCol($sql,TRUE); if($result) { foreach($result as $rowid) { *************** *** 186,251 **** } ! $content .= "Successfully modified the phpwsBB threads table.<br />"; } else { ! $content .= "There was a problem modifying the phpwsBB forums table.<br />"; } } else { ! $content .= "There was a problem modifying the phpwsBB threads table.<br />"; } ! if($status = $GLOBALS["core"]->query("ALTER TABLE mod_phpwsbb_settings ADD showforumsblock smallint NOT NULL default 1, ADD forumsblocktitle varchar(80) NULL, ADD showlatestthreadsblock smallint NOT NULL default 1, ADD latestthreadsblocktitle varchar(80) NULL, ADD maxlatestthreads int NOT NULL default 0", TRUE)) { ! $content .= "phpwsBB settings table successfully modified.<br />"; ! if($status = $GLOBALS["core"]->sqlUpdate( ! array( "showforumsblock"=>1, ! "forumsblocktitle"=>"Forums", ! "showlatestthreadsblock"=>1, ! "latestthreadsblocktitle"=>"Latest Forum Posts", ! "maxlatestthreads"=>5 ) ! , "mod_phpwsbb_settings")) { ! $content .= "phpwsBB settings table successfully updated.<br />"; } else { ! $content .= "There was a problem updating the phpwsBB settings.<br />"; } } else { ! $content .= "There was a problem modifying the phpwsBB settings table.<br />"; } } ! if(version_compare($currentVersion, "0.9.0") < 0) { ! if($status = $GLOBALS["core"]->query("ALTER TABLE mod_phpwsbb_settings ADD bboffline smallint NOT NULL default '0', ADD allow_user_monitors smallint NOT NULL default '1'", TRUE)) { ! $content .= "phpwsBB settings table successfully updated.<br />"; ! if($status = $GLOBALS["core"]->sqlUpdate( ! array( "allow_user_monitors"=>1, ! "bboffline"=>0 ) ! , "mod_phpwsbb_settings")) { ! $content .= "phpwsBB settings table successfully updated.<br />"; } else { ! $content .= "There was a problem updating the phpwsBB settings.<br />"; } } else { ! $content .= "There was a problem updating the phpwsBB settings.<br />"; } } ! if(version_compare($currentVersion, "0.9.1") < 0) { /* Create image directory */ ! PHPWS_File::makeDir($GLOBALS["core"]->home_dir . "images/phpwsbb"); ! if (is_dir($GLOBALS["core"]->home_dir . "images/phpwsbb")) { ! $content .= "phpwsBB image directory " . $GLOBALS["core"]->home_dir . "images/phpwsbb/ successfully created!<br />"; /* Copy image files */ $images = array(); ! if($handle = opendir(PHPWS_SOURCE_DIR . "mod/phpwsbb/img/")) { while (false !== ($file = readdir($handle))) { ! //if ($file != "." && $file != "..") ! if (is_file(PHPWS_SOURCE_DIR . "mod/phpwsbb/img/$file")) ! if(!copy(PHPWS_SOURCE_DIR . "mod/phpwsbb/img/$file", $GLOBALS["core"]->home_dir . "images/phpwsbb/$file")) ! $content .= "Failed to copy $file<br />\n"; } } } else ! $content .= "phpwsBB could not create the image directory: " . $GLOBALS["core"]->home_dir . "images/phpwsbb/<br />You will have to do this manually!<br />"; } ! if(version_compare($currentVersion, "1.0.0") < 0) { if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_messages ADD owner_id int NOT NULL default 0 AFTER owner', TRUE) && $status = $GLOBALS['core']->sqlCreateIndex('mod_phpwsbb_messages',array('owner_id'))) { --- 186,251 ---- } ! $content .= 'Successfully modified the phpwsBB threads table.<br />'; } else { ! $content .= 'There was a problem modifying the phpwsBB forums table.<br />'; } } else { ! $content .= 'There was a problem modifying the phpwsBB threads table.<br />'; } ! if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_settings ADD showforumsblock smallint NOT NULL default 1, ADD forumsblocktitle varchar(80) NULL, ADD showlatestthreadsblock smallint NOT NULL default 1, ADD latestthreadsblocktitle varchar(80) NULL, ADD maxlatestthreads int NOT NULL default 0', TRUE)) { ! $content .= 'phpwsBB settings table successfully modified.<br />'; ! if($status = $GLOBALS['core']->sqlUpdate( ! array( 'showforumsblock'=>1, ! 'forumsblocktitle'=>'Forums', ! 'showlatestthreadsblock'=>1, ! 'latestthreadsblocktitle'=>'Latest Forum Posts', ! 'maxlatestthreads'=>5 ) ! , 'mod_phpwsbb_settings')) { ! $content .= 'phpwsBB settings table successfully updated.<br />'; } else { ! $content .= 'There was a problem updating the phpwsBB settings.<br />'; } } else { ! $content .= 'There was a problem modifying the phpwsBB settings table.<br />'; } } ! if(version_compare($currentVersion, '0.9.0') < 0) { ! if($status = $GLOBALS['core']->query("ALTER TABLE mod_phpwsbb_settings ADD bboffline smallint NOT NULL default '0', ADD allow_user_monitors smallint NOT NULL default '1'", TRUE)) { ! $content .= 'phpwsBB settings table successfully updated.<br />'; ! if($status = $GLOBALS['core']->sqlUpdate( ! array( 'allow_user_monitors'=>1, ! 'bboffline'=>0 ) ! , 'mod_phpwsbb_settings')) { ! $content .= 'phpwsBB settings table successfully updated.<br />'; } else { ! $content .= 'There was a problem updating the phpwsBB settings.<br />'; } } else { ! $content .= 'There was a problem updating the phpwsBB settings.<br />'; } } ! if(version_compare($currentVersion, '0.9.1') < 0) { /* Create image directory */ ! PHPWS_File::makeDir($GLOBALS['core']->home_dir . 'images/phpwsbb'); ! if (is_dir($GLOBALS['core']->home_dir . 'images/phpwsbb')) { ! $content .= 'phpwsBB image directory ' . $GLOBALS['core']->home_dir . 'images/phpwsbb/ successfully created!<br />'; /* Copy image files */ $images = array(); ! if($handle = opendir(PHPWS_SOURCE_DIR . 'mod/phpwsbb/img/')) { while (false !== ($file = readdir($handle))) { ! //if ($file != '.' && $file != '..') ! if (is_file(PHPWS_SOURCE_DIR . 'mod/phpwsbb/img/${file}')) ! if(!copy(PHPWS_SOURCE_DIR . 'mod/phpwsbb/img/${file}', $GLOBALS['core']->home_dir . 'images/phpwsbb/${file}')) ! $content .= 'Failed to copy ${file}<br />\n'; } } } else ! $content .= 'phpwsBB could not create the image directory: ' . $GLOBALS['core']->home_dir . 'images/phpwsbb/<br />You will have to do this manually!<br />'; } ! if(version_compare($currentVersion, '1.0.0') < 0) { if($status = $GLOBALS['core']->query('ALTER TABLE mod_phpwsbb_messages ADD owner_id int NOT NULL default 0 AFTER owner', TRUE) && $status = $GLOBALS['core']->sqlCreateIndex('mod_phpwsbb_messages',array('owner_id'))) { |