• 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!

[Znote AAC] Account VIP list (TFS 0.3)

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
Preview:

l4M4-WW.png


Edit /layout/widgets/loggedin.php

Below:

PHP:
            <li>
                <a href='myaccount.php'>My Account</a>
            </li>

Add:

PHP:
            <li>
                <a href='friends.php'>My Friends</a>
            </li>

friends.php
PHP:
<?php 
#    TFS 0.3 VIP Friends for ZnoteAAC
#    By cbrm @ otland.net

require_once 'engine/init.php';
protect_page();
include 'layout/overall/header.php';

echo'<h1>VIP Friends</h1>';
$vip = mysql_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 = '.$user_data['id'].'
                    ORDER BY
                        name, online ASC LIMIT 0,100');
while ($row = mysql_fetch_assoc($vip)) {$data[] = $row;}
if (empty($data)) {echo 'You VIP list is empty.'; return include 'layout/overall/footer.php';}
?>

<table><tr class="yellow"><td width="60%"><strong>Name</strong></td><td width="40%"><strong>Status</strong></td></tr>

<?php
foreach($data as $friend)
{
    echo '<tr><td><a href="characterprofile.php?name='.$friend['name'].'">'.$friend['name'].'</a></td>';
    echo '<td><span style="color:'.($friend['online'] == 0 ?  'red;">Offline':'green;">Online').'</span></td></tr>';
} 
echo'</table>'; include 'layout/overall/footer.php'; ?>
 
Last edited:
nice piece of code but including a sql statement to a variable is rather insecure and easy for hackers to distroy your database, id surgest you doing it another way.
 
Improved script a bit, giving it TFS 1.0 support and Znote AAC 1.5 support. (you must use mysqli or Znote SQL functions to make it work in Znote AAC 1.5).
PHP:
<?php
#    TFS 0.2, 0.3/4, 1.0 VIP Friends for ZnoteAAC
#    By cbrm @ otland.net
#    Improved by Znote. (This requires Znote AAC 1.4+, and is compatible with Znote AAC 1.5)

require_once 'engine/init.php';
protect_page();
include 'layout/overall/header.php';

?>
<h1>VIP Friends</h1>
<?php

if ($config['TFSVersion'] !== 'TFS_10') $viplist = mysql_select_multi('SELECT `p`.`name` AS `name`, `p`.`id` AS `id`, `p`.`online` AS `online`, `v`.`player_id` FROM `account_viplist` AS `v` LEFT JOIN `players` AS `p` ON `v`.`player_id` = `p`.`id` WHERE `v`.`account_id` = '.$user_data['id'].' ORDER BY `p`.`name`, `p`.`online` ASC LIMIT 0,100');
else {
    // Lets attempt this at TFS 1.0
    $viplist = mysql_select_multi('SELECT `p`.`name` AS `name`, `p`.`id` AS `id`, `v`.`player_id` FROM `account_viplist` AS `v` LEFT JOIN `players` AS `p` ON `v`.`player_id` = `p`.`id` WHERE `v`.`account_id` = '.$user_data['id'].' ORDER BY `p`.`name` ASC LIMIT 0,100');
    if (!empty($viplist) || $viplist) {
        // Lets find out who are online with just one additional query (not quite sure how to do this with joins)
     
        // Fill up an array that only contains player ids
        $pids = array();
        foreach ($viplist as $p) $pids[] = $p['id'];
     
        // Do a query that returns the online players from that array.
        $onlineData = mysql_select_multi("SELECT `player_id` FROM `players_online` WHERE `player_id` IN (". implode(',', array_map('intval', $pids)) .")");

        // Based on onlineData, fill up an array with only ids of players who are logged in.
        $oids = array();
        foreach ($onlineData as $o) $oids[] = $o['player_id'];
     
        // Now lets modify $viplist with online status, we need to use for loop
        // instead of foreach loop to manipulate original array.
        for ($i = 0; $i < count($viplist); $i++) {
            if (in_array($viplist[$i]['id'], $oids)) $viplist[$i]['online'] = 1;
            else $viplist[$i]['online'] = 0;
        }
    }
}

