Thread: Help with a mod
View Single Post
  #1  
Old 10th January 2013, 00:01
romano1's Avatar
romano1 romano1 is offline
Senior Member
 
Join Date: Jan 2012
Portugal
Posts: 107
Default Help with a mod
Code:
// users online
begin_frame("$members Users Online");
echo "<center><b><font color=#000000>Member</font> | <font color=#8E35EF>Power User</font> | <img src=\"images/star.png\"><font color=#008000>VIP</font> | <font color=#3300CC>Uploader</font> | <font color=#0FDDAF>Moderator</font> | <font color=#348781>Super Moderator</font> | <font color=#FF0000>Boss</font> <br><br></b></center>";
$resew = SQL_Query_exec("SELECT id, username, class, donated, warned FROM users WHERE enabled = 'yes' AND status = 'confirmed' AND privacy !='strong' AND UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(last_access) <= 100");
while ($arr = mysql_fetch_assoc($resew))
{
if ($usersonline)
         $usersonline .= ", ";
switch ($arr["class"])
{
         case 7:
         $arr["username"] = "<font color=#ff0000>" . $arr["username"] . "</font>";
         break;
         case 6:
         $arr["username"] = "<font color=#348781>" . $arr["username"] . "</font>";
         break;
         case 5:
         $arr["username"] = "<font color=#0FDDAF>" . $arr["username"] . "</font>";
         break;
         case 4:
         $arr["username"] = "<font color=#3300CC>" . $arr["username"] . "</font>";
         break;
         case 3:
         $arr["username"] = "<font color=#008000>" . $arr["username"] . "</font>";
         break;
         case 2:
         $arr["username"] = "<font color=#8E35EF>" . $arr["username"] . "</font>";
         break;
         case 1:
         $arr["username"] = "<font color=#000000>" . $arr["username"] . "</font>";
         break;                         
                 }

         $donator = $arr["donated"] > 0;
if ($CURUSER) {
         $usersonline .= "<a href=account-details.php?id=" . $arr["id"] . ">" . $arr["username"] . "</a></a>";
} else {
         $usersonline .= "<a href=account-details.php?id=" . $arr["id"] . ">" . $arr["username"] . "</a></a>";
}
if ($donator) {
         $usersonline .= "<img src=\"images/star.png\" title=\"You have contributed to the success of the site!\">";
}
$warned = $arr["warned"] == "yes";
if ($warned) {
         $usersonline .= "<img src=\"images/warned.png\" title=\"You had a warning from staff!!\">";
}
$usersonlineday++;
                 }
         echo "<div align='left'>" . $usersonline . "</div>";
echo "<BR>";
end_frame();

begin_frame("$members2 Users Online Last 24 Hours");
echo "<center><b><font color=#000000>Member</font> | <font color=#8E35EF>Power User</font> | <img src=\"images/star.png\"><font color=#008000>VIP</font> | <font color=#3300CC>Uploader</font> | <font color=#0FDDAF>Moderator</font> | <font color=#348781>Super Moderator</font> | <font color=#FF0000>Admin</font> <br><br></b></center>";
$resew = SQL_Query_exec("SELECT id, username, class, donated, warned FROM users WHERE UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(users.last_access) <= 86400 ORDER BY username");
while ($arr = mysql_fetch_assoc($resew))
{
if ($todayactive)
         $todayactive .= ", ";
switch ($arr["class"])
{
         case 7:
         $arr["username"] = "<font color=#ff0000>" . $arr["username"] . "</font>";
         break;
         case 6:
         $arr["username"] = "<font color=#348781>" . $arr["username"] . "</font>";
         break;
         case 5:
         $arr["username"] = "<font color=#0FDDAF>" . $arr["username"] . "</font>";
         break;
         case 4:
         $arr["username"] = "<font color=#3300CC>" . $arr["username"] . "</font>";
         break;
         case 3:
         $arr["username"] = "<font color=#008000>" . $arr["username"] . "</font>";
         break;
         case 2:
         $arr["username"] = "<font color=#8E35EF>" . $arr["username"] . "</font>";
         break;
         case 1:
         $arr["username"] = "<font color=#000000>" . $arr["username"] . "</font>";
         break;                         
                 }
        
         $donator = $arr["donated"] > 0;
if ($CURUSER) {
         $todayactive .= "<a href=account-details.php?id=" . $arr["id"] . ">" . $arr["username"] . "</a></a>";
} else {
         $todayactive .= "<a href=account-details.php?id=" . $arr["id"] . ">" . $arr["username"] . "</a></a>";
}
if ($donator) {
         $todayactive .= "<img src=\"images/star.png\" title=\"You have contributed to the success of the site!\">";
}
$warned = $arr["warned"] == "yes";
if ($warned) {
         $todayactive .= "<img src=\"images/warned.png\" title=\"You had a warning from staff!!\">";
}
$usersactivetoday++;
                 }
         echo "<div align='left'>" . $todayactive . "</div>";
echo "<BR>";
end_frame();
// end users online
I can make it work the 24 who is online but who is online now i cant, you coder friends can help out a bvlist fan?
Edit:never mind its working.

Last edited by romano1; 10th January 2013 at 00:25.
Reply With Quote