Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Active Users 09 (http://www.bvlist.com/showthread.php?t=11772)

BamBam0077 4th October 2018 11:58

Active Users 09
 
https://images2.imgbox.com/5b/b2/0wVPnk1i_o.png


Code:

    //==09 users on index
    $active3 ="";
    $file = "./cache/active.txt";
    $expire = 30; // 30 seconds
    if (file_exists($file) && filemtime($file) > (time() - $expire)) {
    $active3 = unserialize(file_get_contents($file));
    } else {
    $dt = sqlesc(time() - 180);
    $active1 = sql_query("SELECT id, username, class, warned, donor FROM users WHERE last_access >= $dt ORDER BY class DESC") or sqlerr(__FILE__, __LINE__);
        while ($active2 = mysqli_fetch_assoc($active1)) {
            $active3[] = $active2;
        }
        $OUTPUT = serialize($active3);
        $fp = fopen($file, "w");
        fputs($fp, $OUTPUT);
        fclose($fp);
    } // end else
    $activeusers = "";
    if (is_array($active3))
    foreach ($active3 as $arr) {
        if ($activeusers) $activeusers .= ",\n";
        $activeusers .= "";
        $arr["username"] = " " . htmlspecialchars($arr['username']) . "";
        $donator = $arr["donor"] === "yes";
        $warned = $arr["warned"] === "yes";
   
        if ($CURUSER)
            $activeusers .= "{$arr["username"]}";
        else
            $activeusers .= "{$arr["username"]}";
        if ($donator)
            $activeusers .= "Donated";
        if ($warned)
            $activeusers .= "Warned";
        $activeusers .= "
";
    }
   
    if (!$activeusers)
        $activeusers = "{$lang['index_noactive']}";
 
      echo "

           

           
{$lang['index_active']}

           

           

            Owners (0) | Administrators (0) | Moderators (0) | V.I.P (0) | Power Users (0) | Members (0) | Validating (0)
           
";
      echo "
           
           
           
{$activeusers}
";

Code:

.myBlock {
    display: block;
    background-color: #151515;
    background-repeat: repeat-x;
    background-position: top;
    width: 100%;
    border: 1px solid #222;
    margin: 0px;
    padding: 0px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);       
}
.myBlock-cap {
    display: block;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #FFF;
    margin-left: 0px;
    background-color: #333333;
    line-height: 200%;
    position: relative;
    bottom: 4px
}
.myBlock-con {
    display: block;
    padding: 7px;
}

replace old code:
Code:


Owners (0) | Administrators (0) | Moderators (0) | V.I.P (0) | Power Users (0) | Members (0) | Validating (0)

new code:
Code:

Owners ({$owners}) | Administrators ({$admins}) | Moderators ({$moderator}) | V.I.P ({$donors}) | Power Users ({$power}) | Members ({$members}) | Validating ({$unverified})
Add below:
Code:

    if (!$activeusers)
        $activeusers = "{$lang['index_noactive']}";

New Code:
Code:

    $owners      = get_row_count('users', "WHERE owners='yes'");
    $admins      = get_row_count('users', "WHERE admin='yes'");
    $moderator  = get_row_count('users', "WHERE moderator='yes'");   
    $donors      = get_row_count('users', "WHERE donor='yes'");
    $power      = get_row_count('users', "WHERE poweruser='yes'");
    $members    = get_row_count('users', "WHERE members='yes'");
    $unverified = number_format(get_row_count("users", "WHERE status='pending'"));

phpmyadmin now:
Code:

ALTER TABLE users ADD owners enum('yes','no') not null default 'no';
ALTER TABLE users ADD admin enum('yes','no') not null default 'no';
ALTER TABLE users ADD moderator enum('yes','no') not null default 'no';
ALTER TABLE users ADD poweruser enum('yes','no') not null default 'no';
ALTER TABLE users ADD members enum('yes','no') not null default 'yes';


https://images2.imgbox.com/7f/a1/7I6wn1Yv_o.png

Napon 31st January 2019 19:15

No good mod

elvira 1st February 2019 21:37

Quote:

Originally Posted by Napon (Post 53198)
No good mod

and why not, on your page we must pay, here is free….

xbdevsponsor 19th February 2023 07:14

Code:

$sysops    = get_row_count('users', "WHERE sysop='yes'");
    $superadmins      = get_row_count('users', "WHERE superadmin='yes'");
    $supermoderators = get_row_count('users', "WHERE supermod='yes'");
      $comvip    = get_row_count('users', "WHERE comvip='yes'");
   
 $donorvip    = get_row_count('users', "WHERE donorvip='yes'");
    $warned  = number_format(get_row_count("users", "WHERE warned='no'"));
$irc    = get_row_count('users', "WHERE irc='yes'");
$irc_idle  = number_format(get_row_count("users", "WHERE irc_idle='no'"));
$suspened  = number_format(get_row_count("users", "WHERE suspended='no'"));

phpmyadmin now:
Code:

