/** * 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 ALL the new submissions. * The system's block called "Waiting Contents" is listing the number of those news. */ function newSubmissions() { global $dateformat; $storyarray = NewsStory::getAllSubmitted(); if (count($storyarray) > 0) { news_collapsableBar('newsub', 'topnewsubicon'); echo "<img onclick='toggle('toptable'); toggleIcon('toptableicon');' id='topnewsubicon' name='topnewsubicon' src=" . XOOPS_URL . "/modules/news/images/close12.gif alt='' /></a> " . _AM_NEWSUB . "</h4>"; echo "<div id='newsub'>"; echo "<br />"; echo "<div style='text-align: center;'><table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTED . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center'>" . _AM_ACTION . "</td></tr>\n"; $class = ''; foreach ($storyarray as $newstory) { $class = $class == 'even' ? 'odd' : 'even'; echo "<tr class='" . $class . "'><td align='left'>\n"; $title = $newstory->title(); if (!isset($title) || $title == "") { echo "<a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=edit&returnside=1&storyid=" . $newstory->storyid() . "'>" . _AD_NOSUBJECT . "</a>\n"; } else { echo " <a href='" . XOOPS_URL . "/modules/news/submit.php?returnside=1&op=edit&storyid=" . $newstory->storyid() . "'>" . $title . "</a>\n"; } echo "</td><td>" . $newstory->topic_title() . "</td><td align='center' class='nw'>" . formatTimestamp($newstory->created(), $dateformat) . "</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname() . "</a></td><td align='right'><a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=delete&storyid=" . $newstory->storyid() . "'>" . _AM_DELETE . "</a></td></tr>\n"; } echo "</table></div>"; echo "<br /></div><br />"; } }
/** * 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; $start = isset($_GET['startnew']) ? intval($_GET['startnew']) : 0; $newsubcount = NewsStory::getAllStoriesCount(3, false); $storyarray = NewsStory::getAllSubmitted(news_getmoduleoption('storycountadmin'), true, news_getmoduleoption('restrictindex'), $start); if (count($storyarray) > 0) { $pagenav = new XoopsPageNav($newsubcount, news_getmoduleoption('storycountadmin'), $start, 'startnew', 'op=newarticle'); news_collapsableBar('newsub', 'topnewsubicon'); echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='topnewsubicon' name='topnewsubicon' src='" . XOOPS_URL . "/modules/news/images/close12.gif' alt='' /></a> " . _AM_NEWSUB . "</h4>"; echo "<div id='newsub'>"; echo '<br />'; echo "<div style='text-align: center;'><table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'><tr class='bg3'><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_TOPIC . "</td><td align='center'>" . _AM_POSTED . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center'>" . _AM_ACTION . "</td></tr>\n"; $class = ''; foreach ($storyarray as $newstory) { $class = $class == 'even' ? 'odd' : 'even'; echo "<tr class='" . $class . "'><td align='left'>\n"; $title = $newstory->title(); if (!isset($title) || $title == '') { echo "<a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=edit&returnside=1&storyid=" . $newstory->storyid() . "'>" . _AD_NOSUBJECT . "</a>\n"; } else { echo " <a href='" . XOOPS_URL . "/modules/news/submit.php?returnside=1&op=edit&storyid=" . $newstory->storyid() . "'>" . $title . "</a>\n"; } echo "</td><td>" . $newstory->topic_title() . "</td><td align='center' class='nw'>" . formatTimestamp($newstory->created(), $dateformat) . "</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname() . "</a></td><td align='right'><a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=delete&storyid=" . $newstory->storyid() . "'>" . _AM_DELETE . "</a></td></tr>\n"; } echo '</table></div>'; echo "<div align='right'>" . $pagenav->renderNav() . '</div><br />'; echo '<br /></div><br />'; } }
function b_news_topics_moderate() { include_once XOOPS_ROOT_PATH . "/modules/news/class/class.newsstory.php"; include_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php'; $block = array(); $dateformat = getmoduleoption('dateformat'); $infotips = getmoduleoption('infotips'); $storyarray = NewsStory::getAllSubmitted(0, true, getmoduleoption('restrictindex')); if (count($storyarray) > 0) { $block['lang_story_title'] = _MB_TITLE; $block['lang_story_date'] = _MB_POSTED; $block['lang_story_author'] = _MB_POSTER; $block['lang_story_action'] = _MB_ACTION; $block['lang_story_topic'] = _MB_TOPIC; $myts =& MyTextSanitizer::getInstance(); foreach ($storyarray as $newstory) { $title = $newstory->title(); $htmltitle = ''; if ($infotips > 0) { $story['infotips'] = xoops_substr(strip_tags($newstory->hometext()), 0, $infotips); $htmltitle = ' title="' . $story['infotips'] . '"'; } if (!isset($title) || $title == "") { $linktitle = "<a href='" . XOOPS_URL . "/modules/news/index.php?op=edit&storyid=" . $newstory->storyid() . "' target='_blank'" . $htmltitle . ">" . _AD_NOSUBJECT . "</a>"; } else { $linktitle = "<a href='" . XOOPS_URL . "/modules/news/submit.php?op=edit&storyid=" . $newstory->storyid() . "' target='_blank'" . $htmltitle . ">" . $title . "</a>"; } $story = array(); $story['title'] = $linktitle; $story['date'] = formatTimestamp($newstory->created(), $dateformat); $story['author'] = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname() . "</a>"; $story['action'] = "<a href='" . XOOPS_URL . "/modules/news/admin/index.php?op=delete&storyid=" . $newstory->storyid() . "'>" . _MB_DELETE . "</a>"; $story['topic_title'] = $newstory->topic_title(); $story['topic_color'] = '#' . $myts->displayTarea($newstory->topic_color); $block['stories'][] =& $story; unset($story); } } return $block; }
function newSubmissions() { global $xoopsConfig, $xoopsDB; $storyarray = NewsStory::getAllSubmitted(); if (count($storyarray) > 0) { echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; echo "<div style='text-align: center;'><b>" . _AM_NEWSUB . "</b><br /><table width='100%' border='1'><tr class='bg2'><td align='center'>" . _AM_TITLE . "</td><td align='center'>" . _AM_POSTED . "</td><td align='center'>" . _AM_POSTER . "</td><td align='center'>" . _AM_ACTION . "</td></tr>\n"; foreach ($storyarray as $newstory) { echo "<tr><td>\n"; $title = $newstory->title(); if (!isset($title) || $title == "") { echo "<a href='index.php?op=edit&storyid=" . $newstory->storyid() . "'>" . _AD_NOSUBJECT . "</a>\n"; } else { echo " <a href='index.php?op=edit&storyid=" . $newstory->storyid() . "'>" . $title . "</a>\n"; } echo "</td><td align='center' class='nw'>" . formatTimestamp($newstory->created()) . "</td><td align='center'><a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname() . "</a></td><td align='right'><a href='index.php?op=delete&storyid=" . $newstory->storyid() . "'>" . _AM_DELETE . "</a></td></tr>\n"; } echo "</table></div>\n"; echo "</td></tr></table>"; echo "<br />"; } }