include_once NW_MODULE_PATH . '/class/class.newsstory.php'; include_once NW_MODULE_PATH . '/class/class.newstopic.php'; include_once NW_MODULE_PATH . '/class/class.sfiles.php'; include_once NW_MODULE_PATH . '/class/blacklist.php'; include_once NW_MODULE_PATH . '/class/registryfile.php'; include_once XOOPS_ROOT_PATH.'/class/uploader.php'; include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; include_once NW_MODULE_PATH . '/admin/functions.php'; include_once NW_MODULE_PATH . '/include/functions.php'; include_once XOOPS_ROOT_PATH.'/class/tree.php'; $dateformat=nw_getmoduleoption('dateformat', NW_MODULE_DIR_NAME); $myts =& MyTextSanitizer::getInstance(); $topicscount=0; $storiesTableName = $xoopsDB->prefix('nw_stories'); if(!nw_FieldExists('picture', $storiesTableName)) { nw_AddField('`picture` VARCHAR( 50 ) NOT NULL', $storiesTableName); } /** * Show new submissions * * This list can be view in the module's admin when you click on the tab named "Post/Edit News" * Submissions are news that was submit by users but who are not approved, so you need to edit * them to approve them. * Actually you can see the the story's title, the topic, the posted date, the author and a * link to delete the story. If you click on the story's title, you will be able to edit the news. * The table contains the last x new submissions. * The system's block called "Waiting Contents" is listing the number of those news. */ function newSubmissions()
echo '<br />' . _AM_NW_UPGRADEFAILED.' '._AM_NW_UPGRADEFAILED3; $errors++; } } // 4) Create the four new fields for the votes in the nw_stories table if (!nw_FieldExists('rating',$xoopsDB->prefix('nw_stories'))) { nw_AddField("rating DOUBLE( 6, 4 ) DEFAULT '0.0000' NOT NULL",$xoopsDB->prefix('nw_stories')); } if (!nw_FieldExists('votes',$xoopsDB->prefix('nw_stories'))) { nw_AddField("votes INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL",$xoopsDB->prefix('nw_stories')); } if (!nw_FieldExists('keywords',$xoopsDB->prefix('nw_stories'))) { nw_AddField("keywords VARCHAR(255) NOT NULL",$xoopsDB->prefix('nw_stories')); } if (!nw_FieldExists('description',$xoopsDB->prefix('nw_stories'))) { nw_AddField("description VARCHAR(255) NOT NULL",$xoopsDB->prefix('nw_stories')); } // 5) Add some indexes to the topics table $sql=sprintf('ALTER TABLE ' . $xoopsDB->prefix('nw_topics') . " ADD INDEX ( `topic_title` );"); $result=$xoopsDB->queryF($sql); $sql=sprintf('ALTER TABLE ' . $xoopsDB->prefix('nw_topics') . " ADD INDEX ( `menu` );"); $result=$xoopsDB->queryF($sql); $moduledirname = NW_MODULE_DIR_NAME; // At the end, if there was errors, show them or redirect user to the module's upgrade page if($errors) { echo '<H1>' . _AM_NW_UPGRADEFAILED . '</H1>'; echo '<br />' . _AM_NW_UPGRADEFAILED0;