Example #1
0
$db_category_fields = rpg_website::get_category_fields(true, 'categories');
$db_thread_fields = rpg_website::get_thread_fields(true, 'threads');
$db_post_fields = rpg_website::get_post_fields(true, 'posts');
$db_role_fields = rpg_user_role::get_fields(true, 'roles');
$db_user_fields = rpg_user::get_fields(true, 'users');
/*
 * COLLECT FORMACTIONS
 */
// Collect this player's battle point total
if (empty($_SESSION[rpg_game::session_token()]['DEMO'])) {
    $community_battle_points = rpg_game::battle_points();
} else {
    $community_battle_points = 0;
}
// Collect all the categories from the index
$this_categories_index = rpg_website::community_index();
$this_categories_index_tokens = array();
foreach ($this_categories_index as $token => $info) {
    $this_categories_index_tokens[$info['category_id']] = $token;
}
// Include the community form actions
require_once 'pages/community_actions.php';
/*
 * COLLECT INDEXES
 */
// Define the view based on available data
$this_current_view = 'index';
if (!empty($this_current_cat)) {
    $this_current_view = 'category';
}
if ($this_current_id !== false && !empty($this_current_token)) {
        ?>
); "><?php 
        echo $temp_avatar_title;
        ?>
</div>
              <a class="back">&#9668;</a>
              <a class="next">&#9658;</a>
            </div>
            <textarea class="textarea" name="post_body" rows="10"><?php 
        echo $temp_post_body;
        ?>
</textarea>
          </div>
          <div class="field field_post_info" style="clear: left; overflow: hidden; font-size: 11px;">
            <?php 
        echo rpg_website::formatting_help();
        ?>
          </div>
          <?php 
        // Define the current maxlength based on board points
        $temp_maxlength = MMRPG_SETTINGS_DISCUSSION_MAXLENGTH;
        if (!empty($this_boardinfo['board_points']) && ceil($this_boardinfo['board_points'] / 1000) > MMRPG_SETTINGS_DISCUSSION_MAXLENGTH) {
            $temp_maxlength = ceil($this_boardinfo['board_points'] / 1000);
        }
        ?>
          <div class="buttons buttons_active" data-submit="<?php 
        echo !empty($_REQUEST['post_id']) ? 'Edit' : 'Post';
        ?>
 Comment">
            <label class="counter"><span class="current">0</span> / <span class="maximum"><?php 
        echo $temp_maxlength;
$this_seo_title = $this_category_info['category_name'].' | '.$this_seo_title;
$this_seo_description = strip_tags($this_category_info['category_description']);

// Define the Open Graph variables for this page
$this_graph_data['title'] = 'Community Forums | '.$this_category_info['category_name'];
$this_graph_data['description'] = strip_tags($this_category_info['category_description']);
//$this_graph_data['image'] = MMRPG_CONFIG_ROOTURL.'images/assets/mmrpg-prototype-logo.png';
//$this_graph_data['type'] = 'website';

// Update the MARKUP variables for this page
//$this_markup_header = $this_thread_info['thread_name']; //.' | '.$this_markup_header;

// Require the leaderboard data file
require_once('includes/leaderboard.php');
// Collect all the active sessions for this page
$temp_viewing_category = rpg_website::sessions_active('community/'.$this_category_info['category_token'].'/', 3, true);
$temp_viewing_userids = array();
foreach ($temp_viewing_category AS $session){ $temp_viewing_userids[] = $session['user_id']; }

// Create a chat name for them that's valid for the room
$user_chat_name = !empty($this_userinfo['user_name_public']) ? $this_userinfo['user_name_public'] : $this_userinfo['user_name'];
$user_chat_name = preg_replace('/([^-_a-z0-9]+)/i', '', $user_chat_name);

?>
<h2 class="subheader thread_name field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>">
  <a class="link" style="display: inline;" href="<?= str_replace($this_category_info['category_token'].'/', '', $_GET['this_current_url']) ?>">Community</a> <span class="pipe">&nbsp;&raquo;&nbsp;</span>
  <a class="link" style="display: inline;" href="<?= $_GET['this_current_url'] ?>"><?= $this_category_info['category_name'] ?></a>
</h2>
<div class="subbody">
  <div class="float float_right"><div class="sprite sprite_80x80 sprite_80x80_0<?= mt_rand(0, 2) ?>" style="background-image: url(images/sprites/robots/<?= MMRPG_SETTINGS_CURRENT_FIELDMECHA ?>/sprite_left_80x80.png);">Met</div></div>
  <p class="text"><?= $this_category_info['category_description'] ?></p>
