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
User Posts

Go to Profile

Thank you very much ArcticWolf   :)   I will try this code immediately.

I've got another question about these clients: from your experience, you know and other clients who cause problems and should be banned?
This system works correctly but I encountered a problem with rtorrent that is the default client on almost all seedboxes.

Regardless of which version is, the seed time recorded is exaggerated. Is recorded about 10-12 days after 2 days of seeding and to ban this client I do not think is a suitable option...

Does anyone know another way? Perhaps a change in the code somewhere? Since this system is useless for users who use rtorrent.
Maybe it does work for you... I think you did something wrong. You can see on my tracker how this mod "does not" work :D
I think that (because of several objective reasons) the VIPs and Staff members should be excluded from penalties of H&R and downloading should be free for these classes.

To do this, into announce.php, this code:



if ($torrent["freeleech"] == 1){

Must be replaced with this one:




if ($user["class"] >= "3" || $torrent["freeleech"] == 1){



Where "3" is your VIP class. For classes higher than Power User the downloading will not be registered.
Into cleanup.php replace "You're" with You are". I also received the same error...
If you want to see all users with H&R recorded add in bottom place of admincp.php the following code:



#======================================================================#

#  Start List of Hit and Run

#======================================================================#

if ($action=="hnr")

{

   stdhead("List of Hit and Run");

   navmenu();



   if (get_user_class() < 6)

       show_error_msg("Acces Denied", 1);

     

   begin_frame("List of Hit and Run");



   $ressy = SQL_Query_exec("SELECT COUNT(*) FROM snatched where hnr='yes' $limit");

   $rowh = mysql_fetch_array($ressy);



   $count = $rowh[0];

   $hnrperpage = 50;



   list($pagertop, $pagerbottom, $limit) = pager($hnrperpage, $count, "admincp.php?action=hnr&");



   print("<div style='margin-top:10px; margin-bottom:10px' align='center'><font size=2>We have <font color=red><b>$count</b></font> User".($count > 1 ? "s" : "")." with Hit and Run</font></div>");



   $sql = "SELECT *,s.tid FROM users u left join snatched s on s.uid=u.id  where hnr='yes' ORDER BY s.uid DESC $limit";

   $result = SQL_Query_exec($sql);



   if( mysql_num_rows($result) != 0 )

   {

       print("$pagertop");

 

       print'<table class=table_table border=0 cellspacing=0 cellpadding=4 align=center>';

           print'<tr>';

               print'<td class=table_head><b>User</b></td>';

               print'<td class=table_head><b>Torrent</b></td>';

               print'<td class=table_head><b>Uploaded</b></td>';

               print'<td class=table_head><b>Downloaded</b></td>';

               print'<td class=table_head><b>Seed&nbsp;Time</b></td>';

               print'<td class=table_head align=center><b>Started</b></td>';

               print'<td class=table_head align=center><b>Last&nbsp;Action</b></td>';

           print'</tr>';



       while($row = mysql_fetch_assoc($result))

       {

           if ($site_config['MEMBERSONLY'])

           {

               $sql1 = "SELECT id, username FROM users WHERE id = $row[uid]";

               $result1 = SQL_Query_exec($sql1);

               $row1 = mysql_fetch_assoc($result1);

           }



           if ($row1['username'])

               print'<tr><td class=table_col1><a href="account-details.php?id=' . $row['uid'] . '"><b>'.class_user($row1['username']).'</b></a></td>';

           else

               print'<tr><td class=table_col1>'.$row[ip].'</td>';



           $sql2 = "SELECT name FROM torrents WHERE id = $row[tid]";

           $result2 = SQL_Query_exec($sql2);



           while ($row2 = mysql_fetch_assoc($result2))

           {

               $smallname =substr(htmlspecialchars($row2["name"]) , 0, 35);

               if ($smallname != htmlspecialchars($row2["name"])) { $smallname .= '...'; }

             

               $stime = mkprettytime($row[ltime]);

               $startdate = utc_to_tz(get_date_time($row['stime']));

               $lastaction = utc_to_tz(get_date_time($row['utime']));



                   print'<td class=table_col2><a href="torrents-details.php?id=' . $row['tid'] . '">' . $smallname . '</td>';

                   print'<td class=table_col1><font color=limegreen>' . mksize($row['uload']) . '</font></td>';

                   print'<td class=table_col2><font color=red>' . mksize($row['dload']) . '</font></td>';          

                   print'<td class=table_col1>'.(is_null($stime)?'0':$stime).'</td>';

                   print'<td align=center class=table_col2>'.date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($startdate)).'</td>';

                   print'<td align=center class=table_col1>'.date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($lastaction)).'</td>';

               print'</tr>';

           }

       }

       print'</table>';

       print("$pagerbottom");

   }

   else

   {

       print'<b><center>No recordings of Hit and Run</center></b><br />';

   }

   end_frame();

   stdfoot();

}

