Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > YSE
Reply
  #1  
Old 27-05-08, 21:50
Jack's Avatar
Jack Jack is offline
Member
 
Join Date: May 2008
Posts: 4
Default ipcheck.php - add pager function, how?
Hi!


How to add pager function at the ipcheck.php? Thanks!

Code:
<?


require "include/bittorrent.php";

dbconn();

loggedinorreturn();

stdhead("Duplicate IP users");
begin_frame("Duplicate IP users:", true);
begin_table();

if (get_user_class() >= UC_MODERATOR)
{
 $res = sql_query("SELECT count(*) AS dupl, ip FROM users WHERE enabled = 'yes' AND ip <> '' AND ip <> '127.0.0.0' GROUP BY ip ORDER BY dupl DESC, ip") or sqlerr(__FILE__, __LINE__);
  print("<tr align=center><td class=colhead width=90>User</td>
 <td class=colhead width=70>Email</td>
 <td class=colhead width=70>Registered</td>
 <td class=colhead width=75>Last access</td>
 <td class=colhead width=70>Downloaded</td>
 <td class=colhead width=70>Uploaded</td>
 <td class=colhead width=45>Ratio</td>
 <td class=colhead width=125>IP</td>
 <td class=colhead width=40>Peer</td></tr>\n");

 $uc = 0;
  while($ras = mysql_fetch_assoc($res)) {
        if ($ras["dupl"] <= 1)
          break;
        if ($ip <> $ras['ip']) {
          $ros = sql_query("SELECT id, username, class, email, added, last_access, downloaded, uploaded, ip, warned, donor, enabled, (SELECT COUNT(*) FROM peers AS p WHERE p.ip = u.ip AND u.id = p.userid) AS peer_count FROM users AS u WHERE ip='".$ras['ip']."' ORDER BY id") or sqlerr(__FILE__, __LINE__);
          $num2 = mysql_num_rows($ros);
          if ($num2 > 1) {
                $uc++;
            while($arr = mysql_fetch_assoc($ros)) {
                  if ($arr['added'] == '0000-00-00 00:00:00')
                        $arr['added'] = '-';
                  if ($arr['last_access'] == '0000-00-00 00:00:00')
                        $arr['last_access'] = '-';
                  if($arr["downloaded"] != 0)
                        $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
                  else
                        $ratio="---";

                  $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
                  $uploaded = mksize($arr["uploaded"]);
                  $downloaded = mksize($arr["downloaded"]);
                  $added = substr($arr['added'], 0, 10);
                  $last_access = substr($arr['last_access'], 0, 10);
                  if ($uc%2 == 0)
                        $utc = "";
                  else
                        $utc = " bgcolor=\"ECE9D8\"";

                        /*$peer_res = sql_query("SELECT count(*) FROM peers WHERE ip = " . sqlesc($ras['ip']) . " AND userid = " . $arr['id']);
                        $peer_row = mysql_fetch_row($peer_res);*/
                  print("<tr$utc><td align=left>" . get_user_class_color($arr['class'], $arr['username'])."" . get_user_icons($arr) . "</td>
                                  <td align=center>$arr[email]</td>
                                  <td align=center>$added</td>
                                  <td align=center>$last_access</td>
                                  <td align=center>$downloaded</td>
                                  <td align=center>$uploaded</td>
                                  <td align=center>$ratio</td>
                                  <td align=center><span style=\"font-weight: bold;\">$arr[ip]</span></td>\n<td align=center>" .
                                  ($arr['peer_count'] > 0 ? "<span style=\"color: red; font-weight: bold;\">Yes</span>" : "<span style=\"color: green; font-weight: bold;\">No</span>") . "</td></tr>\n");
                  $ip = $arr["ip"];
                }
          }
        }
  }
} else {
 print("
<table width=60% border=1 cellspacing=0 cellpadding=9><tr><td align=center>");
 print("<h2>Error, only for Team</h2></table></td></tr>");
}
end_frame();
end_table();

stdfoot();
?>

Thanks the help, and sorry my bad english!

(This ipcheck.php code made by Yuna Scatari)
Reply With Quote
Reply

Tags
add , function , ipcheckphp , pager

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
file get contents function Help AJ Free Torrent Source 1 16-01-10 16:08
Error function explained joeroberts phpMyBitTorrent (BT.Manager) 0 14-10-09 16:47
FTS 1.1 getallheaders function in announce.php Ashur Free Torrent Source 2 05-09-09 16:50
Why need this function in YSE PRE 6!?? kp380lv YSE 6 03-12-08 21:01
External mail function daeron Template Shares 0 21-06-08 18:08



All times are GMT +2. The time now is 13:04. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2018, vBulletin Solutions Inc.