if (empty($viplist) || !$viplist) echo 'You VIP list is empty.';
else {
    ?>
    <table>
        <tr class="yellow">
            <td width="60%">
                <strong>Name</strong>
            </td>
            <td width="40%">
                <strong>Status</strong>
            </td>
        </tr>
        <?php
        foreach ($viplist as $friend) {
            ?>
            <tr>
                <td>
                    <a href="characterprofile.php?name=<?php echo $friend['name']; ?>">
                        <?php echo $friend['name']; ?>
                    </a>
                </td>
                <td>
                    <?php
                    if ($friend['online'] == 0) echo '<span style="color: red;">Offline</span>';
                    else echo '<span style="color: green;">Online</span>';
                    ?>
                </td>
            </tr>
            <?php
            }
            ?>
    </table>
    <?php
}

include 'layout/overall/footer.php'; ?>

I havent tested it yet so somebody please test it and give feedback. :)
 
Last edited:
Thanks Znote ;p I barely have time to moderate lately and not update this
 
Preview:
l4M4-WW.png


Edit /layout/widgets/loggedin.php


Below:
PHP:
            <li>
                <a href='myaccount.php'>My Account</a>
            </li>

Add:
PHP:
            <li>
                <a href='friends.php'>My Friends</a>
            </li>

friends.php
PHP:
<?php
#    TFS 0.3 VIP Friends for ZnoteAAC
#    By cbrm @ otland.net

require_once 'engine/init.php';
protect_page();
include 'layout/overall/header.php';

echo'<h1>VIP Friends</h1>';
$vip = mysql_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 = '.$user_data['id'].'
                    ORDER BY
                        name, online ASC LIMIT 0,100');
while ($row = mysql_fetch_assoc($vip)) {$data[] = $row;}
if (empty($data)) {echo 'You VIP list is empty.'; return include 'layout/overall/footer.php';}
?>

<table><tr class="yellow"><td width="60%"><strong>Name</strong></td><td width="40%"><strong>Status</strong></td></tr>

<?php
foreach($data as $friend)
{
    echo '<tr><td><a href="characterprofile.php?name='.$friend['name'].'">'.$friend['name'].'</a></td>';
    echo '<td><span style="color:'.($friend['online'] == 0 ?  'red;">Offline':'green;">Online').'</span></td></tr>';
}
echo'</table>'; include 'layout/overall/footer.php'; ?>
Hmm It's not working with me :S i Don't know the reason i made everything like you said
2zhjg92.jpg
 
Ye, NOOBS use Gesior ;*
nah gesior is just easier, since !shop is gay and you need to pay someon to fix ;d gesior is awesome cause its automatic shop system, im also using gesior 2012 for uniserver, its pretty nice.

also NOOBS use znote cause its fast & easy to setup and they can get there money making ots online......
 
Last edited by a moderator:
2015 and yet people are running 8.6 server because they didn't learn how to move forward :)
Evil, i wan't to cry. :((, Znote is a great AAC, i am very happy that theres many scripts that doesn't exist to Gesior or 0.x. LOVE TO ZNOTE AND TFS 1.X <33
 
also NOOBS use znote cause its fast & easy to setup and they can get there money making ots online......
Why wouldn't someone use something that's still being developed and works perfect?

nah gesior is just easier, since !shop is gay and you need to pay someon to fix ;d gesior is awesome cause its automatic shop system, im also using gesior 2012 for uniserver, its pretty nice.
If you search you'll find an automatic shop, for TFS 1.? but we are moving forward so leave the old client versions.
https://otland.net/threads/automatic-znote-aac-shop-tfs-1-0.224483/

Explain whats makes GesiorAAC easier than ZnoteAAC?.
 
Back
Top