• 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] Support List

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
This is AchTung's script, updated for Modern AAC. I removed those old ugly styles the GesiorAAC usually has, and well... look at the preview:
supporty.png


You have to set the dir address in the script where your server folder is located:
PHP:
$config['site']['server_path'] = "C:/otserv/";

Now, create this new script @ /system/pages/support.php
PHP:
<?PHP
 /* * * * * * * * * * * * * * * * * * * * * * * * * *  
* Improved Support List                              *
* Adapted for Modern AAC by Cybermaster               *
* Original from AchTung                                *
* Credits to Gesior(Standard Version)                   *
* Credits to Zonet(Improved the PHP script with css part)*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();

//IMPORTANT!! SET SERVER DIR HERE \/
$config['site']['server_path'] = "C:/otserv/";

if($groups = simplexml_load_file($config['site']['server_path'].'/data/XML/groups.xml') or die('<strong>Could not load groups!</strong>')) 
    foreach($groups->group as $g)   
        $groupList[(int)$g['id']] = $g['name']; 
        $list = $SQL->query("SELECT `name`, `online`, `group_id`, `world_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` DESC");
        $showed_players = 0;
        echo'<div class="bar"><center>Support in game</center></div><br/><br/><br/>';
        $headline = '<table class="houses_list_box" border="0" cellspacing="0" cellpadding="4" width="100%">
        <tr class="bar"><td class="house_title" width="30%"><strong>Group</strong>    </td>
        <td class="house_title" width="35%"><strong>Name</strong></td>
        <td class="house_title" width="15%"><strong>Status</strong></td>
        <td class="house_title" width="20%"><strong>World</strong></td>'; 
        
        $group_id = 0;
        foreach($list as $gm)
        {
            if($group_id != (int)$gm['group_id']) 
                { 
                    if($group_id != 0) 
                        echo'</table><br />'; 
                        echo $headline; 
                        $group_id = (int)$gm['group_id']; 
                } 
            echo'<tr class="over"><td>'.$groupList[(int)$gm['group_id']].'</td><td><a class="link" href="'.WEBSITE.'/index.php/character/view/'.$gm['name'].'">'.$gm['name'].'</a></td><td><font color="'.($gm['online'] == 0 ? 'red">Offline' : 'green">Online').'</font></td><td>'.$config['worlds'][$gm['world_id']].'</td></tr>'; 
        } 
    echo'</table>'; 
?>    
<style type="text/css"> 
        tr.over:hover { 
        background-color: #FAFAD2; 
        }
        .link {text-decoration: none;font-weight:bold;color:black;}
        .more {    display: none;}
</style>

:D Then you can access it: http://localhost//index.php/p/v/support

:peace: Don't install this via AdminPanel because it won't work.



 
Last edited by a moderator:
If you want it like this:
62877973.png


Use:
PHP:
<?PHP
 /* * * * * * * * * * * * * * * * * * * * * * * * * *  
* Improved Support List                              *
* Adapted for Modern AAC by Cybermaster               *
* Original from AchTung                                *
* Credits to Gesior(Standard Version)                   *
* Credits to Zonet(Improved the PHP script with css part)*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
$config['site']['server_path'] = "C:/otserv/";

if($groups = simplexml_load_file($config['site']['server_path'].'/data/XML/groups.xml') or die('<b>Could not load groups!</b>')) 
    foreach($groups->group as $g)   
        $groupList[(int)$g['id']] = $g['name']; 
        $list = $SQL->query("SELECT `name`, `online`, `group_id`, `world_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` DESC");
        $showed_players = 0;
        echo'<div class="bar"><center>Support in game</center></div><br/><br/><br/>';
        $headline = '<table border="0" cellspacing="1" cellpadding="0" width="100%" style="border: 1px solid rgb(93, 67, 16);">
        <tr class="bar"><td width="30%"><font class=white><b>Group</b></font></td>
        <td width="35%"><font class=white><b>Name</b></font></td>
        <td width="15%"><font class=white><b>Status</b></font></td>
        <td width="20%"><font class=white><b>World</b></font></td>'; 
        
        $group_id = 0;
        foreach($list as $gm)
        {
            if($group_id != (int)$gm['group_id']) 
                { 
                    if($group_id != 0) 
                        echo'</table><br />'; 
                        echo $headline; 
                        $group_id = (int)$gm['group_id']; 
                } 
            echo'<tr class="over"><td>'.$groupList[(int)$gm['group_id']].'</td><td><a class="link" href="'.WEBSITE.'/index.php/character/view/'.$gm['name'].'">'.$gm['name'].'</a></td><td><font color="'.($gm['online'] == 0 ? 'red">Offline' : 'green">Online').'</font></td><td>'.$config['worlds'][$gm['world_id']].'</td></tr>'; 
        } 
    echo'</table>'; 

?>    
<style type="text/css"> 
        tr.over:hover { 
        background-color: #FAFAD2; 
        }
           .link {text-decoration: none;font-weight:bold;color:black;}
        .more {    display: none;}
</style>
 
I get a blank page when I try to go to it, when I created it using the pages option in administration
 
I get a blank page when I try to go to it, when I created it using the pages option in administration
:eek: weird
did you set the server data folder address correctly?
 
try "C:/Documents and Settings/xxxx/Desktop/server/"
 
A PHP Error was encountered

Severity: Warning

Message: simplexml_load_file(): I/O warning : failed to load external entity "etc/forgottenserver/data/XML/groups.xml"

Filename: pages/support.php

Line Number: 11
Could not load groups!

Any help? (Im on Linux)

Edit: Fixed it.. you need the first / if your on linux.. so if your server path is etc/forgottenserver you need to write /etc/forgottenserver
 
Last edited:
did you write right directory to groups.xml, note that linux is case-sensitive ;p for example: XML or Xml , needs to be exactly same :)
 
did you write right directory to groups.xml, note that linux is case-sensitive ;p for example: XML or Xml , needs to be exactly same :)

Actually edited my post 2 minutes before you replied and said i fixed it..

Anyway +rep to CyberM great stuff, keep up the good work!
 
Back
Top