Create a new file called ratings.php and upload it directly in your source:
https://www.torrentt...unction-for-208
if you don't have installed this mod, just replace in ratings.php:
https://www.torrentt...unction-for-208
if you don't have installed this mod, just replace in ratings.php:
<?php
require_once("backend/functions.php");
dbconn();
if (get_user_class() < 5)
show_error_msg(T_("ERROR"), T_("SORRY_NO_RIGHTS_TO_ACCESS"), 1);
if (!isset($CURUSER))
show_error_msg(T_("ERROR"), "Not logged in", 1);
$id = 0+$_GET['id'];
$reset = $_GET['reset'];
if($reset == "yes")
{
$res = SQL_Query_exec("DELETE FROM ratings WHERE torrent = $id");
SQL_Query_exec("UPDATE torrents SET numratings = 0, ratingsum = 0 WHERE id = $id");
}
$delete = $_GET['del'];
if(($delete == "yes")&&(get_user_class() >= 6))
{
$rate = 0+$_GET['rate'];
$ratid = 0+$_GET['rat'];
$res = SQL_Query_exec("DELETE FROM ratings WHERE torrent = $id AND user = $ratid ");
SQL_Query_exec("UPDATE torrents SET numratings = numratings - 1, ratingsum = ratingsum - $rate WHERE id = $id");
}
$s = "<br /><table class=table_table align=center width=80% border="0" cellspacing=0 cellpadding="5">n";
$subres = SQL_Query_exec("SELECT * FROM ratings WHERE torrent = $id ORDER BY user");
if(get_user_class() >= 6)
$del1 = "
<td class=table_head align=center>Delete</td>";
$s.="<tr>
<td class=table_head>User</td>
<td class=table_head align=center>Rating</td>
".$del1."</tr>n";
while ($subrow = mysql_fetch_array($subres)) {
$ratingid=$subrow["user"];
$sd=SQL_Query_exec("SELECT username FROM users WHERE id=$ratingid");
$fetched_result = mysql_fetch_array($sd);
$sd = $fetched_result['username'];
$rate = $subrow["rating"];
if(get_user_class() >= 6)
$del2 = "
<td class=table_col1 align=center>[<a href='ratings.php?del=yes&rat=".$ratingid."&id=".$id."&rate=".$rate."'>Delete</a>]</td>";
$s .= "<tr>
<td class=table_col1><a href=account-details.php?id=$ratingid><b>".class_user($sd)."</b></a></td>
<td class=table_col2 align="center"><b>" . $subrow["rating"] . "</b></td>
".$del2."</tr>n";
}
$s .= "</table>n";
$th = @mysql_fetch_array(@sql_query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"])) or die(mysql_error());
if ($th)
$THEME = $th[uri];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Ratings</title>
<link rel="stylesheet" type="text/css" href="<?php echo $site_config['SITEURL'];?>/themes/<?php echo $THEME;?>/theme.css" />
</head>
<body>
<?php
if (get_user_class() >= 6)
print("<div style='margin-top:15px' align=center>[<a href=ratings.php?reset=yes&id=".$id."><font size=2><b>Reset Ratings</b></a>]</div>");
echo $s;
?>
</body>
</html>
In torrents-details.php after this code:
echo "</table></fieldset><br /><br />";
add this one:
$rres = SQL_Query_exec("SELECT rating FROM ratings WHERE torrent = $id");
$rrow = mysql_fetch_assoc($rres);
if (($rrow) && (get_user_class() >= 5 )) {
print("<div style='margin-bottom:3px'>");
print("<table><tr><td><font size=2>[<a href="javascript:void(0);" onclick="window.open('/ratings.php?id=$id', 'mywindow4', 'width=300, height=580, menubar=no, toolbar=no, scrollbars=yes');"><b>See Votes</b></a>]</font></td></tr></table>");
print("</div>");
}
The new window that displays members votes is associated with the current theme.
But, if the "Body" code of theme.css has no defined colors or has nothing defined:
BODY {}
the background will be white. So you need to define in "Body" code at least 2 colors, something like that:
BODY {
color: #2A2A2A;
background-color: #D4D7D5;
}
for the white themes, or:
BODY {
color: #CBCBCB;
background-color: #151515;
}
for the black ones.
The best is to copy the color codes of the "Shoutbox" code (color and background-color).
I use Class Colors Function: ".class_user($sd)."
with:
".$sd."