#======================================================================#

# End List of Hit and Run

#======================================================================#

And in command section:




<td align="center"><a href=admincp.php?action=hnr><img src="images/admin/hitnrun_list.png" border=0 width=32 height=32><br />List of Hit and Run</a><br /></td>


[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6648"]images.zip[/url]
What is with this snatched.php? the 'pager' isn't showing but the number of snatches are limited, 'Completed' with time issues and others...
Well, I must to correct it eventually because I see that no one has noticed these problems


[size=14px]OK, I'm back with a new snatched.php corrected file. See the attached archive.[/size]

--------------------------------------------------

I make a mistake here, sorry by that...
[size=18px]I updated the attached archive[/size]

<?php
#================================#
#       TorrentTrader 2.08       #
#  http://www.torrenttrader.org  #
#--------------------------------#
#       Modified by BigMax       #
#================================#

error_reporting(E_ALL ^ E_NOTICE);
error_reporting(1);
require_once('backend/functions.php');
dbconn();
loggedinonly();

$tid = ( int ) $_GET['tid'];
$uid = ( int ) $_GET['uid'];
$id = ( int ) $_GET['id'];

if ($id != 0)
    $uid = ( int ) $_GET['id'];
if ($tid == 0 && $uid == 0)
    $uid = ( int ) $CURUSER['id'];

if ($tid > 0) {
    $count_tid = get_row_count('snatched', 'WHERE `tid` = '' . $tid . ''');
    $type = "torrent";
    $count_uid = 0;
} else {
    $count_uid = get_row_count('snatched', 'WHERE `uid` = '' . $uid . ''');
    $type = "user";
    $count_tid = 0;
}

//===| for debug...
    $debug = 0;
    
if ($debug) {
    $title1 = sprintf(T_("SNATCHLIST_FOR"), " Debug");
    stdhead($title1);
        
begin_frame($title1);
        
    $qry1 = "SELECT
        users.id,
        users.username,
        users.class,
        snatched.uid as uid,
        snatched.tid as tid,
        snatched.uload,
        snatched.dload,
        snatched.stime,
        snatched.utime,
        snatched.ltime,
        snatched.completed,
        completed.date,
        (
        SELECT seeder
        FROM peers
        WHERE torrent = tid AND userid = uid LIMIT 1
        ) AS seeding
        FROM
        snatched
        INNER JOIN users ON snatched.uid = users.id
        INNER JOIN torrents ON snatched.tid = torrents.id
        LEFT JOIN completed ON snatched.tid = completed.torrentid AND snatched.uid = completed.userid
        WHERE
        users.enabled = 'yes' AND users.status = 'confirmed' AND
        torrents.banned = 'no' AND snatched.tid = '$tid' $limit";
        
?>
    <div align="center"><b>Type: <?php echo $type; ?></b></div>
    <div align="center"><b>Torrent ID: <?php echo $tid; ?></b></div>
    <div align="center"><b>UserID: <?php echo $uid; ?></b></div>
    <div align="center"><b>Torrent Count: <?php echo $count_tid; ?></b></div>
    <div align="center"><b>User Count: <?php echo $count_uid; ?></b></div>
    <div align="left"><b>Query: </b><?php echo $qry1; ?></div>
<?php
        
end_frame();
}

    //===| Start Torrents Snatched
if ($type == 'torrent') {
        
if ($count_tid > 0) {
    $torrent = SQL_Query_exec("SELECT `name` FROM `torrents` WHERE `id` = '$tid'");
    $torrents = mysql_fetch_row($torrent);
    $title = sprintf(T_("SNATCHLIST_FOR"), htmlspecialchars($torrents[0]));

    stdhead($title);
    
begin_frame($title);

    $perpage = 50;
    list($pagertop, $pagerbottom, $limit) = pager($perpage, $count_tid, 'snatched.php?tid='.$tid.' &amp;');

    $qry = "SELECT
        users.id,
        users.username,
        users.class,
        snatched.uid as uid,
        snatched.tid as tid,
        snatched.uload,
        snatched.dload,
        snatched.stime,
        snatched.utime,
        snatched.ltime,
        snatched.completed,
        snatched.hnr,
        (
            SELECT seeder
            FROM peers
            WHERE torrent = tid AND userid = uid LIMIT 1
        ) AS seeding
            FROM
            snatched
            INNER JOIN users ON snatched.uid = users.id
            INNER JOIN torrents ON snatched.tid = torrents.id
            WHERE
            users.enabled = 'yes' AND users.status = 'confirmed' AND
            torrents.banned = 'no' AND snatched.tid = '$tid'
            ORDER BY stime DESC $limit";
            
    $res = SQL_Query_exec($qry);

    print("<div style='margin-top:10px; margin-bottom:5px'>[<a href=torrents-details.php?id=$tid><b>Back to Torrent</b></a>]</div>");

if ($count_tid > $perpage) {
    echo ($pagertop);
}

if (mysql_num_rows($res) > 0):
?>
    <table border="0" class="table_table" cellpadding="4" cellspacing="0" width="100%">
<tr>
    <th class="table_head" align="left"><?php echo T_("USERNAME"); ?></th>
    <th class="table_head" align="left"><?php echo T_("UPLOADED"); ?></th>
    <th class="table_head" align="left"><?php echo T_("DOWNLOADED"); ?></th>
    <th class="table_head"><?php echo T_("STARTED"); ?></th>
    <th class="table_head"><?php echo T_("LAST_ACTION"); ?></th>
    <th class="table_head" colspan="2"><?php echo T_("COMPLETED"); ?></th>
    <th class="table_head"><?php echo T_("SEEDING"); ?></th>
    <th class="table_head"><?php echo T_("SEED_TIME"); ?></th>
    <th class="table_head"> H&R </th>
</tr>

<?php
                
while ($row = mysql_fetch_row($res)):
    $startdate = utc_to_tz(get_date_time($row[7]));
    $lastaction = utc_to_tz(get_date_time($row[8]));
    $a = SQL_Query_exec("SELECT date FROM completed WHERE userid = $row[0] AND torrentid = $row[4]");
    $b = mysql_fetch_row($a);
    $comtime = utc_to_tz($b[0]);

if ($row[10] != "0") {
    $ctime = date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($comtime));
} else {
    $ctime = "---";
}

if ($row[11] != "yes") {
    $hnr = "No";  
} else {
    $hnr = "<font color=#FF1200><b>Yes</b></font>";
}
                    
if ($row[12] != "yes") {
    $seed = "No";  
} else {
    $seed = "<font color=#27B500><b>Yes</b></font>";
}
?>
                
    <tr align="center">
    <td class="table_col1" align="left"><a href="account-details.php?id=<?php echo $row[0]; ?>"><b><?php echo class_user($row[1]); ?></b></a></td>
    <td class="table_col2" align="left"><font color="#27B500"><?php echo mksize($row[5]); ?></font></td>
    <td class="table_col1" align="left"><font color="#FF1200"><?php echo mksize($row[6]); ?></font></td>
    <td class="table_col2"><?php echo date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($startdate)); ?></td>
    <td class="table_col1"><?php echo date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($lastaction)); ?></td>
    <td class="table_col2"><?php echo ($row[10]) ? "<font color=#0080FF><b>".T_("YES")."</b></font>" : "".T_("NO").""; ?></td>
    <td class="table_col1"><?php echo $ctime; ?></td>
    <td class="table_col2"><?php echo $seed; ?></td>
    <td class="table_col1"><?php echo ($row[9]) ? mkprettytime($row[9]) : '---'; ?></td>
    <td class="table_col2"><?php echo $hnr; ?></td>
