#
#      Mod UP/DL/Ratio for TorrentPier R775
#      (Re)Coded by Pandora (c), 2008.
#
#-----[ OPEN viewtopic.php AND FIND ]---------------------------------------------
#

$sql = "
	SELECT
	  u.username, u.user_id, u.user_posts, u.user_from, u.user_from_flag,
	  u.user_regdate, u.user_rank, u.user_sig, u.user_sig_bbcode_uid,
	  u.user_avatar, u.user_avatar_type, u.user_allowavatar,
	  p.*,
	  h.post_html, IF(h.post_html IS NULL, pt.post_text, NULL) AS post_text,
	  pt.post_subject, pt.bbcode_uid

#
#-----[ IN-LINE FIND ]---------------------------------------------
#
, pt.bbcode_uid

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------------------
#
, bt.u_up_total, bt.u_down_total, bt.u_up_release, bt.u_up_bonus

#
#-----[ FIND ]---------------------------------------------
#
	LEFT JOIN ". POSTS_HTML_TABLE ." h  ON(h.post_id = p.post_id)

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	LEFT JOIN ". BT_USERS_TABLE   ." bt ON(p.poster_id = bt.user_id)

#
#-----[ FIND ]---------------------------------------------
#
	$poster_joined = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['JOINED'] . ': ' . create_date($lang['DATE_FORMAT'], $postrow[$i]['user_regdate'], $bb_cfg['board_timezone']) : '';

#
#-----[ AFTER, ADD ]---------------------------------------------
#
	$upload = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['u_up_total'] : 0;
	$download = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['u_down_total'] : 0;
	$release = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['u_up_release'] : 0;
	$bonus = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $postrow[$i]['u_up_bonus'] : 0;
	$ratio = ($download) ? round((($upload + $release + $bonus) / $download), 2) : '-';

#
#-----[ FIND ]---------------------------------------------
#
		'EDITED_MESSAGE'     => $l_edited_by,

#
#-----[ AFTER, ADD ]---------------------------------------------
#
		'UPLOAD' => $lang['Topic_Stats_UL'] . ': ' . humn_size($upload),
		'DOWNLOAD' => $lang['Topic_Stats_DL'] . ': ' . humn_size($download),
		'UP_DOWN_RATIO' => '<span style="color: green;">' . $lang['Topic_Stats_Ratio'] . ': </span><b>' . $ratio . '</b>',

#
#-----[ SAVE & CLOSE viewtopic.php ]---------------------------------------------




#-----[ OPEN templates\default\viewtopic.tpl AND FIND ]---------------------------------------------
#
<!-- IF HIDE_RANK_IMG -->.rank_img { display: none; }<!-- ENDIF -->

#
#-----[ AFTER, ADD ]---------------------------------------------
#
<!-- IF HIDE_UPLOAD -->.upload { display: none; }<!-- ENDIF -->
<!-- IF HIDE_DOWNLOAD -->.download { display: none; }<!-- ENDIF -->

#
#-----[ FIND ]---------------------------------------------
#
		<!-- IF postrow.POSTER_AVATAR --><p class="avatar">{postrow.POSTER_AVATAR}</p><!-- ENDIF -->

#
#-----[ AFTER, ADD ]---------------------------------------------
#
		<br>
		<!-- IF postrow.UPLOAD --><p class="upload" style="color: blue;">{postrow.UPLOAD}</p><!-- ENDIF -->
		<!-- IF postrow.DOWNLOAD --><p class="download" style="color: red;">{postrow.DOWNLOAD}</p><!-- ENDIF -->
		<!-- IF postrow.UP_DOWN_RATIO -->{postrow.UP_DOWN_RATIO}<!-- ENDIF -->

#
#-----[ SAVE & CLOSE templates\default\viewtopic.tpl ]------------------------------------------




#-----[ OPEN language\<language name>\lang_main.php AND FIND ]---------------------------------------------
#

$lang['TRANSLATION_INFO']

#
#-----[ ADD AFTER NEXT LINE  ]---------------------------------------------
#

//English language\English\lang_main.php
$lang['Topic_Stats_UL'] = 'Total upload';
$lang['Topic_Stats_DL'] = 'Total download';
$lang['Topic_Stats_Ratio'] = 'Radio';

//Russian language\Russian\lang_main.php
$lang['Topic_Stats_UL'] = 'Всего отдано';
$lang['Topic_Stats_DL'] = 'Всего скачано';
$lang['Topic_Stats_Ratio'] = 'Рейтиг';

#
#-----[ SAVE & CLOSE language\<language name>\lang_main.php ]------------------------------------------

# (Re)Coded by Pandora (c), 2008.
# EoM
# The End!