If you want to display seeding and leeching in your login-block, use this. This also has connectable in it. Edit and move this around as you see fit.
Images go in root images folder. https://www.mediafire.com/file/ms6decv22nkg6u4/updownimages.rar/file
Example: My code looks like this. The connectable code is slightly different, but feel free to test both
$res = mysqli_query($GLOBALS["DBconnector"],"SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='yes'");
$row = mysqli_fetch_row($res);
$activeseed = $row[0];
$res = mysqli_query($GLOBALS["DBconnector"],"SELECT COUNT(*) FROM peers WHERE userid=" . $CURUSER["id"] . " AND seeder='no'");
$row = mysqli_fetch_row($res);
$activeleech = $row[0];
$res2 = mysqli_query($GLOBALS["DBconnector"],"SELECT connectable FROM peers WHERE userid=" . sqlesc($CURUSER["id"]) . " LIMIT 1");
if($row = mysqli_fetch_row($res2)){
$connectable = get_row_count("peers", "WHERE connectable='yes' AND userid=$CURUSER[id]");
$unconnectable = get_row_count("peers", "WHERE connectable='no' AND userid=$CURUSER[id]");
}
if ($unconnectable)
print "<br>".T_('CONNECTABLE')."<b><font color='#FF0000' class='blink'>".T_('CONNECTABLENO')."</font></b>";
elseif ($connectable)
print "<br>".T_('CONNECTABLE')."<b><font color='#00FF00'>".T_('CONNECTABLEYES')."</font></b>";
elseif (empty($row))
print "<br>".T_('CONNECTABLE')."<b><font color='#FF9900'>".T_('CONNECTABLENA')."</font></b>";
print(" • ".T_("ACTIVE_TRANSFERS").": <a href=\"account-details.php?id=".$CURUSER["id"]."#seeding\"><img src='images/download.png' border='0' title='".T_("ACTIVE_TRANSFERS")."'> <font color=lime><b>$activeseed</b></font></a>");
print(" <img src='images/upload.png' border='0' title='".T_("CURRENTLY_LEECHING")."'> <font color=red><b>$activeleech</b></font>");Images go in root images folder. https://www.mediafire.com/file/ms6decv22nkg6u4/updownimages.rar/file
Example: My code looks like this. The connectable code is slightly different, but feel free to test both
$loggedin = get_elapsed_time(strtotime($CURUSER['last_login']));
print ("<center><img width='80' height='80' src='$avatar' alt='' /></center><br />" . T_("DOWNLOADED") . ": $userdownloaded<br />" . T_("UPLOADED") . ": $useruploaded<br />".T_("CLASS").": ".T_($CURUSER["level"])."<br />" . T_("ACCOUNT_PRIVACY_LVL") . ": $privacylevel<br />" . T_("LOGGED_IN_FOR") . ": $loggedin<br />". T_("RATIO") .": $userratio<br>Seed Bonus : <b><a href=mybonus.php>".$bonus."</a></b><br /><hr/>Port: <a href='testport.php' title='Porttest'>".$port."</a><br /><hr/><center>".T_("ACTIVE_TRANSFERS").": </center><br><center><a href=\"account-details.php?id=".$CURUSER["id"]."#seeding\"> <img src='images/download.png' border='0' title='".T_("ACTIVE_TRANSFERS")."'> <font color=lime><b>$activeseed</b></font></a>");
print(" <img src='images/upload.png' border='0' title='".T_("CURRENTLY_LEECHING")."'> <font color=red><b>$activeleech</b><hr/></font></center>");
$connectable = get_row_count("peers", "WHERE connectable='yes' AND userid=$CURUSER[id]");
$unconnectable = get_row_count("peers", "WHERE connectable='no' AND userid=$CURUSER[id]");
if ($unconnectable)
print "<br>".T_('CONNECTABLE')."<b><font color='#FF0000' class='blink'>".T_('CONNECTABLENO')."</font></b>";
elseif ($connectable)
print "<br>".T_('CONNECTABLE')."<b><font color='#00FF00'>".T_('CONNECTABLEYES')."</font></b>";
else
print "<br>".T_('CONNECTABLE')."<b><font color='#FF9900'>".T_('CONNECTABLENA')."</font></b>";
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2021-11-20 22:58:11