Example #4
0
      $this_menu_tooltips['abilities'] = '&laquo; Ability Viewer &raquo; &lt;br /&gt;...';
      $this_menu_tooltips['items'] = '&laquo; Item Inventory &raquo; &lt;br /&gt;...';
      $this_menu_tooltips['shop'] = '&laquo; Item Shop &raquo; &lt;br /&gt;Trade in your extra inventory for zenny in the shop and then put your earnings towards new items, new abilities, and new battle fields.';
      $temp_prototype_complete = rpg_prototype::campaign_complete();
      $temp_data_index = 0;
      ?>

    <div class="points field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>">
      <a class="wrapper link link_leaderboard" data-step="leaderboard" data-index="99" data-source="frames/leaderboard.php" data-music="misc/leader-board" data-tooltip="<?= $this_menu_tooltips['leaderboard'] ?>" data-tooltip-type="field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>">
        <label class="label">Battle Points</label>
        <span class="amount">
          <?php /*= preg_replace('#^([0]+)([0-9]+)$#', '<span class="padding">$1</span><span class="value">$2</span>', str_pad((!empty($_SESSION['GAME']['counters']['battle_points']) ? $_SESSION['GAME']['counters']['battle_points'] : 0), 13, '0', STR_PAD_LEFT)) */ ?>
          <?= number_format($_SESSION['GAME']['counters']['battle_points'], 0, '.', ',') ?>
          <?php if(rpg_game::is_user() && !empty($this_boardinfo['board_rank'])): ?>
            <span class="pipe">|</span>
            <span class="place"><?= rpg_website::number_suffix($this_boardinfo['board_rank']) ?></span>
          <?php endif; ?>
        </span>
      </a>
    </div>
    <div class="zenny field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>">
      <div class="wrapper">
        <span class="amount">
          <?= number_format($_SESSION['GAME']['counters']['battle_zenny'], 0, '.', ',') ?> z
        </span>
      </div>
    </div>

    <div class="options options_userinfo field_type field_type_<?= MMRPG_SETTINGS_CURRENT_FIELDTYPE ?>">

      <?php
