コード例 #1
0
ファイル: index.php プロジェクト: severnaya99/Sg-2010
function newSubmissions()
{
    $storyarray = AmsStory::getAllSubmitted();
    if (count($storyarray) > 0) {
        echo "<table width='100%' border='0' cellspacing='1' class='outer'>";
        echo "<tr><td class=\"odd\">";
        echo "<div style='text-align: center;'><b>" . _AMS_AM_NEWSUB . "</b><br /><table width='100%' border='1'><tr class='bg3'><td align='center'>" . _AMS_AM_TITLE . "</td><td align='center'>" . _AMS_AM_POSTED . "</td><td align='center'>" . _AMS_AM_POSTER . "</td><td align='center'>" . _AMS_AM_ACTION . "</td></tr>\n";
        foreach ($storyarray as $newstory) {
            $uids[] = $newstory->uid();
        }
        $member_handler =& xoops_gethandler('member');
        $users = $member_handler->getUsers(new Criteria('uid', "(" . implode(',', array_keys($uids)) . ")", 'IN'), true);
        foreach ($storyarray as $newstory) {
            $newstory->uname($users);
            echo "<tr><td>\n";
            $title = $newstory->title();
            if (!isset($title) || $title == "") {
                echo "<a href='index.php?op=edit&amp;storyid=" . $newstory->storyid() . "'>" . _AD_NOSUBJECT . "</a>\n";
            } else {
                echo "&nbsp;<a href='../submit.php?op=edit&amp;storyid=" . $newstory->storyid() . "'>" . $title . "</a>\n";
            }
            echo "</td><td align='center' class='nw'>" . formatTimestamp($newstory->created(), 's') . "</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&amp;storyid=" . $newstory->storyid() . "'>" . _AMS_AM_DELETE . "</a></td></tr>\n";
        }
        echo "</table></div>\n";
        echo "</td></tr></table>";
        echo "<br />";
    }
}
コード例 #2
0
ファイル: ams_moderate.php プロジェクト: severnaya99/Sg-2010
function b_ams_topics_moderate()
{
    include_once XOOPS_ROOT_PATH . "/class/xoopstopic.php";
    include_once XOOPS_ROOT_PATH . "/modules/AMS/class/class.newsstory.php";
    $block = array();
    $storyarray = AmsStory::getAllSubmitted(0, true, true);
    if (count($storyarray) > 0) {
        $block['lang_story_title'] = _AMS_MB_TITLE;
        $block['lang_story_date'] = _AMS_MB_POSTED;
        $block['lang_story_author'] = _AMS_MB_POSTER;
        $block['lang_story_action'] = _AMS_MB_ACTION;
        $block['lang_story_topic'] = _AMS_MB_TOPIC;
        foreach ($storyarray as $thisstory) {
            $uids[$thisstory->uid()] = $thisstory->uid();
        }
        $member_handler =& xoops_gethandler('member');
        $user_arr = $member_handler->getUsers(new Criteria('uid', "(" . implode(',', array_keys($uids)) . ")", 'IN'), true);
        foreach ($storyarray as $newstory) {
            $newstory->uname($user_arr);
            $title = $newstory->title();
            if (!isset($title) || $title == "") {
                $linktitle = "<a href='" . XOOPS_URL . "/modules/AMS/index.php?op=edit&amp;storyid=" . $newstory->storyid() . "'>" . _AD_NOSUBJECT . "</a>";
            } else {
                $linktitle = "<a href='" . XOOPS_URL . "/modules/AMS/submit.php?op=edit&amp;storyid=" . $newstory->storyid() . "'>" . $title . "</a>";
            }
            $story['title'] = $linktitle;
            $story['date'] = formatTimestamp($newstory->created());
            $story['author'] = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $newstory->uid() . "'>" . $newstory->uname . "</a>";
            $story['action'] = "<a href='" . XOOPS_URL . "/modules/AMS/submit.php?op=delete&amp;storyid=" . $newstory->storyid() . "'>" . _AMS_MB_DELETE . "</a>";
            $story['topic_title'] = $newstory->topic_title();
            $block['stories'][] =& $story;
            unset($story);
        }
    }
    return $block;
}