Example #1
0
            echo '<br />' . _AM_NEWS_UPGRADEFAILED . ' ' . _AM_NEWS_UPGRADEFAILED3;
            $errors++;
        }
    }
    // 4) Create the four new fields for the votes in the story table
    if (!news_FieldExists('rating', $xoopsDB->prefix('stories'))) {
        news_AddField("rating DOUBLE( 6, 4 ) DEFAULT '0.0000' NOT NULL", $xoopsDB->prefix('stories'));
    }
    if (!news_FieldExists('votes', $xoopsDB->prefix('stories'))) {
        news_AddField("votes INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL", $xoopsDB->prefix('stories'));
    }
    if (!news_FieldExists('keywords', $xoopsDB->prefix('stories'))) {
        news_AddField("keywords VARCHAR(255) NOT NULL", $xoopsDB->prefix('stories'));
    }
    if (!news_FieldExists('description', $xoopsDB->prefix('stories'))) {
        news_AddField("description VARCHAR(255) NOT NULL", $xoopsDB->prefix('stories'));
    }
    // 5) Add some indexes to the topics table
    $sql = sprintf('ALTER TABLE ' . $xoopsDB->prefix('topics') . " ADD INDEX ( `topic_title` );");
    $result = $xoopsDB->queryF($sql);
    $sql = sprintf('ALTER TABLE ' . $xoopsDB->prefix('topics') . " ADD INDEX ( `menu` );");
    $result = $xoopsDB->queryF($sql);
    // At the end, if there was errors, show them or redirect user to the module's upgrade page
    if ($errors) {
        echo '<H1>' . _AM_NEWS_UPGRADEFAILED . '</H1>';
        echo '<br />' . _AM_NEWS_UPGRADEFAILED0;
    } else {
        echo _AM_NEWS_UPGRADECOMPLETE . " - <a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=news'>" . _AM_NEWS_UPDATEMODULE . "</a>";
    }
} else {
    printf("<h2>%s</h2>\n", _AM_NEWS_UPGR_ACCESS_ERROR);
Example #2
0
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newstopic.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/class.sfiles.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/blacklist.php';
include_once XOOPS_ROOT_PATH . '/modules/news/class/registryfile.php';
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
include_once XOOPS_ROOT_PATH . '/modules/news/admin/functions.php';
include_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php';
include_once XOOPS_ROOT_PATH . '/class/tree.php';
$dateformat = news_getmoduleoption('dateformat');
$myts =& MyTextSanitizer::getInstance();
$topicscount = 0;
$storiesTableName = $xoopsDB->prefix('stories');
if (!news_FieldExists('picture', $storiesTableName)) {
    news_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()
{
    global $dateformat;