</tr>

<?php
    endwhile;
?>
            
</table>
<?php
if ($count_tid > $perpage) {
    echo ($pagerbottom);
}
    print("<div style='margin-top:5px; margin-bottom:10px' align='right'>[<a href=torrents-details.php?id=$tid><b>Back to Torrent</b></a>]</div>");
endif;
                
end_frame();
stdfoot();
die;
} else {
            
if ($tid >= 1) {
    $torrent = SQL_Query_exec("SELECT `name` FROM `torrents` WHERE `id` = '$tid'");
    $torrents = mysql_fetch_row($torrent);
    $ttitle = sprintf(T_("SNATCHLIST_FOR"), htmlspecialchars($torrents[0]));
                
if ($torrents[0] == '') {
    $ttitle = sprintf("There is no torrent with ID: $tid");
}
                
    stdhead($ttitle);
        
begin_frame($ttitle);
?>
        
    <div style="margin-top:10px; margin-bottom:10px" align="center"><font size="2"><?php echo T_("WAITING_FOR_STATS");?></font></div>
    <div style="margin-bottom:10px" align="center">[<?php echo "<a href=torrents-details.php?id=$tid>";?><b>Back to Torrent</b></a>]</div>
<?php
                
end_frame();
stdfoot();
die;
}
}
}
    //===| End Torrents Snatched

