• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Windows Website not showing online players

Zaggyzigzig

plx itens menz
Joined
Aug 25, 2014
Messages
386
Reaction score
50
Location
Canada Ontario
I am using Znote ACC
This is my online list from my www file in uniserver, Do i need to execute some type of sql?


Do I need to create an sql insert for phpmyadmin? something like~~
CREATE TABLE IF NOT EXISTS `onlinel_list` (
`player_id` int(11) NOT NULL, <------ Something like that? What would i post ito create an sql for this table?

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>
<h1>Players Online</h1>
<?php
$array = online_list();
if ($array) {
    ?>
  
<?php if (user_count_online() == 1) {
    echo "<i><b>Total of "; echo user_count_online(); echo " player are currently playing at our server.</b></i><br>";
}
else {
    echo "<i><b>Total of "; echo user_count_online(); echo " players are currently playing at our server.</b></i><br>";
}
?>  
  
    <table id="onlinelistTable" class="table table-striped table-hover">
        <tr class="yellow">
            <th>Name:</th>
            <th>Level:</th>
            <th>Vocation:</th>
        </tr>
            <?php
            foreach ($array as $value) {
            echo '<tr>';
            echo '<td><a href="characterprofile.php?name='. $value['name'] .'">'. $value['name'] .'</a></td>';
            echo '<td>'. $value['level'] .'</td>';
            echo '<td>'. vocation_id_to_name($value['vocation']) .'</td>';
            echo '</tr>';
            }
            ?>
    </table>

    <?php
} else {
    echo '<i><b>Currently Fixing... Bug says 0 players online but it IS ONLINE!.</i></b>';
}
?>
<?php include 'layout/overall/footer.php'; ?>



<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>

<h1>Players Online</h1>
<?php
$array = online_list();
if ($array) {
    ?>
  
<?php if (user_count_online() == 1) {
    echo "<i><b>Total of "; echo user_count_online(); echo " player are currently playing at our server.</b></i><br>";
}
else {
    echo "<i><b>Total of "; echo user_count_online(); echo " players are currently playing at our server.</b></i><br>";
}
?>  
  
    <table id="onlinelistTable" class="table table-striped table-hover">
        <tr class="yellow">
            <th>Name:</th>
            <th>Level:</th>
            <th>Vocation:</th>
        </tr>
            <?php
            foreach ($array as $value) {
            echo '<tr>';
            echo '<td><a href="characterprofile.php?name='. $value['name'] .'">'. $value['name'] .'</a></td>';
            echo '<td>'. $value['level'] .'</td>';
            echo '<td>'. vocation_id_to_name($value['vocation']) .'</td>';
            echo '</tr>';
            }
            ?>
    </table>

    <?php
} else {
    echo '<i><b>Currently Fixing... Bug says 0 players online but it IS ONLINE!.</i></b>';
}
?>
<?php include 'layout/overall/footer.php'; ?>
 
There might be a column in the player table called online. In that case you can count the rows of each player with that status, something in this fashion:
Code:
SELECT `online` FROM `players` WHERE `online` = 1

ANd you can fetch that and simply use a php function called count or sizeof.
Code:
$playerCount = count($result);

Ignazio
 
The script you posted is the whole code twice. If your file looks like that, locate
Code:
<?php include 'layout/overall/footer.php'; ?>
that should be at the end of the file.

This works fine for me:
PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>

<h1>Players Online</h1>
<?php
$array = online_list();
if ($array) {
    ?>
<?php if (user_count_online() == 1) {
    echo "<i><b>Total of "; echo user_count_online(); echo " player are currently playing at our server.</b></i><br>";
}
else {
    echo "<i><b>Total of "; echo user_count_online(); echo " players are currently playing at our server.</b></i><br>";
}
?>  
    <table id="onlinelistTable" class="table table-striped table-hover">
        <tr class="yellow">
            <th>Name:</th>
            <th>Level:</th>
            <th>Vocation:</th>
        </tr>
            <?php
            foreach ($array as $value) {
            echo '<tr>';
            echo '<td><a href="characterprofile.php?name='. $value['name'] .'">'. $value['name'] .'</a></td>';
            echo '<td>'. $value['level'] .'</td>';
            echo '<td>'. vocation_id_to_name($value['vocation']) .'</td>';
            echo '</tr>';
            }
            ?>
    </table>

    <?php
} else {
    echo '<i><b>Currently Fixing... Bug says 0 players online but it IS ONLINE!.</i></b>';
}
?>
<?php include 'layout/overall/footer.php'; ?>
 
Can't get it working ;/ could it possibly have to do with the server? When I log-in it does not show 1 player online in the server window ~an example is in the picture,
Also I can say !online in the server and it shows players online, Really trying to figure this problem out!
 
Can't get it working ;/ could it possibly have to do with the server? When I log-in it does not show 1 player online in the server window ~an example is in the picture,
Also I can say !online in the server and it shows players online, Really trying to figure this problem out!
ZnoteAAC does not support Avesta. I have no idea how much would have to be changed to make it fully compatible.
You can try this: http://otland.net/threads/znote-aac-converted-to-7-6-servers.217823/#post-2092429

If you really want to use the official ZnoteAAC you can change the function to count online players (you will lose support for TFS_02 and TFS_03).
Open engine/function/users.php and find:
PHP:
function user_count_online() {
    if (config('TFSVersion') == 'TFS_10') {
        $online = mysql_select_single("SELECT COUNT(`player_id`) AS `value` FROM `players_online`;");
        return ($online !== false) ? $online['value'] : 0;
    } else {
        $data = mysql_select_single("SELECT COUNT(`id`) AS `count` from `players` WHERE `online` = 1;");
        return ($data !== false) ? $data['count'] : 0;
    }
}
Replace with:
PHP:
function user_count_online() {
    if (config('TFSVersion') == 'TFS_10') {
        $online = mysql_select_single("SELECT COUNT(`player_id`) AS `value` FROM `players_online`;");
        return ($online !== false) ? $online['value'] : 0;
    } else {
        $data = mysql_select_single("SELECT COUNT(`id`) AS `count` from `players` WHERE `status` = 1;");
        return ($data !== false) ? $data['count'] : 0;
    }
}
 
Back
Top