From: <ada...@us...> - 2003-08-31 22:57:28
|
Update of /cvsroot/phpwebsite-comm/modules/article/boost In directory sc8-pr-cvs1:/tmp/cvs-serv14830/boost Modified Files: update.php Log Message: -The updater will automatically fix your publication dates on all articles that have already been published. -Some obsolete template files were accidentally included in the last release. Updater will take them out. Index: update.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/article/boost/update.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** update.php 6 Aug 2003 02:26:29 -0000 1.2 --- update.php 31 Aug 2003 22:57:24 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- $status = 1; + $now = date("Y-m-d H:i:s"); if($currentVersion < 1.3) *************** *** 68,75 **** function delfile ($dir, $file) { ! if (unlink(PHPWS_SOURCE_DIR . $dir . $file)) ! return $file.' Deleted.<br />'; ! else ! return 'ERROR: '.$file.' could not be deleted. Please delete it manually.<br />'; } $content .= 'Deleting old template files (the ones with spaces in the names)<br />'; --- 69,79 ---- function delfile ($dir, $file) { ! if (file_exists(PHPWS_SOURCE_DIR . $dir . $file)) ! { ! if (unlink(PHPWS_SOURCE_DIR . $dir . $file)) ! return $file.' Deleted.<br />'; ! else ! return 'ERROR: '.$file.' could not be deleted. Please delete it manually.<br />'; ! } } $content .= 'Deleting old template files (the ones with spaces in the names)<br />'; *************** *** 122,125 **** --- 126,167 ---- } $content .= 'Update to 1.4 Finished!<br />'; + } + if (!function_exists('delfile') ) + { + function delfile ($dir, $file) + { + if (file_exists(PHPWS_SOURCE_DIR . $dir . $file)) + { + if (unlink(PHPWS_SOURCE_DIR . $dir . $file)) + return $file.' Deleted.<br />'; + else + return 'ERROR: '.$file.' could not be deleted. Please delete it manually.<br />'; + } + } + } + if($currentVersion < 1.5) + { + $content .= 'Updating Article Manager to version 1.5<br />'; + $content .= 'Fixing publication dates on all articles that have already been published...'; + $sql = 'UPDATE ' . $GLOBALS['core']->tbl_prefix + . 'mod_article SET publication_date=created_date WHERE publication_date<"'.$now.'"'; + if ($GLOBALS['core']->query($sql)) + $content .= 'Done!<br />'; + else + $content .= 'Update Failed!<br />Try to run this sql command on your database manually: '.$sql.'<br />'; + + $content .= '<br />Deleting old template files (the ones with spaces in the names)<br />' + . delfile('mod/article/templates/section/','.#Centered Image.removed.tpl') + . delfile('mod/article/templates/section/','.#Image Block Left.removed.tpl') + . delfile('mod/article/templates/section/','.#Image Block Right.removed.tpl') + . delfile('mod/article/templates/section/','.#Image Wrap Left.removed.tpl') + . delfile('mod/article/templates/section/','.#Image Wrap Right.removed.tpl') + . delfile('mod/article/templates/section/','.#No Images.removed.tpl') + . delfile('mod/article/templates/section/','.#Text Only.removed.tpl') + . delfile('mod/article/templates/section/','.#Page Insertion (Fit Block).removed.tpl') + . delfile('mod/article/templates/section/','.#Page Insertion (Fit Page).removed.tpl') + . delfile('mod/article/templates/section/','.#Page Insertion (Max Page).removed.tpl') + . delfile('mod/article/templates/section/','.#Page Insertion (Title is Size).removed.tpl'); + $content .= 'Update to 1.5 Finished!<br />'; } ?> |