else {
    //===| Start Users Snatched
if ($count_uid > 0) {
    $user = SQL_Query_exec("SELECT `username` FROM `users` WHERE `id` = '$uid'");
    $users = mysql_fetch_row($user);
    $title = sprintf(T_("SNATCHLIST_FOR"), htmlspecialchars($users[0]));
    $title2 = sprintf(T_("SNATCHLIST_FOR"), class_user($users[0]));
            
    stdhead($title);
            
begin_frame($title2);

if (($CURUSER["control_panel"] == "no") && $CURUSER["id"] != $uid) {
    show_error_msg("No Permission", "You do not have permission to be here.", 0);
                
end_frame();
stdfoot();
die;
}
    $perpage = 50;
    list($pagertop, $pagerbottom, $limit) = pager($perpage, $count_uid, 'snatched.php?uid='.$uid.' &amp;');
    $qry = "SELECT
        snatched.tid as tid,
        torrents.name,                                      
        snatched.uload,
        snatched.dload,
        snatched.stime,
        snatched.utime,
        snatched.ltime,
        snatched.completed,
        snatched.hnr,
        (
            SELECT seeder
            FROM peers
            WHERE torrent = tid AND userid = $uid LIMIT 1
        ) AS seeding
        FROM
        snatched
        INNER JOIN users ON snatched.uid = users.id
        INNER JOIN torrents ON snatched.tid = torrents.id
        WHERE
        users.enabled = 'yes' AND users.status = 'confirmed' AND
        torrents.banned = 'no' AND snatched.uid = '$uid'
        ORDER BY stime DESC $limit";

    $res = SQL_Query_exec($qry);

if ( $uid == $CURUSER[id] )
    print("<div style='margin-top:10px; margin-bottom:5px'>[<a href=account.php><b>Back to Profile</b></a>]</div>");
else
    print("<div style='margin-top:10px; margin-bottom:5px'>[<a href=account-details.php?id=$uid><b>Back to Profile</b></a>]</div>");

if ($count_uid > $perpage) {
    echo $pagertop;
}

if (mysql_num_rows($res) > 0):
?>
    
    <table border="0" class="table_table" cellpadding="4" cellspacing="0" width="100%">
<tr>
    <th class="table_head" align="left"><?php echo T_("NAME"); ?></th>
    <th class="table_head" align="left"><?php echo T_("UPLOADED"); ?></th>
    <th class="table_head" align="left"><?php echo T_("DOWNLOADED"); ?></th>
    <th class="table_head"><?php echo T_("STARTED"); ?></th>
    <th class="table_head"><?php echo T_("LAST_ACTION"); ?></th>
    <th class="table_head" colspan="2"><?php echo T_("COMPLETED"); ?></th>
    <th class="table_head"><?php echo T_("SEEDING"); ?></th>
    <th class="table_head"><?php echo T_("SEED_TIME"); ?></th>
    <th class="table_head"> H&R </th>
</tr>
                
<?php
                
while ($row = mysql_fetch_row($res)):
    $startdate = utc_to_tz(get_date_time($row[4]));
    $lastaction = utc_to_tz(get_date_time($row[5]));
    $a = SQL_Query_exec("SELECT date FROM completed WHERE userid = $uid AND torrentid = $row[0]");
    $b = mysql_fetch_row($a);
    $comtime = utc_to_tz($b[0]);

if ($row[7] != "0") {
    $ctime = date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($comtime));
} else {
    $ctime = "---";
}
    
if ($row[8] != "yes") {
    $hnr = "No";  
} else {
    $hnr = "<font color=#FF1200><b>Yes</b></font>";
}
    
if ($row[9] != "yes") {
    $seed = "No";  
} else {
    $seed = "<font color=#27B500><b>Yes</b></font>";
}

?>
    <tr align="center">
    <td class="table_col1" align="left"><a href="torrents-details.php?id=<?php echo $row[0]; ?>"><?php echo $row[1]; ?></a></td>
    <td class="table_col2" align="left"><font color="#27B500"><?php echo mksize($row[2]); ?></font></td>
    <td class="table_col1" align="left"><font color="#FF1200"><?php echo mksize($row[3]); ?></font></td>
    <td class="table_col2"><?php echo date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($startdate)); ?></td>
    <td class="table_col1"><?php echo date('d.M.Y H:i', sql_timestamp_to_unix_timestamp($lastaction)); ?></td>
    <td class="table_col2"><?php echo ($row[7]) ? "<font color=#0080FF><b>".T_("YES")."</b></font>" : "".T_("NO").""; ?></td>
    <td class="table_col1"><?php echo $ctime; ?></td>
    <td class="table_col2"><?php echo $seed; ?></td>
    <td class="table_col1"><?php echo ($row[6]) ? mkprettytime($row[6]) : '---'; ?></td>
    <td class="table_col2"><?php echo $hnr; ?></td>
</tr>
        
<?php
    endwhile;
