Exemplo n.º 1
0
    $temp_condition .= $mmrpg_database_players_filter;
}
// Collect the database players and fields
$player_fields = rpg_player::get_index_fields(true);
$db->query("SET @player_row_number = 0;");
$mmrpg_database_players = $db->get_array_list("SELECT {$player_fields} FROM mmrpg_index_players WHERE player_flag_published = 1 AND (player_flag_hidden = 0 OR player_token = '{$this_current_token}') {$temp_condition} ORDER BY player_flag_hidden ASC, player_order ASC;", 'player_token');
$mmrpg_database_players_count = $db->get_value("SELECT COUNT(player_id) AS player_count FROM mmrpg_index_players WHERE player_flag_published = 1 AND player_flag_hidden = 0 {$temp_condition_unfiltered};", 'player_count');
$mmrpg_database_players_numbers = $db->get_array_list("SELECT player_token, (@player_row_number:=@player_row_number + 1) AS player_key FROM mmrpg_index_players WHERE player_flag_published = 1 {$temp_condition_unfiltered} ORDER BY player_flag_hidden ASC, player_order ASC;", 'player_token');
// Remove unallowed players from the database
foreach ($mmrpg_database_players as $temp_token => $temp_info) {
    // Define first player token if not set
    if (!isset($first_player_token)) {
        $first_player_token = $temp_token;
    }
    // Send this data through the player index parser
    $temp_info = rpg_player::parse_index_info($temp_info);
    // Collect this player's key in the index
    $temp_info['player_key'] = $mmrpg_database_players_numbers[$temp_token]['player_key'];
    // Ensure this player's image exists, else default to the placeholder
    $mmrpg_database_players[$temp_token]['player_image'] = $temp_token;
    // Update the main database array with the changes
    $mmrpg_database_players[$temp_token] = $temp_info;
}
// Loop through the database and generate the links for these players
$key_counter = 0;
$mmrpg_database_players_links = '';
$mmrpg_database_players_links .= '<div class="float link group" data-game="MM00">';
$mmrpg_database_players_links_counter = 0;
$mmrpg_database_players_count_complete = 0;
// Loop through the results and generate the links for these players
foreach ($mmrpg_database_players as $player_key => $player_info) {
Exemplo n.º 2
0
                                 elseif ($active && $sort_direction == 'desc'){ echo ' <sup>&#8593;</sup>'; }
                             echo '</th>'.PHP_EOL;
                         } else {
                             echo '<th class="'.$class.'">&nbsp;</th>'.PHP_EOL;
                         }
                     }
                     ?>
                 </tr>
             </thead>
             <tbody>
                 <?
                 // Loop through collected players and list their details
                 if (!empty($player_index)){
                     foreach ($player_index AS $player_id => $player_info){
                         // Parse the player info before displaying it
                         $player_info = rpg_player::parse_index_info($player_info);
                         // Collect the display fields from the array
                         $player_token = $player_info['player_token'];
                         $player_name = $player_info['player_name'];
                         $player_group = '<span class="token">'.$player_info['player_group'].'</span>';
                         $player_type1 = !empty($player_info['player_type']) && !empty($type_index[$player_info['player_type']]) ? $type_index[$player_info['player_type']] : $type_index['none'];
                         $type_string = '<span class="type '.$player_type1['type_token'].'">'.$player_type1['type_name'].'</span>';
                         $edit_link = 'admin/players/'.$player_id.'/';
                         $view_link = 'database/players/'.$player_token.'/';
                         $complete = $player_info['player_flag_complete'] ? true : false;
                         $published = $player_info['player_flag_published'] ? true : false;
                         $hidden = $player_info['player_flag_hidden'] ? true : false;
                         // Print out the player info as a table row
                         ?>
                         <tr class="object<?php 
 echo !$published ? ' unpublished' : '';