Exemplo n.º 1
0
function b_news_bigstory_show()
{
    include_once XOOPS_ROOT_PATH . '/modules/news/include/functions.php';
    include_once XOOPS_ROOT_PATH . "/modules/news/class/class.newsstory.php";
    $myts =& MyTextSanitizer::getInstance();
    $restricted = getmoduleoption('restrictindex');
    $dateformat = getmoduleoption('dateformat');
    $infotips = getmoduleoption('infotips');
    $block = array();
    $onestory = new NewsStory();
    $stories = $onestory->getBigStory(1, 0, $restricted, 0, 1, true, 'counter');
    if (count($stories) == 0) {
        $block['message'] = _MB_NEWS_NOTYET;
    } else {
        foreach ($stories as $key => $story) {
            $htmltitle = '';
            if ($infotips > 0) {
                $block['infotips'] = xoops_substr(strip_tags($story->hometext()), 0, $infotips);
                $htmltitle = ' title="' . $block['infotips'] . '"';
            }
            $block['htmltitle'] = $htmltitle;
            $block['message'] = _MB_NEWS_TMRSI;
            $block['story_title'] = $story->title('Show');
            $block['story_id'] = $story->storyid();
            $block['story_date'] = formatTimestamp($story->published(), $dateformat);
            $block['story_hits'] = $story->counter();
            $block['story_rating'] = $story->rating();
            $block['story_votes'] = $story->votes();
            $block['story_author'] = $story->uname();
            $block['story_text'] = $story->hometext();
            $block['story_topic_title'] = $story->topic_title();
            $block['story_topic_color'] = '#' . $myts->displayTarea($story->topic_color);
        }
    }
    return $block;
}