?>
            
</table>
<?php
if ($count_uid > $perpage) {
    echo $pagerbottom;
}
            
if ( $uid == $CURUSER[id] )
    print("<div style='margin-top:5px; margin-bottom:10px' align='right'>[<a href=account.php><b>Back to Profile</b></a>]</div>");
else
    print("<div style='margin-top:5px; margin-bottom:10px' align='right'>[<a href=account-details.php?id=$uid><b>Back to Profile</b></a>]</div>");
            
endif;
end_frame();
stdfoot();
die;
} else {
    $user = SQL_Query_exec("SELECT `username` FROM `users` WHERE `id` = '$uid'");
    $users = mysql_fetch_row($user);
    $title = sprintf(T_("SNATCHLIST_FOR"), htmlspecialchars($users[0]));
        
if ($users[0] == '') {
    $title = sprintf("There is no user with ID: $uid");
}
    $title2 = sprintf(T_("SNATCHLIST_FOR"), class_user($users[0]));
            
if ($users[0] == '') {
    $title2 = sprintf("There is no user with ID: $uid");
}
            
    stdhead($title);
            
begin_frame($title2);
            
    echo '<div style="margin-top:10px; margin-bottom:10px" align="center"><font size="2">' . T_("WAITING_FOR_STATS") . '</font></div>';
            
if (mysql_num_rows($user) > 0)
    print("<div style='margin-bottom:10px' align='center'>[<a href=account-details.php?id=$uid><b>Back to Profile</b></a>]</div>");
            
end_frame();
stdfoot();
}
}
?>

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6647"]snatched.zip[/url]
Your torrents-details is heavily modified and I don't have time to find this problem...

However, I added this part as a supplement, waived to her.
Ok mate, try these files and I hope that you have created the table 'simpaty' into your database...

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6640"]rep-files.zip[/url]
EZEL, delete what you posted, make a zip archive with these files and attach it to your post.

This is the best way to do the job without any error...
You did something wrong somewhere, send your files and I will check them.
With this system you can give or subtract reputation points, once a week if it is the same member (but of course you can change this value).

The member at which you give or or subtract one point of reputation will receive a PM with the reason (you must to write it) for this action.









Run into yor database:



