Code: Selecteer alles
###############################################
## This MOD is an addon for the Rate Topic Mod. It shows the average in viewforum in stead of the last post information.
###############################################
#
#-----[ UPLOAD ]------------------------------------------
# Upload it to all your templates directories!
#
star_on.gif to templates/subSilver/images/star_on.gif
star_off.gif to templates/subSilver/images/star_off.gif
star_half.gif to templates/subSilver/images/star_half.gif
#
#-----[ OPEN ]------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
'L_AUTHOR' => $lang['Author'],
#
#-----[ ADD, AFTER ]------------------------------------------
#
'L_RATING' => $lang['Rating'],
#
#-----[ FIND ]------------------------------------------
#
$topic_id = $topic_rowset[$i]['topic_id'];
#
#-----[ ADD, AFTER ]------------------------------------------
#
$ratings = rating_stats($topic_id);
if ( $ratings['number_of_rates'] == 0 )
{
$rating_img = $lang['Topic_not_rated'];
}
else
{
$rating_img = '';
$count = 0;
for($j = 0; $j < floor($ratings['average']); $j++)
{
$rating_img .= '<img src="' . $images['star_on'] . '" width="15" height="15" alt="" />';
$count++;
}
$rest = $ratings['average'] - floor($ratings['average']);
if ( $rest < 0.25 && $rest !== 0.00 )
{
$rating_img .= '<img src="' . $images['star_off'] . '" width="15" height="15" alt="" />';
$count++;
}
else if ( $rest >= 0.25 && $rest < 0.75 )
{
$rating_img .= '<img src="' . $images['star_half'] . '" width="15" height="15" alt="" />';
$count++;
}
else if ( $rest >= 0.75 )
{
$rating_img .= '<img src="' . $images['star_on'] . '" width="15" height="15" alt="" />';
$count++;
}
$other = $board_config['rating_max'] - $count;
for($j = 0; $j < $other; $j++)
{
$rating_img .= '<img src="' . $images['star_off'] . '" width="15" height="15" alt="" />';
}
}
#
#-----[ FIND ]------------------------------------------
#
'LAST_POST_IMG' => $last_post_url,
#
#-----[ ADD, AFTER ]------------------------------------------
#
'RATING_IMG' => $rating_img,
#
#-----[ OPEN ]------------------------------------------
# Change it for all your language directories!
#
languages/lang_english/lang_rate.php
#
#-----[ FIND ]------------------------------------------
#
$lang['No_Topics_Rated'] = "No topics have been rated";
#
#-----[ ADD, BEFORE ]------------------------------------------
#
$lang['Topic_not_rated'] = "Topic isn't rated";
#
#-----[ OPEN ]------------------------------------------
# Change it for all your templates directories!
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]------------------------------------------
#
$images['voting_graphic'][4] = "$current_template_images/voting_bar.gif";
#
#-----[ ADD, AFTER ]------------------------------------------
#
$images['star_on'] = "$current_template_images/star_on.gif";
$images['star_off'] = "$current_template_images/star_off.gif";
$images['star_half'] = "$current_template_images/star_half.gif";
#
#-----[ OPEN ]------------------------------------------
# Change it for all your templates directories!
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
#
#-----[ IN-LINE, FIND ]------------------------------------------
#
{L_LASTPOST}
#
#-----[ IN-LINE, REPLACE ]------------------------------------------
#
{L_RATING}
#
#-----[ FIND ]------------------------------------------
#
<td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td>
#
#-----[ IN-LINE, FIND ]------------------------------------------
#
{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}
#
#-----[ IN-LINE, REPLACE ]------------------------------------------
#
{topicrow.RATING_IMG}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
# Eom
#