Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > BT.Manager (phpMyBitTorrent)
Reply
Thread Tools
  #1  
Old 26th June 2011, 17:11
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default imperialbt statistics code
i think this is messed up
Code:
echo "
<div class=\"maintitle_base\"><div class=\"header_left\"><div class=\"header_right\">
<h3 class=\"maintitle\"> Our Statistics</h3>
</div></div></div>
<div class=\"border2\"> 
<div id=\"board_statistics\" class=\"statistics stats_container\"> 
    
        <div id=\"stats\"> 
            <h2> Statistics</h2> 
            <dl> ";
echo "<dt>Torrents</dt><dd>".$tottorrent."</dd>\n"; 
echo "<dt>We have shared </dt><dd>".mksize($totshare)."</dd>\n";
echo "<dt>Seeders</dt><dd>".$totseeders."</dd>\n";
echo "<dt>Leechers</dt><dd>".$totleechers."</dd>\n";
echo "<dt>Members</dt><dd>".$totuser."</dd>\n";
        echo "
            </dl> 
        </div> 
    
    <div id=\"active_users\" class=\"stats_list\"> 
            <h2>";
$legend = '<b>'; 
$sqlev = "SELECT name, color FROM ".$db_prefix."_levels"; 
$reslev = $db->sql_query($sqlev); 
        while ($rowlev = $db->sql_fetchrow($reslev)) { 
        $legend .='<a href="memberslist.php?mode=group&g='.$rowlev['name'].'" style="color: '.$rowlev['color'].'; font-weight: bold;">'.$rowlev['name'].'</a> '; 
} 
$legend .= '</b>'; 
$db->sql_freeresult($reslev); 
$sql = "SELECT O.id AS id, O.page AS page, UNIX_TIMESTAMP(O.logged_in) AS logged_in, IF(U.name IS NULL, U.username, U.name) as name, U.donator AS donator, U.warned AS warned, U.can_do as can_do, U.level AS level, U.Show_online AS Show_online, U.uploaded as uploaded, U.downloaded AS downloaded FROM ".$db_prefix."_online_users O LEFT JOIN ".$db_prefix."_users U ON O.id = U.id WHERE UNIX_TIMESTAMP(NOW()-U.lastlogin) < 1800 AND U.Show_online = true;"; 
$res = $db->sql_query($sql); 
$tot = $db->sql_numrows($res); 
$i = 1; 
$simple = "\n<p>"; 
$user_now = $db->sql_numrows($res); 
if ($user_now == 0) $simple .= _btnouseronline; 
else { 
        while ($row = $db->sql_fetchrow($res)) { 
        //if($row[id] == $user->id)break; 
        if($row["donator"] == 'true')$donator = true; 
        else 
        $donator = false; 
                $simple .= "<a href=\"user.php?op=profile&id=".$row["id"]."\"><font color=\"".getusercolor($row["can_do"])."\">"; 
                $simple .= htmlspecialchars($row["name"])."</font></a>"; 
                if ($row["level"] == "premium") $simple .= pic("icon_premium.gif",'','premium'); 
                elseif ($row["level"] == "moderator") $simple .= pic("icon_moderator.gif",'','moderator'); 
                elseif ($row["level"] == "admin") $simple .= pic("icon_admin.gif",'','admin'); 
    if($donator) $simple .= '<img src="images/donator.gif" height="16" width="16" title="donator" alt="donator" />'; 
     if($row["warned"] == "1") $simple .= '<img src="images/warning.gif" title="warned" alt="warned" />'; 
                if ($i < $tot) $simple .= ", "; 
                $i++; 
 
        } 
        $simple .= ""; 
} 
$db->sql_freeresult($res);
        echo"$simple";
echo "<br /> $user_now active user(s) <span>(in past 5 minutes)</span><br /> 
                <span class=\"desc\">$legend</span> 
            </h2> 
        </div>
</div></div>";
Reply With Quote
  #2  
Old 26th June 2011, 17:13
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
where is the query for stats? did you change it?
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #3  
Old 26th June 2011, 17:15
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
yes i taked out a lot
query thing starts AFTER
Code:
echo "
<div class=\"maintitle_base\"><div class=\"header_left\"><div class=\"header_right\">
<h3 class=\"maintitle\"> Our Statistics</h3>
</div></div></div>
<div class=\"border2\"> 
<div id=\"board_statistics\" class=\"statistics stats_container\"> 
    
        <div id=\"stats\"> 
            <h2> Statistics</h2> 
            <dl> ";
echo "<dt>Torrents</dt><dd>".$tottorrent."</dd>\n"; 
echo "<dt>We have shared </dt><dd>".mksize($totshare)."</dd>\n";
echo "<dt>Seeders</dt><dd>".$totseeders."</dd>\n";
echo "<dt>Leechers</dt><dd>".$totleechers."</dd>\n";
echo "<dt>Members</dt><dd>".$totuser."</dd>\n";
        echo "
            </dl> 
        </div> 
    
    <div id=\"active_users\" class=\"stats_list\"> 
            <h2>";
Reply With Quote
  #4  
Old 26th June 2011, 17:17
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
I still need to see the complete code if Im to help improve it.
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #5  
Old 26th June 2011, 17:49
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
all the code is in my first post there is noting else for this block
everything else in index.php is basicly the same as original only some blocks are comented out
old statistics function is removed
basicly that's all there is changed in index.php
Reply With Quote
  #6  
