Thread: Uploaders Rank
View Single Post
  #1  
Old 13th October 2010, 12:19
Fynnon's Avatar
Fynnon Fynnon is offline
xxx
 
Join Date: Nov 2007
P2P
Posts: 984
Default Uploaders Rank
This is for TBDev 2009

Example:

Uploader1 - uploads: 22
Uploader2 - uploads: 12
Uplooder3 - uploads: 9

1. Add in table users:
PHP Code:
ALTER TABLE users ADD `numero_uploadsint(10unsigned NOT NULL default '0'
2. In takeupload.php find:
PHP Code:
mysql_query("INSERT INTO files (torrent, filename, size) VALUES ".file_list($filelist,$id)); 
Add below:
PHP Code:
$user123 $CURUSER["id"]; mysql_query("UPDATE users SET numero_uploads = numero_uploads + 1 WHERE id='$user123'") or sqlerr(__FILE____LINE__); 
3. In delete.php find:
PHP Code:
mysql_query("DELETE FROM torrents WHERE id = $id");     foreach(explode(".","peers.files.comments.ratings") as $x
Add above:
PHP Code:
$res mysql_query("SELECT owner FROM torrents WHERE id = $id"); $row mysql_fetch_assoc($res); $rr $row["owner"]; mysql_query("UPDATE users SET numero_uploads = numero_uploads - 1 WHERE id='$rr'") or sqlerr(__FILE____LINE__); 
4. in index.php add this:
PHP Code:
$HTMLOUT .= "<table border=1 width=50% align=center><tr><td>";   $n_up mysql_query("SELECT * FROM users ORDER BY `numero_uploads` DESC LIMIT 4") or sqlerr(); while($rank mysql_fetch_array($n_up)){    static $contar=0$contar++;  $avatar $rank["avatar"]; if (!$avatar)  $avatar "pic/default_avatar.png";   $HTMLOUT .= "<div>  $contar - <a href=userdetails.php?id=".$rank["id"]."><img src=$avatar width=30 height=30 border=0 class=vsmall_thumb></a></div>  &nbsp;&nbsp;<a href=userdetails.php?id=".$rank["id"]."><b>".$rank["username"]."</b></a>&nbsp;&nbsp;Uploads : <b>".$rank["numero_uploads"]."</b> &nbsp;&nbsp; Reputation : ".$rank["reputation"]."  </div>";  } $HTMLOUT .= "</td></tr></table>"
NOTE: In query the value 4 you change for you want, if you want show 10 uploaders change for 10.
Name:  2ajxow7.jpg
Views: 746
Size:  16.7 KB

HID@tbdev.net/index.php?showtopic=22792
Reply With Quote