Ok, I have got the following code in the old site, which shows a connected member how many torrents seeding and how many leeching plus the info if connectable or not.
Connectable meaning if all his running torrents match peers in the peers table.
The current code is as follows, but I do believe this with current standard can be simplified.
I am attaching my current topnavbar.php for reference
Connectable meaning if all his running torrents match peers in the peers table.
The current code is as follows, but I do believe this with current standard can be simplified.
//////connectable yes or know////////
if ($CURUSER["view_torrents"]=="yes") {
$res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='yes'") or print(mysql_error());
$row = mysql_fetch_row($res2);
$activeseed = $row[0];
$res2 = mysql_query("SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='no'") or print(mysql_error());
$row = mysql_fetch_row($res2);
$activeleech = $row[0];
$res3 = mysql_query("SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " LIMIT 1") or print(mysql_error());
if($row = mysql_fetch_row($res3)){
$connect = $row[0];
if($connect == "yes"){
$connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"#00FF00\">YES</font></b>";
}else{
$connectable = "<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"FFCCFF\">NO</font></b>";
}
}else{
$connectable ="<b><font face=\"Verdana\" style=\"font-size: 10px\" color=\"99CCFF\">Check Settings</font></b>";
}
}
print(" (<font color=#C0C0C0><i>Seeding:</i></font> <a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/seeding.php?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeseed."</b></font></a> ");
print("<font color=#C0C0C0><i>Leeching:</i> </font><a href=\"javascript:popout(0)\"onclick=\"window.open('" .$site_config["SITEURL"]. "/leeching.php?id=" . $CURUSER["id"] . "','Seeding','width=350,height=350,scrollbars=yes')\"><font color='#EB7F27'><b>".$activeleech."</b></font></a> ");
print("<font color=#C0C0C0><i>Connected:</i></font> ".$connectable.")");
//////connectable yes or know end of mod////////
I am attaching my current topnavbar.php for reference
If It Ain't Dutch, It Ain't Much!!