Example #5
0
         if (empty($this_fields_index[$omega_info['field']])) {
             continue;
         }
         $robot_info = $mmrpg_database_robots[$omega_info['robot']];
         $field_info = $this_fields_index[$omega_info['field']];
         $html_background_options[] = '<option value="fields/' . $field_info['field_token'] . '">' . $field_info['field_name'] . (!empty($field_info['field_type']) ? ' (' . ucfirst($field_info['field_type']) . ' Type)' : '') . '</option>';
     }
 }
 $html_background_options[] = '</optgroup>';
 $temp_select_options = str_replace('value="' . $_SESSION['GAME']['USER']['backgroundpath'] . '"', 'value="' . $_SESSION['GAME']['USER']['backgroundpath'] . '" selected="selected"', implode('', $html_background_options));
 $html_form_fields .= '<select class="select select_backgroundpath" style="width: 100%; " name="backgroundpath">' . $temp_select_options . '</select>';
 $html_form_fields .= '</div>';
 $html_form_fields .= '<div class="field">';
 $html_form_fields .= '<label class="label label_profiletext" style="width: 230px; ">Leaderboard Profile :</label>';
 $html_form_fields .= '<textarea class="textarea textarea_profiletext" style="width: 98%; height: 250px; " name="profiletext">' . htmlentities(trim(!empty($_SESSION['GAME']['USER']['profiletext']) ? $_SESSION['GAME']['USER']['profiletext'] : ''), ENT_QUOTES, 'UTF-8', true) . '</textarea>';
 $html_form_fields .= rpg_website::formatting_help();
 $html_form_fields .= '</div>';
 // Update the form markup buttons
 $html_form_buttons .= '<input class="button button_submit" type="submit" value="Save Changes" />';
 //$html_form_buttons .= '<input class="button button_reset" type="button" value="Reset Game" onclick="javascript:parent.window.mmrpg_trigger_reset();" />';
 //$html_form_buttons .= '<input class="button button_cancel" type="button" value="Cancel" onclick="javascript:parent.window.location.href=\'prototype.php\';" />';
 // If the file has been updated, update the data
 if ($file_has_updated) {
     // Update the form messages markup text
     $html_form_messages .= '<span class="success">(!) Thank you.  Your profile changes have been saved.<br />Save Date : ' . date('Y/m/d @ H:i:s') . '.</span>';
     // Clear the form fields markup
     //$html_form_fields = '<script type="text/javascript"> setTimeout(function(){ window.location.href=\''.MMRPG_CONFIG_ROOTURL.'\'; }, 1000); </script>';
     // Update the form markup buttons
     //$html_form_buttons = '<input class="button button_continue" type="button" value="Continue" onclick="javascript:window.location.href=\''.MMRPG_CONFIG_ROOTURL.'\';" />';
     // Save the messages to the session and refresh
     $_SESSION['mmrpg_form_messages'] = $html_form_messages;
 /**
  * Translate a result array into a HTML table
  *
  * @author      Aidan Lister <*****@*****.**>
  * @version     1.3.2
  * @link        http://aidanlister.com/2004/04/converting-arrays-to-human-readable-tables/
  * @param       array  $array      The result (numericaly keyed, associative inner) array.
  * @param       bool   $recursive  Recursively generate tables for multi-dimensional arrays
  * @param       string $null       String to output for blank cells
  */
 public static function array_to_table($array, $recursive = false, $null = '&nbsp;')
 {
     // Sanity check
     if (empty($array) || !is_array($array)) {
         return false;
     }
     if (!isset($array[0]) || !is_array($array[0])) {
         $array = array($array);
     }
     // Start the table
     $table = "<table>\n";
     // The header
     $table .= "\t<tr>";
     // Take the keys from the first row as the headings
     foreach (array_keys($array[0]) as $heading) {
         $table .= '<th>' . $heading . '</th>';
     }
     $table .= "</tr>\n";
     // The body
     foreach ($array as $row) {
         $table .= "\t<tr>";
         foreach ($row as $cell) {
             $table .= '<td>';
             // Cast objects
             if (is_object($cell)) {
                 $cell = (array) $cell;
             }
             if ($recursive === true && is_array($cell) && !empty($cell)) {
                 // Recursive mode
                 $table .= "\n" . rpg_website::array_to_table($cell, true, true) . "\n";
             } else {
                 $table .= strlen($cell) > 0 ? htmlspecialchars((string) $cell) : $null;
             }
             $table .= '</td>';
         }
         $table .= "</tr>\n";
     }
     $table .= '</table>';
     return $table;
 }
  <div style="overflow: hidden; margin-bottom: 25px;">
  <?php 
    // Define the current date group
    $this_date_group = '';
    // Define the temporary timeout variables
    $this_time = time();
    $this_online_timeout = MMRPG_SETTINGS_ONLINE_TIMEOUT;
    // Loop through the thread array and display its contents
    if (!empty($this_threads_array)) {
        foreach ($this_threads_array as $this_thread_key => $this_thread_info) {
            // If this thread is over the display limit, break from the loop
            if ($this_thread_key >= MMRPG_SETTINGS_THREADS_RECENT) {
                break;
            }
            // Collect markup for this thread from the function
            $temp_markup = rpg_website::community_thread_linkblock($this_thread_info, $this_category_info, 'compact');
            echo $temp_markup . "\n";
        }
    }
    // Close the container tag
    ?>
  </div>
  <?php 
    if (false) {
        ?>
    <div class="subbody" style="margin-bottom: 6px; background-color: transparent; padding-right: 0;">
      <?/*<div class="float float_right"><div class="sprite sprite_80x80 sprite_80x80_0<?php 
        echo mt_rand(0, 2);
        ?>
" style="background-image: url(images/sprites/robots/<?php 
        echo MMRPG_SETTINGS_CURRENT_FIELDMECHA;
 function edit_robot_update_loop_one(&$mmrpg_database_robots, &$temp_battle_rewards, &$temp_battle_settings, &$temp_player_array, &$temp_total_overflow_value, $temp_player_colours, $temp_stat_tokens, $temp_player_token, $temp_player_info, $temp_robot_token, $temp_robot_info, $temp_phase_loop)
 {
     // Collect the robot index, rewards, and settings
     $temp_robot_index = !empty($mmrpg_database_robots[$temp_robot_token]) ? $mmrpg_database_robots[$temp_robot_token] : $temp_robot_info;
     $temp_robot_rewards = !empty($temp_battle_rewards[$temp_player_token]['player_robots'][$temp_robot_token]) ? $temp_battle_rewards[$temp_player_token]['player_robots'][$temp_robot_token] : array();
     $temp_robot_settings = !empty($temp_battle_settings[$temp_player_token]['player_robots'][$temp_robot_token]) ? $temp_battle_settings[$temp_player_token]['player_robots'][$temp_robot_token] : array();
     // Collect the robot's level and experience
     $temp_robot_info['robot_level'] = !empty($temp_robot_rewards['robot_level']) ? $temp_robot_rewards['robot_level'] : 1;
     $temp_robot_info['robot_experience'] = !empty($temp_robot_rewards['robot_experience']) ? $temp_robot_rewards['robot_experience'] : 0;
     // Collect the original play and prepare the transfer abilities to them
     $temp_robot_info['original_player'] = !empty($temp_battle_settings[$temp_player_token]['player_robots'][$temp_robot_token]['original_player']) ? $temp_battle_settings[$temp_player_token]['player_robots'][$temp_robot_token]['original_player'] : $temp_player_token;
     // Check the robots's stats and collect any overflow from the max
     $temp_stat_overflow = 0;
     $temp_stat_total = 0;
     $temp_stat_values = array();
     foreach ($temp_stat_tokens as $stat_token) {
         // Collect the stats for this level
         $temp_stat_values[$stat_token]['base'] = MMRPG_SETTINGS_STATS_GET_ROBOTMIN($temp_robot_index['robot_' . $stat_token], $temp_robot_info['robot_level']);
         $temp_stat_values[$stat_token]['reward'] = !empty($temp_robot_rewards['robot_' . $stat_token]) ? $temp_robot_rewards['robot_' . $stat_token] : 0;
         $temp_stat_values[$stat_token]['total'] = $temp_stat_values[$stat_token]['base'] + $temp_stat_values[$stat_token]['reward'];
         $temp_stat_values[$stat_token]['max'] = MMRPG_SETTINGS_STATS_GET_ROBOTMAX($temp_robot_index['robot_' . $stat_token], $temp_robot_info['robot_level']);
         $temp_stat_values[$stat_token]['overflow'] = $temp_stat_values[$stat_token]['total'] > $temp_stat_values[$stat_token]['max'] ? $temp_stat_values[$stat_token]['total'] - $temp_stat_values[$stat_token]['max'] : 0;
         $temp_stat_overflow += $temp_stat_values[$stat_token]['overflow'];
         $temp_stat_total += $temp_stat_values[$stat_token]['total'];
     }
     // Update the array with collected stat values
     $temp_robot_info['robot_stats'] = $temp_stat_values;
     $temp_robot_info['robot_stats_overflow'] = $temp_stat_overflow;
     $temp_robot_info['robot_stats_total'] = $temp_stat_total;
     // Print out the robot array for debug purposes
     if (EDIT_ROBOT_UPDATES_DEBUG) {
         echo '<div class="robot_block">';
         echo '<strong class="robot_title">' . $temp_robot_token . ' (phase-' . $temp_phase_loop . ') (' . $temp_player_token . ') ' . ($temp_player_token != $temp_robot_info['original_player'] ? '[via-' . $temp_robot_info['original_player'] . ']' : '') . '</strong>';
         echo rpg_website::array_to_table(array('robot_level' => $temp_robot_info['robot_level']), true);
         echo rpg_website::array_to_table(array('robot_stats' => $temp_robot_info['robot_stats']), true);
         echo rpg_website::array_to_table(array('robot_stats_total' => $temp_robot_info['robot_stats_total']), true);
         echo rpg_website::array_to_table(array('robot_stats_overflow' => $temp_robot_info['robot_stats_overflow']), true);
         echo '</div>';
     }
     // Update the parent array with these collected details
     $temp_player_array[$temp_player_token]['player_robots'][$temp_robot_token] = $temp_robot_info;
     $temp_total_overflow_value += $temp_robot_info['robot_stats_overflow'];
 }
                 <p class="text" style="margin-top: -4px;">
                     <?php 
         echo $temp_post_show != 'all' && $temp_post_show < $this_posts_count ? 'Showing ' . $temp_post_show . ' ' . ($temp_post_sort == 'desc' ? 'Newest' : 'Oldest') . ' Posts' : 'Showing All Posts';
         ?>
                 </p>
             <?php 
     }
     ?>
             <?php 
     // Collect markup for this post from the function
     foreach ($this_posts_array as $this_post_key => $this_post_info) {
         if (!isset($this_threads_index[$this_post_info['thread_id']])) {
             continue;
         }
         $this_thread_info = $this_threads_index[$this_post_info['thread_id']];
         $temp_markup = rpg_website::community_postblock($this_thread_info, $this_post_info, $this_category_info);
         echo $temp_markup . "\n";
         if ($temp_post_show != 'all' && $this_post_key + 1 >= $temp_post_show) {
             break;
         }
     }
     ?>
         </div>
         <?php 
 } else {
     ?>
         <div class="subbody posts_body post_right event event_triple event_visible" style="margin-top: -6px;">
             <p class="text">- there are no posts to display -</p>
             <p class="text" style="text-align: right;"><a class="postscroll" href="#top" style="right: 12px;">^ Top</a></p>
         </div>
         <?php 
echo MMRPG_SETTINGS_CURRENT_FIELDTYPE;
?>
">Leaderboard Players Index</h2>
<div class="subbody">
  <p class="text">The <strong>Mega Man RPG World</strong> currently has <?php 
echo !empty($this_leaderboard_count) ? $this_leaderboard_count == 1 ? '1 player' : $this_leaderboard_count . ' players' : 0;
?>
 and that number is growing all the time.  Throughout the course of the game, players collect Battle Points on completion of missions and those points build up to unlock new abilities and other new content.  Not all players are created equal, however, and some clearly stand above the rest in terms of their commitment to the game and their skill at exploiting the battle system's mechanics.  In the spirit of competition, all players have been ranked by their total Battle Point scores and listed from highest to lowest.  Use the numbered links at the top and bottom of the page to navigate and <a href="contact/">contact me</a> if you have any questions or concerns.</p>
</div>
<?php 
// Print out any online players if they exist
if (!empty($this_leaderboard_online_players)) {
    ?>
  <div class="subbody online_players">
    <div class="text event players"><?php 
    echo rpg_website::print_online($this_leaderboard_online_players);
    ?>
</div>
    <strong class="text label"><?php 
    echo (count($this_leaderboard_online_players) == 1 ? '1 Player' : count($this_leaderboard_online_players) . ' Players') . ' Online';
    ?>
</strong>
  </div>
  <?php 
}
?>

<div class="leaderboard">
  <div class="wrapper">
  <?php 
// Print out the generated leaderboard markup
Example #11
0
function mmrpg_leaderboard_parse_index($board_key, $board_info, $quick_parse = false)
{
    global $mmrpg_index;
    global $this_cache_stamp, $this_cache_filename, $this_cache_filedir;
    global $this_leaderboard_count, $this_leaderboard_online_count;
    global $this_leaderboard_online_players, $this_leaderboard_online_pages;
    global $this_leaderboard_index;
    global $this_userid, $this_userinfo, $this_boardinfo;
    global $this_display_limit, $this_display_limit_default, $this_num_offset;
    global $this_time, $this_online_timeout, $place_counter, $points_counter, $this_start_key;
    // Collect this player's base info
    $this_stars = !empty($board_info['board_stars']) ? $board_info['board_stars'] : 0;
    $this_abilities = !empty($board_info['board_abilities']) ? $board_info['board_abilities'] : 0;
    //$this_battles = !empty($board_info['board_battles']) ? $board_info['board_battles'] : 0;
    $this_missions = !empty($board_info['board_missions']) ? $board_info['board_missions'] : 0;
    $this_awards = !empty($board_info['board_awards']) ? explode(',', $board_info['board_awards']) : array();
    $this_first_save = !empty($board_info['board_date_created']) ? $board_info['board_date_created'] : 0;
    $this_last_save = !empty($board_info['board_date_modified']) ? $board_info['board_date_modified'] : 0;
    $this_last_access = !empty($board_info['user_date_accessed']) ? $board_info['user_date_accessed'] : 0;
    $this_is_online = !empty($this_last_access) && $this_time - $this_last_access <= $this_online_timeout ? true : false;
    $this_last_save = !empty($this_last_save) ? date('Y/m/d @ H:i', $this_last_save) : '????-??-?? ??:??';
    $this_style = $this_is_online ? 'border-color: green; ' : '';
    $this_place = rpg_website::number_suffix($place_counter, true, true);
    //str_pad(($place_counter), 2, '0', STR_PAD_LEFT);
    $this_username = !empty($board_info['user_name_public']) ? $board_info['user_name_public'] : $board_info['user_name'];
    $this_username = htmlentities($this_username, ENT_QUOTES, 'UTF-8', true);
    $this_user_id = !empty($board_info['user_id']) ? $board_info['user_id'] : 0;
    if ($this_userid != MMRPG_SETTINGS_GUEST_ID && $this_user_id == $_SESSION['GAME']['USER']['userid']) {
        $this_boardinfo['board_rank'] = $place_counter;
        $_SESSION['GAME']['BOARD']['boardrank'] = $this_boardinfo['board_rank'];
    }
    //die('<pre>'.print_r($this_battles, true).'</pre>');
    // Define the current page this player is on
    $this_current_page_number = ceil($board_key / $this_display_limit_default);
    //echo('$board_key = '.$board_key.'; $this_display_limit_default = '.$this_display_limit_default.'; $this_current_page_number = '.$this_current_page_number);
    // If online, add this player to the array
    if ($this_is_online) {
        $this_leaderboard_online_count++;
        $this_leaderboard_online_players[] = array('id' => $this_user_id, 'name' => $this_username, 'token' => $board_info['user_name_clean'], 'place' => $this_place, 'placeint' => $place_counter, 'colour' => $board_info['user_colour_token'], 'image' => $board_info['user_image_path']);
        //$this_current_page_number = ceil($board_key / $this_display_limit);
        //echo('$board_key = '.$board_key.'; $this_display_limit = '.$this_display_limit.'; $this_current_page_number = '.$this_current_page_number);
        //$this_leaderboard_online_pages[] = $board_key;
        if (!in_array($this_current_page_number, $this_leaderboard_online_pages)) {
            $this_leaderboard_online_pages[] = $this_current_page_number;
        }
    }
    // If quick parse was requested, return now
    if ($quick_parse) {
        return '';
    }
    // Collect the points and increment the counter if necessary
    $this_points = $board_info['board_points'];
    if ($this_points != $points_counter) {
        $points_counter = $this_points;
    }
    // Define the awards strong and default to empty
    $this_user_awards = ' ';
    // Break apart the battle and battle values into arrays
    $temp_battles = !empty($board_info['board_battles']) ? explode(',', $board_info['board_battles']) : array();
    $board_info['board_battles'] = $temp_battles;
    // Loop through the available players
    $mmrpg_index_players = rpg_player::get_index();
    foreach ($mmrpg_index_players as $ptoken => $pinfo) {
        $ptoken2 = str_replace('-', '_', $ptoken);
        $temp_battles = !empty($board_info['board_battles_' . $ptoken2]) ? explode(',', $board_info['board_battles_' . $ptoken2]) : array();
        $board_info['board_battles_' . $ptoken2] = $temp_battles;
    }
    // Break apart the robot and battle values into arrays
    $temp_robots = !empty($board_info['board_robots']) ? $board_info['board_robots'] : array();
    if (!empty($temp_robots)) {
        $temp_robots = explode(',', $temp_robots);
        foreach ($temp_robots as $key => $string) {
            list($token, $level) = explode(':', substr($string, 1, -1));
            $temp_info = array('robot_token' => $token, 'robot_level' => $level);
            $temp_robots[$key] = $temp_info;
        }
    }
    $this_robots = $temp_robots;
    // Start the output buffer
    ob_start();
    // Only continue if markup is special constants have not been defined
    if (!defined('MMRPG_SKIP_MARKUP') || defined('MMRPG_SHOW_MARKUP_' . $this_user_id)) {
        // Only generate markup if we're withing the viewing range
        if ($board_key >= $this_start_key && $board_key < $this_display_limit || defined('MMRPG_SHOW_MARKUP_' . $this_user_id)) {
            $this_robots_count = !empty($this_robots) ? count($this_robots) : 0;
            $this_robots_count = $this_robots_count == 1 ? '1 Robot' : $this_robots_count . ' Robots';
            $this_stars_count = $this_stars;
            $this_abilities_count = $this_abilities;
            $this_missions_count = $this_missions;
            $this_stars_count = $this_stars_count == 1 ? '1 Star' : $this_stars_count . ' Stars';
            $this_abilities_count = $this_abilities_count == 1 ? '1 Ability' : $this_abilities_count . ' Abilities';
            $this_missions_count = $this_missions_count == 1 ? '1 Mission' : $this_missions_count . ' Missions';
            //$this_points_html = preg_replace('#^([0]+)([0-9]+)$#', '<span class="padding">$1</span><span class="value">$2</span>', str_pad((!empty($this_points) ? $this_points : 0), 13, '0', STR_PAD_LEFT)).' BP';
            $this_records_html = '<span class="count">' . $this_missions_count . '</span>';
            $this_records_html .= ' <span class="pipe">|</span> <span class="count">' . $this_robots_count . '</span>';
            $this_records_html .= ' <span class="pipe">|</span> <span class="count">' . $this_abilities_count . '</span>';
            $this_records_html .= ' <span class="pipe">|</span> <span class="count">' . $this_stars_count . '</span>';
            $this_points_html = '<span class="value">' . (!empty($this_points) ? number_format($this_points, 0, '.', ',') : 0) . '</span>' . ' BP';
            $this_points_plain = (!empty($this_points) ? number_format($this_points, 0, '.', ',') : 0) . ' BP';
            $this_details = '' . $this_last_save;
            // -- LEADERBOARD MARKUP -- //
            // Add the prototype complete flags if applicable
            if (count($board_info['board_battles_dr_light']) >= 17) {
                $this_user_awards .= '<span class="prototype_complete prototype_complete_dr-light" data-tooltip="Completed Dr. Light\'s Game" data-tooltip-type="player_type player_type_defense">&hearts;</span>';
            }
            if (count($board_info['board_battles_dr_wily']) >= 17) {
                $this_user_awards .= '<span class="prototype_complete prototype_complete_dr-wily" data-tooltip="Completed Dr. Wily\'s Game" data-tooltip-type="player_type player_type_attack">&clubs;</span>';
            }
            if (count($board_info['board_battles_dr_cossack']) >= 17) {
                $this_user_awards .= '<span class="prototype_complete prototype_complete_dr-cossack" data-tooltip="Completed Dr. Cossack\'s Game" data-tooltip-type="player_type player_type_speed">&diams;</span>';
            }
            if (in_array('ranking_first_place', $this_awards)) {
                $this_user_awards .= '<span class="prototype_complete prototype_complete_firstplace" data-tooltip="Reached First Place" data-tooltip-type="player_type player_type_level">&#9733;</span>';
            }
            //die('$this_awards = '.print_r($this_awards, true));
            // Display the user's save file listing
            //echo '<a data-id="'.$board_info['user_id'].'" data-player="'.$board_info['user_name_clean'].'" class="file file_'.$this_place.'" name="file_'.$key.'" style="'.$this_style.'" title="'.$this_title.'" href="leaderboard/'.$board_info['user_name_clean'].'/">'."\n";
            echo '<a data-id="' . $board_info['user_id'] . '" data-player="' . $board_info['user_name_clean'] . '" class="file file_' . strip_tags($this_place) . '" name="file_' . $key . '" style="' . $this_style . '" href="leaderboard/' . $board_info['user_name_clean'] . '/">' . "\n";
            echo '<div class="inset player_type_' . (!empty($board_info['user_colour_token']) ? $board_info['user_colour_token'] : 'none') . '">' . "\n";
            echo '<span class="place">' . $this_place . '</span>' . "\n";
            echo '<span class="userinfo"><strong class="username">' . $this_username . $this_user_awards . '</strong><span class="details">' . $this_details . '</span></span>' . "\n";
            echo '<span class="points">' . $this_points_html . '</span>' . "\n";
            echo '<span class="records">' . $this_records_html . '</span>' . "\n";
            echo '</div>' . "\n";
            if (!empty($board_info['user_image_path'])) {
                list($avatar_class, $avatar_token, $avatar_size) = explode('/', $board_info['user_image_path']);
            } else {
                $avatar_class = 'robots';
                $avatar_token = 'mega-man';
                $avatar_size = 40;
            }
            if (!empty($board_info['user_background_path'])) {
                list($background_class, $background_token) = explode('/', $board_info['user_background_path']);
            } else {
                $background_class = 'fields';
                $background_token = 'intro-field';
            }
            $avatar_size = $avatar_size * 2;
            $avatar_path = 'images/sprites/' . $avatar_class . '/' . $avatar_token . '/sprite_left_' . $avatar_size . 'x' . $avatar_size . '.png';
            $shadow_path = 'images/shadows/' . $avatar_class . '/' . preg_replace('/^([-a-z0-9]+)(_[a-z]+)?$/i', '$1', $avatar_token) . '/sprite_left_' . $avatar_size . 'x' . $avatar_size . '.png';
            if (!file_exists($shadow_path)) {
                $shadow_path = 'images/shadows/' . $avatar_class . '/' . preg_replace('/^([-a-z0-9]+)(_[a-z0-9]+)?$/i', '$1', $avatar_token) . '/sprite_left_' . $avatar_size . 'x' . $avatar_size . '.png';
            }
            echo '<span class="avatar"><span class="avatar_wrapper">';
            echo '<span class="sprite sprite_shadow sprite_' . $avatar_size . 'x' . $avatar_size . ' sprite_shadow_' . $avatar_size . 'x' . $avatar_size . ' sprite_' . $avatar_size . 'x' . $avatar_size . '_' . ($place_counter > 3 ? 'base' : 'victory') . '" style="background-image: url(' . $shadow_path . '?' . MMRPG_CONFIG_CACHE_DATE . ');">' . $this_username . '</span>';
            echo '<span class="sprite sprite_' . $avatar_size . 'x' . $avatar_size . ' sprite_' . $avatar_size . 'x' . $avatar_size . '_' . ($place_counter > 3 ? 'base' : 'victory') . '" style="background-image: url(' . $avatar_path . '?' . MMRPG_CONFIG_CACHE_DATE . ');">' . $this_username . '</span>';
            echo '</span></span>' . "\n";
            echo '</a>' . "\n";
        }
    }
    // Collect the output into the buffer
    return preg_replace('/\\s+/', ' ', ob_get_clean());
}
Example #12
0
             <a href="<?= MMRPG_CONFIG_ROOTURL ?>database/items/" class="link <?= $this_current_sub == 'items' ? 'link_active field_type_empty' : '' ?>"><span>Items</span></a>
             <a href="<?= MMRPG_CONFIG_ROOTURL ?>database/fields/" class="link <?= $this_current_sub == 'fields' ? 'link_active field_type_empty' : '' ?>"><span>Fields</span></a>
             <a href="<?= MMRPG_CONFIG_ROOTURL ?>database/types/" class="link <?= $this_current_sub == 'types' ? 'link_active field_type_empty' : '' ?>"><span>Types</span></a>
         <? endif; ?>
         <?php
         // Print out the community links if applicable
         if ($this_current_page == 'community'){
             if (!empty($this_categories_index)){
                 foreach ($this_categories_index AS $temp_token => $temp_category){
                     $temp_id = $temp_category['category_id'];
                     if (($temp_id == 0 || $temp_token == 'chat') && $this_userid == MMRPG_SETTINGS_GUEST_ID){ continue; }
                     if (($temp_token == 'personal' || $temp_token == 'chat') && empty($this_userinfo['user_flag_postprivate'])){ continue; }
                     $temp_link = MMRPG_CONFIG_ROOTURL.'community/'.$temp_category['category_token'].'/';
                     $temp_active = $this_current_cat == $temp_category['category_token'] ? true : false;
                     $temp_count = !empty($temp_new_threads_categories[$temp_id]) ? $temp_new_threads_categories[$temp_id] : 0;
                     $temp_viewing = $temp_token != 'personal' ? rpg_website::sessions_active('community/'.$temp_category['category_token'].'/', 3, true) : array();
                     $temp_viewing = !empty($temp_viewing) ? count($temp_viewing) : 0;
                     //die('<pre>$temp_id('.$temp_id.'); $temp_count('.$temp_count.'); $temp_new_threads_categories = '.print_r($temp_new_threads_categories, true).'</pre>');
                     echo '<a href="'.$temp_link.'" class="link '.($temp_active ? 'link_active field_type_empty' : '').'">';
                     echo '<span>'.ucfirst($temp_token).'</span>';
                     if ($temp_count > 0){ echo  '<sup class="sup field_type field_type_electric" title="'.($temp_count == 1 ? '1 Updated Thread' : $temp_count.' Updated Threads').'">'.$temp_count.'</sup>'; }
                     if ($temp_viewing > 0){ echo  '<sup class="sup field_type field_type_nature" title="'.($temp_viewing == 1 ? '1 Player ' : $temp_viewing.' Players ').($temp_token == 'search' ? 'Searching' : 'Browsing').'" style="'.($temp_count > 0 ? 'margin-left: -3px;' : '').'">'.$temp_viewing.'</sup>'; }
                     echo '</a>';
                 }
             }
         }
         ?>
     </div>
     <? endif; ?>
 <?php else: ?>
     &hellip;&gt;_&lt;&hellip;
                  <span class="options">[ <a class="edit" rel="noindex,nofollow" href="<?php 
                        echo $_GET['this_current_url'] . 'action=edit&amp;post_id=' . $this_post_info['post_id'] . '#comment-form';
                        ?>
">edit</a> | <a class="delete" rel="noindex,nofollow" href="<?php 
                        echo $_GET['this_current_url'];
                        ?>
" data-href="<?php 
                        echo $_GET['this_current_url'] . 'action=delete&amp;post_id=' . $this_post_info['post_id'] . '#comment-form';
                        ?>
">delete</a> ]</span>
                <?php 
                    }
                    ?>
              </div>
              <div class="bodytext"><?php 
                    echo rpg_website::formatting_decode($temp_post_body);
                    ?>
</div>
            </div>
            <?php 
                    if ($this_userid != MMRPG_SETTINGS_GUEST_ID && empty($this_thread_info['thread_locked']) && $community_battle_points > 5000) {
                        ?>
              <a class="postreply" rel="nofollow" href="<?php 
                        echo 'community/' . $this_category_info['category_token'] . '/' . $this_thread_info['thread_id'] . '/' . $this_thread_info['thread_token'] . '/#comment-form:' . $temp_reply_name . ':' . $temp_reply_colour;
                        ?>
" style="right: 46px;">@ Reply</a>
            <?php 
                    }
                    ?>
            <a class="postscroll" href="#top" style="right: 12px;">^ Top</a>
          <?php 
</a><?php 
    }
    ?>
      </div>
      <div><span><?php 
    echo $temp_userinfo['role_name'];
    ?>
</span> <span class="pipe">|</span> <span><?php 
    echo date('F Y', $temp_userinfo['user_date_created']);
    ?>
</span> <span class="pipe">|</span> <em><?php 
    echo $temp_displayline;
    ?>
</em></div>
      <?php 
    echo rpg_website::formatting_decode($temp_displaytext);
    ?>
    </div>
  </div>
  <?php 
}
?>
<div class="subbody" style="margin-bottom: 2px; ">
  <p class="text">
    <a href="http://www.youtube.com/user/TheLegendOfRenegade/" target="_blank"><strong>TheLegendOfRenegade</strong></a> <span class="pipe">|</span> <span>Contributor</span> <span class="pipe">|</span> <em>Mega Man 1, 2, 7, and R&amp;F Sega Genesis Remixes</em><br />
    YouTube user TheLegendOfRenegade is responsible for any and all music and sound effects in the prototype and graciously agreed to let us use his work in July 2013.  All tracks come from his massive, multiple-game-spanning Sega Genesis / MD Remix project and they are really, really incredible.  All field music thus far has come from his <a href="http://www.youtube.com/playlist?list=PL0jbwTITrHXaBy3etRm-nmkx-f-QaPOwQ" target="_blank">Mega Man 1 &amp; 2</a> collection with various menu and special battle themes coming from the <a href="http://www.youtube.com/playlist?list=PL0jbwTITrHXZfMogt7ll1ThTlpND_5KZH" target="_blank">Rockman &amp; Forte</a> and <a href="http://www.youtube.com/playlist?list=PL0jbwTITrHXbA31nYgKs863E4UgLxUJkh" target="_blank">Mega Man 7</a> collections in addition to the former.  The level of quality and polish these remixes bring to the game is beyond words, and I am so grateful that we're able to showcase them in our prototype.  TheLegendOfRenegade has done some truly great work, and I think I speak for everyone on the team when I say &quot;thank you&quot;.  ^_^
    <span style="display: block; font-size: 10px; line-height: 12px; margin-top: 2px;">* Because TheLegendOfRenegade has not created remixes for Time Man and Oil Man's stages in Powered Up, the R&amp;F themes for Astro Man and Tengu Man are currently being used in their place. The game will be updated if/when he ever creates them, but please enjoy the current selection until then. :)</span>
  </p>
</div>
<div class="subbody">
  <p class="text">
Example #15
0
<?php

/*
 * INDEX PAGE : LEADERBOARD
 */
// Generate field lists for the relevant community database tables
$db_category_fields = rpg_website::get_category_fields(true, 'categories');
$db_thread_fields = rpg_website::get_thread_fields(true, 'threads');
$db_post_fields = rpg_website::get_post_fields(true, 'posts');
$db_role_fields = rpg_user_role::get_fields(true, 'roles');
$db_user_fields = rpg_user::get_fields(true, 'users');
// If the current sub was not provided OR if a specific page was requested
if (empty($this_current_sub) || preg_match('/^([0-9]+)$/i', $this_current_sub)) {
    // Require the index page
    require_once 'leaderboard_index.php';
} elseif (!empty($this_current_sub) && preg_match('/^([-_a-z0-9]+)$/i', $this_current_sub)) {
    // Attempt to collect data for this player from the database
    $temp_playerquery = 'SELECT
    mmrpg_users.user_id,
    mmrpg_users.role_id,
    mmrpg_roles.role_token,
    mmrpg_roles.role_name,
    mmrpg_roles.role_icon,
    mmrpg_users.user_name,
    mmrpg_users.user_name_clean,
    mmrpg_users.user_name_public,
    mmrpg_users.user_gender,
    mmrpg_users.user_profile_text,
    mmrpg_users.user_website_address,
    mmrpg_users.user_image_path,
    mmrpg_users.user_background_path,