Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Show Rating Votes
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2012-12-30 08:09:09
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:



<?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."

votes.png
votes.png
Unknown User
2012-12-30 15:13:36
Thank you for this  :)

But when I press [see Votes]I get this error message

Fatal error: Call to undefined function class_user() in /home/nordicbi/public_html/ratings.php on line 51

I use ratings.php over here nothing changed..

otherwise it seems awesome  :)

Sincerely

Balle
Unknown User
2012-12-30 16:03:34
I use Class Colors Function: [url="https://www.torrenttrader.org/topic/17452-class-colors-function-for-208"]https://www.torrentt...unction-for-208[/url] and I forgot to mention that in first post,  sorry...

I recommend you to install this mod, but if you don't want that, replace:

".class_user($sd)."
with:


".$sd."


and everything will be OK.
Unknown User
2012-12-30 16:15:07
Thank you, works like a dream now :D
2012-12-30 16:32:24
#1 Big Thanks BigMax1 :D
Unknown User
2012-12-30 16:53:51
Tiloup, I'm working to promote to the next level: BigMax2  
Unknown User
2012-12-30 19:18:07
THANKS for this one. Works perfect.
Unknown User
2013-01-02 22:42:21
nice job  ;)



bark("Not logged in");


is for old 1st version TT

you have to change it for





show_error_msg(T_("ERROR"), "Not logged in", 1);






and i change





if (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>");

}




for







$numrat = mysql_num_rows($xres);

if (($numrat > 0) && (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>");

}



Unknown User
2013-01-03 11:10:23
Sorry AzuriS, your code does not work...

But this one works properly:



$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>");

}



[size=18px]I updated the first post.[/size]
Unknown User
2013-01-04 21:07:36
"BigMax1, post: 87836":
Sorry AzuriS, your code does not work...

sorry, it is cause i put this in an another place than you ;)
Unknown User
2013-01-05 09:04:58
Regarding your code AzuriS, in torrents-details.php, $xres is defined in this way:



$xres = SQL_Query_exec("SELECT rating, added FROM ratings WHERE torrent = $id AND user = " . $CURUSER["id"]);

Please to remarks this part:




AND user = " . $CURUSER["id"]




So with that code you will be able to see only your votes  
Unknown User
2013-01-05 14:57:57
you're right ;)
Unknown User
2013-01-08 22:52:58
thank you
Unknown User
2013-01-13 00:16:30
nice
Unknown User
2013-01-20 01:42:32
thanks you BigMax1 words good
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728