function ratings_large()
{
    global $template, $db, $board_config, $theme, $phpbb_root_path, $phpEx, $lang, $page_title, $forum_top;
    if (!isset($forum_top)) {
        $forum_top = -1;
    }
    $top_rated_row = top_rated_topics($board_config['large_rating_return_limit'], $forum_top);
    $rank = 0;
    if (count($top_rated_row)) {
        for ($i = 0; $i < count($top_rated_row); $i++) {
            $last_rate_info = last_rating_info($top_rated_row[$i]['topic_id']);
            $template->assign_block_vars("topicrow", array("RANK" => ++$rank, "CLASS" => !($rank % 2) ? $theme['td_class2'] : $theme['td_class1'], "URL" => append_sid("viewtopic.{$phpEx}?" . POST_TOPIC_URL . "=" . $top_rated_row[$i]['topic_id']), "LAST_RATER" => id_to_value($last_rate_info['user'], 'user'), "LAST_RATER_TIME" => create_date($board_config['default_dateformat'], $last_rate_info['time'], $board_config['board_timezone']), "TITLE" => id_to_value($top_rated_row[$i]['topic_id'], 'topic'), "FORUM" => id_to_value(id_to_value($top_rated_row[$i]['topic_id'], 'topictoforum'), 'forum'), "RATING" => sprintf("%.2f", $top_rated_row[$i]['average']), "MIN" => $top_rated_row[$i]['min'], "MAX" => $top_rated_row[$i]['max'], "L_VIEW_DETAILS" => $board_config['allow_ext_rating'] ? sprintf($lang['View_Details_2'], append_sid("rate.{$phpEx}?rate_mode=detailed&amp;topic_id=" . $top_rated_row[$i]['topic_id'])) : "", "NUMBER_OF_RATES" => $top_rated_row[$i]['rating_number']));
        }
    } else {
        $template->assign_block_vars("notopics", array("MESSAGE" => $lang['No_Topics_Rated']));
    }
    $template->assign_vars(array("PAGE_NAME" => $page_title, "L_FOR_FORUM" => $forum_top != -1 ? sprintf($lang['For_Forum'], id_to_value($forum_top, 'forum')) : $lang['All_Forums'], "L_LAST_RATED" => $lang['Last_Rated'], "L_RATES" => $lang['Number_of_Rates'], "L_RATING" => $lang['Rating'], "L_MIN" => $lang['Min_Rating'], "L_MAX" => $lang['Max_Rate'], "S_FORUMS" => make_forum_drop_down_box(), "S_MODE_ACTION" => append_sid('rate.' . $phpEx), "L_BY_FORUM" => $lang['By_Forum'], "L_VIEW" => $lang['Go']));
    $template->set_filenames(array("body" => "rate_main.tpl"));
    $template->pparse("body");
}
Beispiel #2
0
function ratings_large()
{
    global $template, $db, $config, $theme, $lang, $meta_content, $forum_top;
    if (!isset($forum_top)) {
        $forum_top = -1;
    }
    $top_rated_row = top_rated_topics($config['large_rating_return_limit'], $forum_top);
    $rank = 0;
    if (sizeof($top_rated_row)) {
        for ($i = 0; $i < sizeof($top_rated_row); $i++) {
            $last_rate_info = last_rating_info($top_rated_row[$i]['topic_id']);
            $template->assign_block_vars('topicrow', array('RANK' => ++$rank, 'CLASS' => !($rank % 2) ? $theme['td_class2'] : $theme['td_class1'], 'URL' => append_sid(CMS_PAGE_VIEWTOPIC . '?' . POST_TOPIC_URL . '=' . $top_rated_row[$i]['topic_id']), 'LAST_RATER' => id_to_value($last_rate_info['user'], 'user'), 'LAST_RATER_TIME' => create_date_ip($config['default_dateformat'], $last_rate_info['time'], $config['board_timezone']), 'TITLE' => id_to_value($top_rated_row[$i]['topic_id'], 'topic'), 'FORUM' => id_to_value(id_to_value($top_rated_row[$i]['topic_id'], 'topictoforum'), 'forum'), 'RATING' => sprintf('%.2f', $top_rated_row[$i]['average']), 'MIN' => $top_rated_row[$i]['min'], 'MAX' => $top_rated_row[$i]['max'], 'L_VIEW_DETAILS' => $config['allow_ext_rating'] ? sprintf($lang['View_Details_2'], append_sid('rate.' . PHP_EXT . '?rate_mode=detailed&amp;topic_id=' . $top_rated_row[$i]['topic_id'])) : '', 'NUMBER_OF_RATES' => $top_rated_row[$i]['rating_number']));
        }
    } else {
        $template->assign_block_vars('notopics', array('MESSAGE' => $lang['No_Topics_Rated']));
    }
    $template->assign_vars(array('PAGE_NAME' => $meta_content['page_title'], 'L_FOR_FORUM' => $forum_top != -1 ? sprintf($lang['For_Forum'], id_to_value($forum_top, 'forum')) : $lang['All_Forums'], 'L_LAST_RATED' => $lang['Last_Rated'], 'L_RATES' => $lang['Number_of_Rates'], 'L_RATING' => $lang['Rating'], 'L_MIN' => $lang['Min_Rating'], 'L_MAX' => $lang['Max_Rate'], 'S_FORUMS' => make_forum_drop_down_box(), 'S_MODE_ACTION' => append_sid('rate.' . PHP_EXT), 'L_BY_FORUM' => $lang['By_Forum'], 'L_VIEW' => $lang['Go']));
    // JHL: Template vars commented out to use standard TPL features
    /*
    $template->set_filenames(array('body' => 'rate_main.tpl'));
    $template->pparse('body');
    */
}