• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern AAC] VIP Friends Injection

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
jOBFcmgywg.png


It simply displays your VIP friends in any of your character's pages.
If the character you are looking at isn't at your account, it won't appear.
This has been tested with this default value of config.lua:
Lua:
separateVipListPerCharacter = false


  • Create folder and .php file @ \injections\character_view\vip\injection.php:
PHP:
<!-- # # # # # # # # # # # # # # # # # # # # # # # # # # # 
#VIP Friends Injection v0.2a for ModernAAC;by Cybermaster#
# # # # # # # # # # # # # # # # # # # # # # # # # # # #-->  
<?PHP
    if (!defined('BASEPATH')) exit('No direct script access allowed');
    $ide = new IDE;
    $player = $GLOBALS['player'];
    $SQL = POT::getInstance()->getDBHandle();
        
    if(!$ide->isLogged()) return true;
    $account_logged = new OTS_Account();
    $account_logged->load($_SESSION['account_id']);
    if($player->getAccount() != $account_logged) return true;        
    $vip = $SQL->query('SELECT p.name AS name, p.id AS id, p.online AS online, 
    player_id FROM account_viplist
    LEFT JOIN players p ON account_viplist.player_id = p.id
    WHERE account_viplist.account_id = '.$player->getAccount().' 
    ORDER BY name, online ASC LIMIT 0,100')->fetchAll();    
    if(empty($vip)) return true; 
    echo '<div class="message"><div class="title">VIP</div><div class="content">';
    echo '<table width="100%" cellpadding="10" cellspacing="0" border="0" style="margin: 10px 0px 10px 0px;" class="cellspadding">';
    echo '<tr class="tableheader"><td width="90%"><b>Name</b></td><td align"center"><b>Status</center></b></td></tr>';
    foreach($vip as $friend) 
    {            
        $status = $friend['online'] == 1 ? '<span style="color:green;">Online</span>' : '<span style="color:red;">Offline</span>';
        echo '<tr class="tablerow"><td width="90%">
        <a span style="text-decoration: none;" href="'.WEBSITE.'/index.php/character/view/'.$friend["name"].'">'.$friend["name"].'</a></td><td>'.$status.'</td></tr>';
    }
    echo '</table></div></div>';
?>
I might make an online VIP management but I guess it's enough to do it in-game.:rolleyes:
 
Last edited:
With option to disable/enable separate viplist per character
PHP:
<?PHP
    if (!defined('BASEPATH')) exit('No direct script access allowed');
 $separatePerChar = false;
    $ide = new IDE;
    $player = $GLOBALS['player'];
    $SQL = POT::getInstance()->getDBHandle();
    $account_logged = new OTS_Account();
    $account_logged->load($_SESSION['account_id']);
 
    if($ide->isLogged() and $player->getAccount() == $account_logged)
    {
  $vip = null;
  if (!$separatePerChar) {
   $vip = $SQL->query('SELECT p.name AS name, p.id AS id, p.online AS online, 
   player_id FROM account_viplist
   LEFT JOIN players p ON account_viplist.player_id = p.id
   WHERE account_viplist.account_id = '.$player->getAccount().' 
   ORDER BY name, online ASC LIMIT 0,100')->fetchAll();  
  } else if ($separatePerChar) {
   $vip = $SQL->query('SELECT p.name AS name, p.id AS id, p.online AS online, 
   player_id FROM player_viplist
   LEFT JOIN players p ON player_viplist.player_id = p.id
   WHERE player_viplist.id = '.$player->getId().' 
   ORDER BY name, online ASC LIMIT 0,100')->fetchAll();  
  }   
        if(!empty($vip)) 
        {
            echo '<br/><div class="message"><div class="title">VIP</div><div class="content">';
            echo '<table width="100%" cellpadding="10" cellspacing="0" border="0" style="margin: 10px 0px 10px 0px;" class="cellspadding">';
            echo '<tr class="tableheader"><td width="90%"><b>Name</b></td><td align="center"><b>Status</center></b></td></tr>';
            foreach($vip as $friend) 
            {            
                $status = $friend['online'] == 1 ? '<span style="color:green;">Online</span>' : '<span style="color:red;">Offline</span>';
                echo '<tr class="tablerow"><td width="90%">
                <a span style="text-decoration: none;" href="'.WEBSITE.'/index.php/character/view/'.$friend["name"].'">'.$friend["name"].'</a></td><td>'.$status.'</td></tr>';
            }
            echo '</table></div></div>';
        }
    }

#edit
check query to separate, because I could make some mistakes in names of fields or tables.
 
nice ;d tho separate vip lists were not working in my tests, at least at rev3952
 
Back
Top