Alter table users add sysop enum('yes','no') not null default 'no';
Alter table users add superadmin enum('yes','no') not null default 'yes';
Alter table users add supermod enum('yes','no') not null default 'no';
Alter table users add irc enum('yes','no') not null default 'no';
Alter table users add irc_idle enum('yes','no') not null default 'no';
ALTER TABLE users ADD suspended enum('yes','no') not null default 'no';
ALTER TABLE users ADD vip enum('yes','no') not null default 'no';
Alter table users add warned enum('yes','no') not null default 'no';

Above is new features added to this for more ideas as how it works :) good luck :gum:

extras:

Code:

$sysops    = get_row_count('users', "WHERE sysop='yes'");
    $superadmins      = get_row_count('users', "WHERE superadmin='yes'");
    $supermoderators = get_row_count('users', "WHERE supermod='yes'");
      $comvip    = get_row_count('users', "WHERE comvip='yes'");
   
 $donorvip    = get_row_count('users', "WHERE donorvip='yes'");
    $warned  = number_format(get_row_count("users", "WHERE warned='no'"));
$irc    = get_row_count('users', "WHERE irc='yes'");
$irc_idle  = number_format(get_row_count("users", "WHERE irc_idle='no'"));
$suspened  = number_format(get_row_count("users", "WHERE suspended='no'"));

phpmyadmin now:
Code:

Alter table users add sysop enum('yes','no') not null default 'no';
Alter table users add superadmin enum('yes','no') not null default 'yes';
Alter table users add supermod enum('yes','no') not null default 'no';
Alter table users add irc enum('yes','no') not null default 'no';
Alter table users add irc_idle enum('yes','no') not null default 'no';
ALTER TABLE users ADD suspended enum('yes','no') not null default 'no';
ALTER TABLE users ADD vip enum('yes','no') not null default 'no';
Alter table users add warned enum('yes','no') not null default 'no';

Above is new features added to this for more ideas as how it works :) good luck :gum:

extras:
Code:

    //==09 users on index
    $active3 ="";
    $file = "./cache/active.txt";
    $expire = 30; // 30 seconds
    if (file_exists($file) && filemtime($file) > (time() - $expire)) {
    $active3 = unserialize(file_get_contents($file));
    } else {
    $dt = sqlesc(time() - 180);
    $active1 = sql_query("SELECT id, username, class, warned, donor FROM users WHERE last_access >= $dt ORDER BY class DESC") or sqlerr(__FILE__, __LINE__);
        while ($active2 = mysqli_fetch_assoc($active1)) {
            $active3[] = $active2;
        }
        $OUTPUT = serialize($active3);
        $fp = fopen($file, "w");
        fputs($fp, $OUTPUT);
        fclose($fp);
    } // end else
    $activeusers = "";
    if (is_array($active3))
    foreach ($active3 as $arr) {
        if ($activeusers) $activeusers .= ",\n";
        $activeusers .= "";
        $arr["username"] = " " . htmlspecialchars($arr['username']) . "";
        $donator = $arr["donor"] === "yes";
        $warned = $arr["warned"] === "yes";
   
        if ($CURUSER)
            $activeusers .= "{$arr["username"]}";
        else
            $activeusers .= "{$arr["username"]}";
        if ($donator)
            $activeusers .= "Donated";
        if ($warned)
            $activeusers .= "Warned";
        $activeusers .= "
";
    }
   
    if (!$activeusers)
        $activeusers = "{$lang['index_noactive']}";
 
      echo "

           

           
{$lang['index_active']}

           

           

            Owners (0) | Super Admin (0) | Administrators (0) | Super Mod (0) | Moderators (0) | V.I.P (0) | ComVIP (0) | Trustee VIP | Scene Trustee | Extreme Users (0) | Power Users (0) | Members (0) | Validating (0) | Suspended (0)
           
";
      echo "
           
           
           
{$activeusers}
";


thartley55 19th February 2023 16:12

Why did you post duplicate blocks of code in there?
Probably because you're in too much hurry to spam.

xbdevsponsor 19th February 2023 20:00

properly because it's got new add-ons for IRC, irc_idle, ComVIP, sceneVIP, Trustee VIP, suspended, awaiting approval, these are just a few to name needs usercolors added for xCom as example hopefully more clear for website blogger or convert to fts2.0b

https://images2.imgbox.com/7f/a1/7I6wn1Yv_o.png

DND 19th February 2023 20:43

BamBam is that you? ntz ntz..hahaha
again to the old things?

thartley55 19th February 2023 23:29

Wow. I figured as much, but didn't wanna say it...until that post above.
Can't believe that loser is back.
Well yeah, guess I can believe it...because 'losers' just gotta 'lose'.

xbdevsponsor 20th February 2023 01:08

never know, haha... it's not easy to code some of these mods/hacks I got a lot of mix n match (meaning I supply what we think is or was requested by members or maybe a donor/sponsor of our small projects whom are not going to be mentioned here.

thanks anyway bvlist.com :) :gum:

DND 20th February 2023 12:50

not easy ? not easy what?
copy and paste them from u-232 github?


All times are GMT +2. The time now is 17:25.

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