• 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 hide chars hides- onlinelist

gmstrikker

Well-Known Member
Joined
Jul 30, 2014
Messages
458
Solutions
1
Reaction score
50
Wanted a way to when a player was online only appears the name on it in the online page list
if he did not have to HIDE, players who had to HIDE would appear PLAYER HIDE
I played a server called mastercores and was so loved that

Slt3dy1.png


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

<h1>Who is online?</h1>
<?php
$array = online_list();
if ($array) {
   ?>

   <table id="onlinelistTable" class="table table-striped table-hover">
     <tr class="yellow">
       <th>Name:</th>
       <th>Guild:</th>
       <th>Level:</th>
       <th>Vocation:</th>
     </tr>
       <?php
       foreach ($array as $value) {
       $url = url("characterprofile.php?name=". $value['name']);
       echo '<tr class="special" onclick="javascript:window.location.href=\'' . $url . '\'">';
       echo '<td><a href="characterprofile.php?name='. $value['name'] .'">'. $value['name'] .'</a></td>';
       if (!empty($value['gname'])) echo '<td><a href="guilds.php?name='. $value['gname'] .'">'. $value['gname'] .'</a></td>'; else echo '<td></td>';
       echo '<td>'. $value['level'] .'</td>';
       echo '<td>'. vocation_id_to_name($value['vocation']) .'</td>';
       echo '</tr>';
       }
       ?>
   </table>

   <?php
} else {
   echo 'Nobody is online.';
}
?>
<?php include 'layout/overall/footer.php'; ?>

myaccount.php
Where do I change to hide or non-hide:
Code:
      // Hide character
       case 'toggle_hide':
         $hide = (user_character_hide($char_name) == 1 ? 0 : 1);
         if (user_character_account_id($char_name) === $session_user_id) {
           user_character_set_hide(user_character_id($char_name), $hide);
         }
         break;
       // end
myaccount.php (full script)
http://pastebin.com/uW6fZCTP
 
Or is here?
open engine/function/general.php search for
Code:
// Returns a list of players online
function online_list() {
   if (config('TFSVersion') == 'TFS_10') return mysql_select_multi("SELECT `o`.`player_id` AS `id`, `p`.`name` as `name`, `p`.`level` as `level`, `p`.`vocation` as `vocation`, `g`.`name` as `gname` FROM `players_online` as `o` INNER JOIN `players` as `p` ON `o`.`player_id` = `p`.`id` LEFT JOIN `guild_membership` gm ON `o`.`player_id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id`");
   else return mysql_select_multi("SELECT `p`.`name` as `name`, `p`.`level` as `level`, `p`.`vocation` as `vocation`, `g`.`name` as `gname` FROM `players` p LEFT JOIN `guild_ranks` gr ON `gr`.`id` = `p`.`rank_id` LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id` WHERE `p`.`online` = '1' ORDER BY `p`.`name` DESC;");
}
????
 
Back
Top