Old 26th June 2011, 18:56
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
Quote:
Originally Posted by it53lv View Post
all the code is in my first post there is noting else for this block
everything else in index.php is basicly the same as original only some blocks are comented out
old statistics function is removed
basicly that's all there is changed in index.php
that's why it's not working you removed the part that gets the information
I well look at it l8r as I got stuff going on here rite now.
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #7  
Old 26th June 2011, 19:03
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
ok it's not realy important at this point so no wories
Reply With Quote
  #8  
Old 27th June 2011, 00:52
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
try this
PHP Code:
echo "
<div class=\"maintitle_base\"><div class=\"header_left\"><div class=\"header_right\">
<h3 class=\"maintitle\"> Our Statistics</h3>
</div></div></div>
<div class=\"border2\"> 
<div id=\"board_statistics\" class=\"statistics stats_container\"> 
    
        <div id=\"stats\"> 
            <h2> Statistics</h2> 
            <dl> "
;
        
//Total Torrents and their size
        
$sql "SELECT COUNT(id), SUM(size) FROM ".$db_prefix."_torrents;";
        
$res $db->sql_query($sql);
        list (
$tottorrent$totshare) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
echo 
"<dt>"._btindex_totaltorrents."</dt><dd>".$tottorrent."</dd>\n"
echo 
"<dt>"._btindex_totalshare."</dt><dd>".mksize($totshare)."</dd>\n";
        
//Total seeders and total leechers
        
$sql "SELECT COUNT(id) FROM ".$db_prefix."_peers GROUP BY seeder ORDER BY seeder ASC;";
        
$res $db->sql_query($sql);
        list (
$totseeders) = $db->sql_fetchrow($res);
        list (
$totleechers) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
echo 
"<dt>"._btindex_totalseeders."</dt><dd>".$totseeders."</dd>\n";
echo 
"<dt>"._btindex_totalleechers."</dt><dd>".$totleechers."</dd>\n";
        
//Total users
        
$sql "SELECT COUNT(id) FROM ".$db_prefix."_users;";
        
$res $db->sql_query($sql);
        list (
$totuser) = $db->sql_fetchrow($res);
        
$db->sql_freeresult($res);
echo 
"<dt>"._btindex_totalregister."</dt><dd>".$totuser."</dd>\n";
        echo 
"
            </dl> 
        </div> 
    
    <div id=\"active_users\" class=\"stats_list\"> 
            <h2>"
;
$legend '<b>'
$sqlev "SELECT name, color FROM ".$db_prefix."_levels"
$reslev $db->sql_query($sqlev); 
        while (
$rowlev $db->sql_fetchrow($reslev)) { 
        
$legend .='<a href="memberslist.php?mode=group&g='.$rowlev['name'].'" style="color: '.$rowlev['color'].'; font-weight: bold;">'.$rowlev['name'].'</a> '

$legend .= '</b>'
$db->sql_freeresult($reslev); 
$sql "SELECT O.id AS id, O.page AS page, UNIX_TIMESTAMP(O.logged_in) AS logged_in, IF(U.name IS NULL, U.username, U.name) as name, U.donator AS donator, U.warned AS warned, U.can_do as can_do, U.level AS level, U.Show_online AS Show_online, U.uploaded as uploaded, U.downloaded AS downloaded FROM ".$db_prefix."_online_users O LEFT JOIN ".$db_prefix."_users U ON O.id = U.id WHERE UNIX_TIMESTAMP(NOW()-U.lastlogin) < 1800 AND U.Show_online = true;"
$res $db->sql_query($sql); 
$tot $db->sql_numrows($res); 
$i 1
$simple "\n<p>"
$user_now $db->sql_numrows($res); 
if (
$user_now == 0$simple .= _btnouseronline
else { 
        while (
$row $db->sql_fetchrow($res)) { 
        
//if($row[id] == $user->id)break; 
        
if($row["donator"] == 'true')$donator true
        else 
        
$donator false
                
$simple .= "<a href=\"user.php?op=profile&id=".$row["id"]."\"><font color=\"".getusercolor($row["can_do"])."\">"
                
$simple .= htmlspecialchars($row["name"])."</font></a>"
                if (
$row["level"] == "premium"$simple .= pic("icon_premium.gif",'','premium'); 
                elseif (
$row["level"] == "moderator"$simple .= pic("icon_moderator.gif",'','moderator'); 
                elseif (
$row["level"] == "admin"$simple .= pic("icon_admin.gif",'','admin'); 
    if(
$donator$simple .= '<img src="images/donator.gif" height="16" width="16" title="donator" alt="donator" />'
     if(
$row["warned"] == "1"$simple .= '<img src="images/warning.gif" title="warned" alt="warned" />'
                if (
$i $tot$simple .= ", "
                
$i++; 
 
        } 
        
$simple .= ""

$db->sql_freeresult($res);
        echo
"$simple";
echo 
"<br /> $user_now active user(s) <span>(in past 5 minutes)</span><br /> 
                <span class=\"desc\">
$legend</span> 
            </h2> 
        </div>
</div></div>"

__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #9  
Old 27th June 2011, 00:54
it53lv's Avatar
it53lv it53lv is offline
Senior Member
 
Join Date: Feb 2011
Latvia
Posts: 134
Default
perfect :bubble:
Reply With Quote
  #10  
Old 28th October 2011, 15:47
CanonSems CanonSems is offline
Member
 
Join Date: Oct 2011
P2P
Posts: 1
Default
all the code is in my first post there is noting else for this block
everything else in index.php is basicly the same as original only some blocks are comented out
Reply With Quote
Reply

Tags
code , imperialbt , statistics


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



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