Ok , this script show's Ratings for Images for peoples accounts. If their's 2 entry's from the same user name , it wont show the username twice. It only shows the user name once... Where is the code that is making it only show the username 1 time?
<?php
include("../../admin/config.php");
include("../../$include_path/common.php");
include("../../$include_path/$table_file");
include("../../$include_path/doc_head.php");
include("../../$include_path/styles.php");
global $HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_SESSION_VARS;
global $_SESSION, $tb_sessions;
if ($HTTP_POST_VARS!="")
$_POST=$HTTP_POST_VARS;
if ($HTTP_GET_VARS!="")
$_GET=$HTTP_GET_VARS;
if ($HTTP_SESSION_VARS!="")
$_SESSION=$HTTP_SESSION_VARS;
include("$include_path/custom.php");
$id_rated = $_GET['rated'];
$tc_sql = " SELECT count(*) as count1 FROM $tb_ratings where user_id=$id_rated and rater_id <>0 group by rater_ip,rater_id ";
$tc_query = mysql_query($tc_sql) or die(mysql_error());
$tc = mysql_num_rows($tc_query);
if($tc > 0){
$nav_url = "$base_url/acct_proc_info.php?cmd=rated&rated=$rated&";
$nav = toplist_nav_links($tc, $toplists_users_per_page, $np, $ccp, $nav_url);
$nav = <<<EOF
<span class="regular">$nav</span>
EOF;
}
$title = "Who rated you - ";
$id_rated = $_GET['rated'];
$get_username = mysql_query("SELECT username FROM $tb_users WHERE id='$id_rated'") or die(mysql_error());
list($user) = mysql_fetch_row($get_username);
$title .= $user;
// execute the operation for module
$result = mysql_query("SELECT * FROM $tb_ratings where user_id=$id_rated and rater_id <>0 group by rater_ip,rater_id order by timestamp desc limit $csr, $toplists_users_per_page ") or die(mysql_error());
$tpl->define_dynamic('rated_list', 'rated_content_body');
while (list($id, $user_id, $rating, $rater_id, $rater_ip, $timestamp) = mysql_fetch_row($result))
{
if ( $rater_id == "0" )
{
$poster = "guest";
$img = '';
}
else
{
$getposter = mysql_query("SELECT username FROM $tb_users WHERE id='$rater_id'") or die(mysql_error());
list($poster) = mysql_fetch_row($getposter);
$img = '<img src="' . $base_url . '/image1.php?id=' . $rater_id . '&p=1" height="70">';
$poster = "<a href='" . $base_url . "/acct_profile.php?acctid=" . $rater_id . "'>" . $poster. "</a>";
// }
$rate_time = pretty_time($timestamp);
if ($rating >=1 and $rating <=1)
$rating= "10";
else if ($rating >=2 and $rating <= 2)
$rating = "2";
else if ($rating >= 3 and $rating <=3)
$rating = "3";
else if ($rating >=4 and $rating <= 4)
$rating = "3";
else if ($rating >= 5 and $rating <=5)
$rating = "5";
else if ($rating >= 6 and $rating <=6)
$rating = "6";
else if ($rating >=7 and $rating <= 7)
$rating = "7";
else if ($rating >= 8 and $rating <=8)
$rating = "8";
else if ($rating >= 9 and $rating <=9)
$rating = "9";
else if ($rating >=10 and $rating <= 10)
$rating = "10";
$tpl->assign(array( 'IMG' => $img ,
'USERNAME' => $poster,
'RATING' => $rating,
'RATER_IP' => $rater_ip,
'RATING_TIME' => $rate_time,'NAV' => $nav ));
$tpl->parse( ROWS,'.rated_list' );
}
}
$tpl->parse('RATED_CONTENT_BODY', 'rated_content_body');
$tpl->parse('RATED_CONTENT', 'rated_content');
$content = $tpl->fetch('RATED_CONTENT');
//$final_content_nav=$content;
$final_output = table($title, $content);
/*
$final_output = <<<EOF
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="pg" bgcolor="#ffffff">
<tr><td>$nav</<td></tr>
<tr><td>$final_output</<td></tr>
</table>
EOF;
*/
$tpl->assign(array('CONTENT_TEXT' => $final_output));
$tpl->parse('PAGE', 'main');
$final_output = $tpl->fetch('PAGE');
//$final_output = final_output($final_output);
include ("copy.php");
?>