Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   Visited users in the index? (http://www.bvlist.com/showthread.php?t=7566)

romano1 28th January 2012 14:29

Visited users in the index?
 
Joe what code should i use and where, to show the block of what users visited the tracker? i see that in some of the pmbt trackers..

joeroberts 28th January 2012 15:23

PHP Code:

OpenTable("Users active in the past 24 hours");
        
$sql "SELECT * FROM ".$db_prefix."_users WHERE `active` = 1 AND UNIX_TIMESTAMP(lastlogin) > UNIX_TIMESTAMP(NOW()) - 486400;";
        
$res $db->sql_query($sql);
        
$tot $db->sql_numrows($res);
        while (
$row $db->sql_fetchrow($res)) {
        if(
$row["donator"] == 'true')$donator true;
        else
        
$donator false;
$img '';
                if (
$row["level"] == "premium"$img .= pic("icon_premium.gif",'','premium');
                elseif (
$row["level"] == "moderator"$img .= pic("icon_moderator.gif",'','moderator');
                elseif (
$row["level"] == "admin"$img .= pic("icon_admin.gif",'','admin');
                if(
$donator$img .= '<img src="images/donator.gif" height="16" width="16" title="donator" alt="donator" />';
                if(
$row["warned"] == "1"$img .= '<img src="images/warning.gif" title="warned" alt="warned" />';
        
        
$name = (!$row['username'] == 'NULL' $row['name'] : $row['username']);
        echo
"<a href=\"user.php?op=profile&id=".$row["id"]."\" title=\"".get_formatted_timediff(sql_timestamp_to_unix_timestamp($row["lastlogin"]))._btago."\"><font color=\"".getusercolor($row["can_do"])."\">{$name}</font></a>{$img}";
        if(
$tot 1)echo ",";
        echo 
" ";
        }
        
$db->sql_freeresult($res);

CloseTable(); 


romano1 28th January 2012 18:17

i put this on main.php or index.html?

Thank you Joe, you are great.

i guess its in index.php. sorry

joeroberts 28th January 2012 19:51

:shock:
where ever you want it to show Most likely on the index so then index.php


All times are GMT +2. The time now is 04:50.

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