CREATE TABLE IF NOT EXISTS `simpaty` (

 `id` int(10) unsigned NOT NULL auto_increment,

 `touserid` int(10) unsigned NOT NULL default '0',

 `fromuserid` int(10) unsigned NOT NULL default '0',

 `fromusername` varchar(40) NOT NULL default '',

 `bad` tinyint(1) unsigned NOT NULL default '0',

 `good` tinyint(1) unsigned NOT NULL default '0',

 `type` varchar(60) NOT NULL default '',

 `respect_time` datetime NOT NULL default '0000-00-00 00:00:00',

 `description` varchar(500) NOT NULL,

 PRIMARY KEY  (`id`),

 KEY `touserid` (`touserid`),

 KEY `fromuserid` (`fromuserid`),

 KEY `fromusername` (`fromusername`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;



ALTER TABLE users ADD reputation varchar(6) NOT NULL default '0';

Create a new file called simpaty.php and upload it in your root:




<?

require_once("backend/functions.php");

dbconn();

loggedinonly();



   $return = $_SERVER['HTTP_REFERER'];

   $valid_actions = array('add');

   $action = ( in_array($_GET['action'], $valid_actions) ? $_GET['action'] : '');



   $tar = SQL_Query_exec("SELECT id, username, reputation FROM users WHERE id=".$_GET['targetid']);

   $user = mysql_fetch_array($tar);



   if ($action == 'add') {

       $current_time = get_date_time();

       $targetid = intval($_GET['targetid']);

       $resp_type = (isset($_GET['good'])?1:0);

       $type = $_GET['type'];



       $r = SQL_Query_exec('SELECT id FROM simpaty WHERE touserid=' . $targetid . ' AND type = ' . sqlesc($type) . ' AND fromuserid = ' . $CURUSER['id']);



       if (mysql_num_rows($r) == 1) {

           show_error_msg ("Error","<div style='margin-top:10px; margin-bottom:10px' align=center>You have already changed the Reputation of this member! &nbsp; [<a href='account-details.php?id=$targetid'>Go Back</a>]</div>", 1);

       }



       if ($CURUSER["warned"] == 'yes') {

           show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align=center>You're warned and you cannot modify the reputation to other members! &nbsp; [<a href='account-details.php?id=$targetid'>Go Back</a>]</div>", 1);

       }



       if (!is_valid_id($targetid)) {

           show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align=center>Incorrect ID: $targetid &nbsp; [<a href='account-details.php?id=$targetid'>Go Back</a>]</div>", 1);

       }



       if ($CURUSER["id"] == $targetid) {

           show_error_msg("Error","<div style='margin-top:10px; margin-bottom:10px' align=center>You cannot increases or subtracts your own reputation! &nbsp; [<a href='account-details.php?id=$targetid'>Go Back</a>]</div>", 1);

       }



       if (isset($_POST["description"]) && trim($_POST["description"]) == '') {

           show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align=center>The message cannot be empty! &nbsp; [<a href='account-details.php?id=$targetid'>Go Back</a>]</div>", 1);

       }



       if (!isset($_POST["description"])) {

           show_error_msg(($resp_type == 1?"Give":"Subtract")." one point of Reputation","<div style='margin-top:20px; margin-bottom:20px' align=center>

           <div style='margin-bottom:10px'>Write the Reason for which you want to ".($resp_type == 1?"give reputation to":"subtract reputation from")." <a href='account-details.php?id=$targetid'>".class_user($user[username])."</a> <i>(a PM will be send)</i></div>

           <form action="" . $_SERVER["PHP_SELF"] . "?action=add&" . ($resp_type == 1?'good':'bad') . "&type=$type&targetid=$targetid" method="post">

           <div style='margin-bottom:2px'><textarea cols=80 rows=4 name=description></textarea></div>"."

           <div style='margin-bottom:12px'>n <i>".sprintf(T_("MAX_CHARS"), 500)." " . T_("HTML_NOT_ALLOWED") . "</i></div>

           <input type=submit value=".($resp_type == 1?"Give&nbsp;Reputation":"Subtract&nbsp;Reputation")."></form></div>", 1);

       }



       SQL_Query_exec ('INSERT INTO simpaty VALUES (0, ' . $targetid . ', ' . $CURUSER['id'] . ', ' . sqlesc($CURUSER['username']) . ', ' . ($resp_type==0?1:0) . ', ' . ($resp_type==1?1:0) . ', ' . sqlesc($type) . ', ' . sqlesc($current_time) . ', ' . sqlesc($_POST["description"]) . ')');



       if ($resp_type == 1) {

           SQL_Query_exec('UPDATE users SET reputation = reputation + 1 WHERE id = ' . $targetid);

       } else {

           SQL_Query_exec('UPDATE users SET reputation = reputation - 1 WHERE id = ' . $targetid);

       }

       $msg = sqlesc("[url=".%24site_config%5B"]."/account-details.php?id=".$CURUSER['id']."]".$CURUSER['username']."[/url] has " . ($resp_type == 1?'added one point to':'subtracted one point from') . " your reputation with the following message:nn
Quote:
".$_POST["description"]."
");



       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES (0, $targetid, NOW(), $msg, 0, "Has been made a change in your reputation!")");



       stdhead(($resp_type == 1?"Good":"Bad") . " Reputation it is added");

       autolink("account-details.php?id=$targetid", "<div style='margin-top:10px; margin-bottom:10px' align=center>You have successfully ".($resp_type == 1?"gave one point of reputation to":"subtracted one point of reputation from")." ".class_user($user[username])."</div>");

   }



stdfoot();

?>

[/code]


If you don't have class_user function replace: ".class_user($user[username])." with ".$user[username]." otherwise you will get a error.



Into account-details.php after this line:




Forum Posts: <?php echo number_format($numforumposts); ?><br />




Copy the following code:




   <!--| Start Reputation Points |-->

   <table cellpadding="4">

     <tr class="f-border comment">

       <? #---| config

       $width = "16";

       $height = "16";

       $textsize = "2";

       $picthumbsgood = "images/reputation/good.png";

       $picthumbsbad = "images/reputation/bad.png";

       if ($user[reputation] == "0") { $color = "#2B2525"; }

       elseif ($user[reputation] > "0") { $color = "#209200"; }

       elseif ($user[reputation] < "0") { $color = "#B50000"; }

       ?>

       <td>Reputatation:</td>

       <?php if ($user["id"] != $CURUSER['id']) { ?>

         <td width="20" align="center"><a href="simpaty.php?action=add&good&targetid=<?=$user["id"];?>"><img src="<?=$picthumbsgood;?>" width="<?=$width;?>" height="<?=$height;?>" border="0" title="Give one point"></a></td>

       <?php } ?>

       <td bgcolor="<?=$color;?>" height="16" align="center"><font size="<?=$textsize;?>" color="#FEFEFE"><b>&nbsp; <?=$user[reputation];?> &nbsp;</b></font></td>

       <?php if ($user["id"] != $CURUSER['id']) { ?>

         <td width="20" align="center"><a href="simpaty.php?action=add&bad&targetid=<?=$user["id"];?>"><img src="<?=$picthumbsbad;?>" width="<?=$width;?>" height="<?=$height;?>" border="0" title="Subtract one point"></a></td>

       <?php } ?>

     </tr>

   </table>

   <!--| End Reputation Points |-->






Into torrents-details.php before this line:




echo "<fieldset class='download'><legend><b>Details</b></legend>";




Copy this code:




//===| Start Reputation Points |===//

$rep = SQL_Query_exec("SELECT id,reputation FROM users WHERE id=".$row["owner"]);

$user = mysql_fetch_array($rep);

   if ($user["id"] != $CURUSER['id'] && $row["anon"] != "yes") {

     #---| config

     $width = "16";

     $height = "16";

     $textsize = "2";

     $picthumbsgood = "images/reputation/good.png";

     if ($user[reputation] == "0") { $color = "#2B2525"; }

     elseif ($user[reputation] > "0") { $color = "#209200"; }

     elseif ($user[reputation] < "0") { $color = "#B50000"; }

     ?>

     <table cellpadding="4" align="center">

       <tr class="f-border comment">

         <td>Uploader Reputatation:</td>

         <td bgcolor="<?=$color;?>" height="16" align="center"><font size="<?=$textsize;?>" color="#FEFEFE"><b>&nbsp; <?=$user[reputation];?> &nbsp;</b></font></td>

         <td>Say <b>Thanks</b> with one point of reputation:</td>

         <td width="20" align="center"><a href="simpaty.php?action=add&good&targetid=<?=$user["id"];?>"><img src="<?=$picthumbsgood;?>" width="<?=$width;?>" height="<?=$height;?>" border="0" title="Give one point"></a></td>

       </tr>

       <tr><td height="5"></td></tr><!--| 5px space here! |-->

     </table>

     <?php

   }

//===| End Reputation Points |===//






Into backend/cleanup.php in the most bottom place and before ?> copy this code:




   //===| Delete the old recordings of reputation

   //number of days after which a member can give again reputation to same user

   $delaytime = 7*86400; //days in seconds (default 7 days)

   $delayed = sqlesc(get_date_time(gmtime() - $delaytime));

   SQL_Query_exec("DELETE FROM simpaty WHERE respect_time < $delayed");

   //===| End




Extracts the attached archive and upload reputation folder into images directory.

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6636"]reputation.zip[/url]
And where are recorded the points awarded? On what basis is verified whether a user has given one point to another?
Might be a more appropriate sanction that instead of disabling the account to be subtracted the size of torrent recorded with H&R from the user upload.

That hurts and for account deactivation will work the low ratio system, if is the case.

Eventually it is reach the same result but at a more gentle way and will make the tracker more friendly...
This mod is very useful and works fine, but it's a problem here. A member can gives an unlimited number of points to another.

On my tracker, a joker had the patience to give to a friend almost 1000 points  :lol:

There should be a limit here, maybe only one point to a member in a week, or something...
I don't know how I missed that part... I corrected it and updated my post.
Sorry but I not have all these, you must to install them again.
EZEL, notes that the aspect of this mod depends on the theme used.
[size=18px]OK, I have modified these files for you EZEL, so you can upload a beer on my tracker[/size]  

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6620"]account-details.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6621"]admin-modtasks.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6622"]code for cleanup.php[/url]
[size=18px]The [/size][size=18px]English[/size][size=18px] version for [/size][size=18px]cleanup.php[/size][size=18px]:[/size]



//===| HIT & RUN

$timenow = gmtime();

SQL_Query_exec("UPDATE snatched SET hnr = 'yes' WHERE completed = '1' AND hnr = 'no' AND uload < dload AND $timenow - $site_config[hnr_deadline] > stime AND $site_config[hnr_seedtime] > ltime");

SQL_Query_exec("UPDATE `snatched` SET `hnr` = 'no' WHERE `hnr` = 'yes' AND uload >= dload");

SQL_Query_exec("UPDATE `snatched` SET `hnr` = 'no' WHERE `hnr` = 'yes' AND ltime >= $site_config[hnr_seedtime]");

$a = SQL_Query_exec("SELECT DISTINCT uid FROM snatched WHERE hnr = 'yes'");



if ( mysql_num_rows($a) > 0 ) :

while ($b = mysql_fetch_row($a)) :

$c = SQL_Query_exec("SELECT COUNT( hnr ) FROM snatched WHERE uid = $b[0] AND hnr = 'yes'");

$d = mysql_fetch_row($c);

$count = $d[0];

$user = $b[0];



$length = $site_config["hnr_disabled"];

$expiretime = gmdate("Y-m-d H:i:s", $timenow + $length);



$e = SQL_Query_exec("SELECT type, active FROM warnings WHERE userid = '$user'");

$f = mysql_fetch_row($e);

$type = $f[0];

$active = $f[1];



# warn user

if ( $count >= $site_config["hnr_warn"] && $type != "HnR" ) :

$reason = "You're warned because you have accumulated ".$site_config['hnr_warn']." HnR";

$subject = "Warning for H&R";

$msg = "You're warned because you have accumulated ".$site_config['hnr_warn']." H&RnYou must to keep seeding for the torrents that you have downloaded.nAttention! If you do not remove at least 1 Hit & Run within 7 days, your account will be banned.nIt will be the same if you continue to accumulate Hits & Run.";



$rev = SQL_Query_exec("SELECT enabled FROM users WHERE id = $user");

$rov = mysql_fetch_assoc($rev);

if ($rov["enabled"] == "yes") :

SQL_Query_exec("UPDATE users SET warned = 'yes' WHERE id = $user");

SQL_Query_exec("INSERT INTO warnings (userid, reason, added, expiry, warnedby, type) VALUES ($user,'".$reason."','".get_date_time()."','".$expiretime."','0','HnR')");

SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES (0, $user, '".get_date_time()."', ".sqlesc($subject).", ".sqlesc($msg).", 0)");

endif;

endif;



# remove warning

if ( $count < $site_config["hnr_warn"] && $type == "HnR") :

$subject = "Your warning for H&R has been removed.";

$msg = "You have now less than ".$site_config['hnr_warn']." H&R.nYour warning for H&R has been removed.";

SQL_Query_exec("UPDATE users SET warned = 'no' WHERE id = $user");

SQL_Query_exec("DELETE FROM warnings WHERE userid = $user AND type = 'HnR'");

SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES (0, $user, '".get_date_time()."', ".sqlesc($subject).", ".sqlesc($msg).", 0)");

endif;



# ban user

if ( $count >= $site_config["hnr_ban"] ) :

$g = SQL_Query_exec("SELECT username, email, modcomment FROM users WHERE id = $user");

$h = mysql_fetch_row($g);

$modcomment = $h[2];

$modcomment = gmdate("d-M-Y") . " - Has been disabled because he accumulated: " .$count. " H&Rn " .$modcomment;

SQL_Query_exec("UPDATE users SET enabled = 'no', warned = 'no', modcomment = '$modcomment' WHERE id = $user");

SQL_Query_exec("DELETE FROM warnings WHERE userid = $user AND type = 'HnR'");

write_log("<a href='account-details.php?id=".$user."'><b>".$h[0]."</b></a> has been disabled because he accumulated <b>".$count."</b> H&R");



# send email

$subject = "Your account at $site_config[sITENAME] has been disabled";

$body = "You have been banned for the following reason:n

------------------------------

nYou have accumulated $count H&Rn

------------------------------

nYou can contact us by following this link:

".$site_config['SITEURL']."/contact.php

nnn".$site_config['SITENAME']." ".T_("ADMIN");

sendmail($h[1], "$subject", "$body", "From $site_config[sITEEMAIL]", "-f$site_config[sITEEMAIL]");

endif;

endwhile;

endif;



//Ban warned user

$timenow = gmtime();

$k = SQL_Query_exec("SELECT userid FROM warnings WHERE type = 'HnR' AND active = 'yes' AND UNIX_TIMESTAMP(expiry) < $timenow");

if ( mysql_num_rows($k) > 0 ) :

while ($l = mysql_fetch_row($k)) :

$m = SQL_Query_exec("SELECT username, email, modcomment FROM users WHERE id = $l[0] AND enabled = 'yes' AND warned = 'yes'");

$n = mysql_fetch_row($m);



$modcomment = $n[2];

$modcomment = gmdate("d/m/Y") . " - Banned because that the warning time for H&R has expired.n " .$modcomment;

SQL_Query_exec("UPDATE users SET enabled = 'no', warned = 'no', modcomment = '$modcomment' WHERE id = $l[0]");

SQL_Query_exec("DELETE FROM warnings WHERE userid = $l[0] AND type = 'HnR'");

write_log("<a href='account-details.php?id=".$l[0]."'><b>".$n[0]."</b></a> has been banned because that the warning time for H&R has expired.");



$subject = "Your account at $site_config[sITENAME] has been disabled";

$body = "You have been banned for the following reason:n

------------------------------

nThe warning time for H&R has expired.n

------------------------------

nYou can contact us by following this link:

".$site_config['SITEURL']."/contact.php

nnn".$site_config['SITENAME']." ".T_("ADMIN");

sendmail($n[1], "$subject", "$body", "From $site_config[sITEEMAIL]", "-f$site_config[sITEEMAIL]");

endwhile;

endif;

//===| END HIT & RUN

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