Bravo List

Bravo List (https://www.bvlist.com/index.php)
-   Community Cafe (https://www.bvlist.com/forumdisplay.php?f=18)
-   -   Personal stats (https://www.bvlist.com/showthread.php?t=6697)

wMan 4th July 2011 16:08

Personal stats
 
Personal stats joes site code for evo_blue:drink:

joeroberts 4th July 2011 16:12

PHP Code:

if ($user->user)
{

OpenTable("Personal stats");
        
$sql = "SELECT seedbonus, avatar, uploaded,  downloaded, invites, uploaded/downloaded AS ratio FROM ".$db_prefix."_users WHERE id = '".$user->id."';";
        
$res = $db->sql_query($sql);
        list (
$seedbonus, $avatar, $uploaded, $downloaded, $invites, $ratio) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<p>".pic("pic_uploaded.gif").mksize($uploaded)."";
        echo 
pic("pic_downloaded.gif").mksize($downloaded)."";
        echo 
pic("pic_ratio.gif");
        echo 
"&nbsp;";
        if (
$downloaded == 0)
                echo 
"&infin;";
        elseif (
$ratio < 0.1)
                echo 
"<font color=\"#ff0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.2)
                echo 
"<font color=\"#ee0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.3)
                echo 
"<font color=\"#dd0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.4)
                echo 
"<font color=\"#cc0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.5)
                echo 
"<font color=\"#bb0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.6)
                echo 
"<font color=\"#aa0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.7)
                echo 
"<font color=\"#990000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.8)
                echo 
"<font color=\"#880000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.9)
                echo 
"<font color=\"#770000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 1)
                echo 
"<font color=\"#660000\">" . number_format($ratio, 2) . "</font>";
        else
                echo 
"<font color=\"#00FF00\">".  number_format($ratio, 2) . "</font>";
        echo 
"\n";
        
#Numer of seeding Torrents
        
$sql = "SELECT P.torrent AS id, T.name as name FROM ".$db_prefix."_peers P, ".$db_prefix."_torrents T WHERE P.uid = '".$user->id."' AND P.seeder = 'yes' AND T.id = P.torrent;";
        
$res = $db->sql_query($sql);
        
$cnt = $db->sql_numrows($res);
        
$torrents = Array();
        while (
$tor = $db->sql_fetchrow($res)) {
                
$torrents[] = htmlspecialchars((strlen($tor["name"]) > 33) ? substr($tor["name"],0,30)."..." : $tor["name"]);
        }
        if (
$cnt > 0) help(pic("upload.gif"),"<p>".implode($torrents,"")."</p>",_btyoureseeding);
        else echo 
pic("upload.gif",null,_btyoureseeding);
        echo 
$cnt;
        
$db->sql_freeresult($sql);
        unset(
$sql, $res, $torrents, $tor, $cnt);
        
#Number of downloading Torrents
        
echo "\n";
        
$sql = "SELECT P.torrent AS id, T.name as name FROM ".$db_prefix."_peers P, ".$db_prefix."_torrents T WHERE P.uid = '".$user->id."' AND P.seeder = 'no' AND T.id = P.torrent;";
        
$res = $db->sql_query($sql);
        
$cnt = $db->sql_numrows($res);
        
$torrents = Array();
        while (
$tor = $db->sql_fetchrow($res)) {
                
$torrents[] = htmlspecialchars((strlen($tor["name"]) > 33) ? substr($tor["name"],0,30)."..." : $tor["name"]);
        }
        if (
$cnt > 0) help(pic("download.gif"),"<p>".implode($torrents,"")."</p>",_btyoureleeching);
        else echo 
pic("download.gif",null,_btyoureleeching);
        echo 
$cnt;
        
$db->sql_freeresult($sql);
        unset(
$sql, $res, $torrents, $tor, $cnt);
        if(
$avatar=="blank.gif")$thavatar = "themes/eVo_blue/pics/noavatar.gif";
        else 
        
$thavatar = "avatars/".$avatar;
        echo 
"</p>";
        echo 
"\n";
        echo 
"\n";
        echo 
"<p align=\"center\"><b>"._btwelcomebk."</b></p>\n";
        echo 
"<p align=\"center\"><b>".$user->name."</b></p>\n";        
        echo 
"<b>".$thavatar."</b>";
        echo 
"\n";
        print(
"<p>Seeding Bonus: <a href='mybonus.php'>".$seedbonus."</a></p>");

CloseTable();    
} 


wMan 4th July 2011 16:20

thax n1 working like a dream

joeroberts 4th July 2011 16:46

sorry was a error in that try this one
PHP Code:

if ($user->user)
{

OpenTable("Personal stats");
        
$sql = "SELECT seedbonus, avatar, uploaded,  downloaded, invites, uploaded/downloaded AS ratio FROM ".$db_prefix."_users WHERE id = '".$user->id."';";
        
$res = $db->sql_query($sql);
        list (
$seedbonus, $avatar, $uploaded, $downloaded, $invites, $ratio) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
        echo 
"<p>".pic("pic_uploaded.gif").mksize($uploaded)."";
        echo 
pic("pic_downloaded.gif").mksize($downloaded)."";
        echo 
pic("pic_ratio.gif");
        echo 
"&nbsp;";
        if (
$downloaded == 0)
                echo 
"&infin;";
        elseif (
$ratio < 0.1)
                echo 
"<font color=\"#ff0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.2)
                echo 
"<font color=\"#ee0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.3)
                echo 
"<font color=\"#dd0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.4)
                echo 
"<font color=\"#cc0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.5)
                echo 
"<font color=\"#bb0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.6)
                echo 
"<font color=\"#aa0000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.7)
                echo 
"<font color=\"#990000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.8)
                echo 
"<font color=\"#880000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 0.9)
                echo 
"<font color=\"#770000\">" . number_format($ratio, 2) . "</font>";
        elseif (
$ratio < 1)
                echo 
"<font color=\"#660000\">" . number_format($ratio, 2) . "</font>";
        else
                echo 
"<font color=\"#00FF00\">".  number_format($ratio, 2) . "</font>";
        echo 
"\n";
        
#Numer of seeding Torrents
        
$sql = "SELECT P.torrent AS id, T.name as name FROM ".$db_prefix."_peers P, ".$db_prefix."_torrents T WHERE P.uid = '".$user->id."' AND P.seeder = 'yes' AND T.id = P.torrent;";
        
$res = $db->sql_query($sql);
        
$cnt = $db->sql_numrows($res);
        
$torrents = Array();
        while (
$tor = $db->sql_fetchrow($res)) {
                
$torrents[] = htmlspecialchars((strlen($tor["name"]) > 33) ? substr($tor["name"],0,30)."..." : $tor["name"]);
        }
        if (
$cnt > 0) help(pic("upload.gif"),"<p>".implode($torrents,"")."</p>",_btyoureseeding);
        else echo 
pic("upload.gif",null,_btyoureseeding);
        echo 
$cnt;
        
$db->sql_freeresult($sql);
        unset(
$sql, $res, $torrents, $tor, $cnt);
        
#Number of downloading Torrents
        
echo "\n";
        
$sql = "SELECT P.torrent AS id, T.name as name FROM ".$db_prefix."_peers P, ".$db_prefix."_torrents T WHERE P.uid = '".$user->id."' AND P.seeder = 'no' AND T.id = P.torrent;";
        
$res = $db->sql_query($sql);
        
$cnt = $db->sql_numrows($res);
        
$torrents = Array();
        while (
$tor = $db->sql_fetchrow($res)) {
                
$torrents[] = htmlspecialchars((strlen($tor["name"]) > 33) ? substr($tor["name"],0,30)."..." : $tor["name"]);
        }
        if (
$cnt > 0) help(pic("download.gif"),"<p>".implode($torrents,"")."</p>",_btyoureleeching);
        else echo 
pic("download.gif",null,_btyoureleeching);
        echo 
$cnt;
        
$db->sql_freeresult($sql);
        unset(
$sql, $res, $torrents, $tor, $cnt);
        if(
$avatar=="blank.gif")$thavatar = "<img src=\"themes/".$theme."/pics/noavatar.gif\" alt=\"".$user->name."\" border=\"0\">";
        else 
        
$thavatar = "<img src=\"avatars/".$avatar."\" alt=\"".$user->name."\" border=\"0\">";
        echo 
"</p>";
        echo 
"\n";
        echo 
"\n";
        echo 
"<p align=\"center\"><b>"._btwelcomebk."</b></p>\n";
        echo 
"<p align=\"center\"><b>".$user->name."</b></p>\n";        
        echo 
"<b>".$thavatar."</b>";
        echo 
"\n";
        print(
"<p>Seeding Bonus: <a href='mybonus.php'>".$seedbonus."</a></p>");

CloseTable();    
} 


wMan 4th July 2011 16:48

Quote:

Originally Posted by joeroberts (Post 28806)
sorry was a error in that try this one

working a treat joe thank you


All times are GMT +2. The time now is 01:11.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2026, vBulletin Solutions Inc.