/** * Main output function */ function out() { global $roster, $addon; $this->fetchEquip(); // Equipment $this->equip_slot('Head'); $this->equip_slot('Neck'); $this->equip_slot('Shoulder'); $this->equip_slot('Back'); $this->equip_slot('Chest'); $this->equip_slot('Shirt'); $this->equip_slot('Tabard'); $this->equip_slot('Wrist'); $this->equip_slot('MainHand'); if (isset($this->equip['SecondaryHand'])) { $this->equip_slot('SecondaryHand'); } if (isset($this->equip['Ranged'])) { $this->equip_slot('Ranged'); } //no longer used //$this->equip_slot('Ammo'); $this->equip_slot('Hands'); $this->equip_slot('Waist'); $this->equip_slot('Legs'); $this->equip_slot('Feet'); $this->equip_slot('Finger0'); $this->equip_slot('Finger1'); $this->equip_slot('Trinket0'); $this->equip_slot('Trinket1'); // Resists $this->resist_value('arcane'); $this->resist_value('fire'); $this->resist_value('nature'); $this->resist_value('frost'); $this->resist_value('shadow'); if ($roster->auth->getAuthorized($addon['config']['show_played'])) { $TimeLevelPlayedConverted = seconds_to_time($this->data['timelevelplayed']); $TimePlayedConverted = seconds_to_time($this->data['timeplayed']); $roster->tpl->assign_block_vars('info_stats', array('NAME' => $roster->locale->act['timeplayed'], 'VALUE' => $TimePlayedConverted['days'] . $TimePlayedConverted['hours'] . $TimePlayedConverted['minutes'] . $TimePlayedConverted['seconds'])); $roster->tpl->assign_block_vars('info_stats', array('NAME' => $roster->locale->act['timelevelplayed'], 'VALUE' => $TimeLevelPlayedConverted['days'] . $TimeLevelPlayedConverted['hours'] . $TimeLevelPlayedConverted['minutes'] . $TimeLevelPlayedConverted['seconds'])); } if ($roster->auth->getAuthorized($addon['config']['show_talents']) && $this->data['talent_points']) { $roster->tpl->assign_block_vars('info_stats', array('NAME' => $roster->locale->act['unusedtalentpoints'], 'VALUE' => $this->data['talent_points'])); } // Code to write a "Max Exp bar" just like in SigGen $expbar_amount = $expbar_max = $expbar_rest = ''; if ($this->data['level'] == ROSTER_MAXCHARLEVEL) { $exp_percent = 100; $expbar_amount = $roster->locale->act['max_exp']; $expbar_type = 'max'; } elseif ($this->data['exp'] == '0') { $exp_percent = 0; $expbar_type = 'normal'; } else { $xp = explode(':', $this->data['exp']); if (isset($xp) && $xp[1] != '0' && $xp[1] != '') { $exp_percent = $xp[1] > 0 ? floor($xp[0] / $xp[1] * 100) : 0; $expbar_amount = $xp[0]; $expbar_max = $xp[1]; $expbar_rest = $xp[2] > 0 ? $xp[2] : ''; $expbar_type = $xp[2] > 0 ? 'rested' : 'normal'; } } $roster->tpl->assign_vars(array('EXP_AMOUNT' => $expbar_amount, 'EXP_MAX' => $expbar_max, 'EXP_REST' => $expbar_rest, 'EXP_PERC' => $exp_percent, 'EXP_TYPE' => $expbar_type)); switch ($this->data['classid']) { case ROSTER_CLASS_WARRIOR: case ROSTER_CLASS_PALADIN: case ROSTER_CLASS_ROGUE: case ROSTER_CLASS_MONK: $rightbox = 'melee'; break; case ROSTER_CLASS_HUNTER: $rightbox = 'ranged'; break; case ROSTER_CLASS_SHAMAN: case ROSTER_CLASS_DRUID: case ROSTER_CLASS_MAGE: case ROSTER_CLASS_WARLOCK: case ROSTER_CLASS_PRIEST: $rightbox = 'spell'; break; } $roster->tpl->assign_var('RIGHTBOX', $rightbox); // Print stat boxes $this->status_box('stats', 'left', true); $this->status_box('melee', 'left'); $this->status_box('ranged', 'left'); $this->status_box('spell', 'left'); $this->status_box('defense', 'left'); $this->status_box('stats', 'right'); $this->status_box('melee', 'right', $rightbox == 'melee'); $this->status_box('ranged', 'right', $rightbox == 'ranged'); $this->status_box('spell', 'right', $rightbox == 'spell'); $this->status_box('defense', 'right'); // Buffs $this->show_buffs(); // PvP $this->show_pvp(); // Item bonuses if ($roster->auth->getAuthorized($addon['config']['show_item_bonuses'])) { require_once $addon['inc_dir'] . 'charbonus.lib.php'; $char_bonus = new CharBonus($this); $char_bonus->dumpBonus(); unset($char_bonus); } // Selected default tab $select_tab = isset($_GET['t']) ? $_GET['t'] : 'profile'; // Print tabs $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['profile'], 'VALUE' => 'profile', 'SELECTED' => $select_tab == 'profile' ? true : false)); // Pet Tab if ($roster->auth->getAuthorized($addon['config']['show_pets']) && $this->show_pets()) { $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['pets'], 'VALUE' => 'pets', 'SELECTED' => $select_tab == 'pets' ? true : false)); } else { $roster->tpl->assign_var('S_PET_TAB', false); } // Companion tab if ($roster->auth->getAuthorized($addon['config']['show_companions']) && $this->show_companions()) { $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['companions'], 'VALUE' => 'companions', 'SELECTED' => $select_tab == 'companions' ? true : false)); } else { $roster->tpl->assign_var('S_COMPAN_TAB', false); } // Reputation Tab if ($roster->auth->getAuthorized($addon['config']['show_reputation']) && $this->show_reputation()) { $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['reputation'], 'VALUE' => 'reputation', 'SELECTED' => $select_tab == 'reputation' ? true : false)); } else { $roster->tpl->assign_var('S_REP_TAB', false); } // Skills Tab if ($roster->auth->getAuthorized($addon['config']['show_skills']) && $this->show_skills()) { $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['skills'], 'VALUE' => 'skills', 'SELECTED' => $select_tab == 'skills' ? true : false)); } else { $roster->tpl->assign_var('S_SKILL_TAB', false); } // Talents Tab if ($roster->auth->getAuthorized($addon['config']['show_talents']) && $this->show_talents()) { $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['talents'], 'VALUE' => 'talents', 'SELECTED' => $select_tab == 'talents' ? true : false)); } else { $roster->tpl->assign_var('S_TALENT_TAB', false); } // Glyphs Tab if (!$roster->auth->getAuthorized($addon['config']['show_glyphs']) || !$this->show_glyphs()) { $roster->tpl->assign_var('S_GLYPH_TAB', false); } // Spell Book Tab if ($roster->auth->getAuthorized($addon['config']['show_spellbook']) && $this->show_spellbook()) { $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['spellbook'], 'VALUE' => 'spellbook', 'SELECTED' => $select_tab == 'spellbook' ? true : false)); } else { $roster->tpl->assign_var('S_SPELL_TAB', false); } // Currency Tab if ($roster->auth->getAuthorized($addon['config']['show_currency']) && $this->show_currency()) { $roster->tpl->assign_block_vars('tabs', array('NAME' => $roster->locale->act['currency'], 'VALUE' => 'currency', 'SELECTED' => $select_tab == 'currency' ? true : false)); } else { $roster->tpl->assign_var('S_CURRENCY_TAB', false); } $roster->tpl->set_filenames(array('char' => $addon['basename'] . '/char.html')); return $roster->tpl->fetch('char'); }
* Displays character information * * LICENSE: Licensed under the Creative Commons * "Attribution-NonCommercial-ShareAlike 2.5" license * * @copyright 2002-2008 WoWRoster.net * @license http://creativecommons.org/licenses/by-nc-sa/2.5 Creative Commons "Attribution-NonCommercial-ShareAlike 2.5" * @version SVN: $Id: index.php 1791 2008-06-15 16:59:24Z Zanix $ * @link http://www.wowroster.net * @package CharacterInfo */ if (!defined('IN_ROSTER')) { exit('Detected invalid access to this file!'); } /* if( $roster->auth->getAuthorized($addon['config']['show_item_bonuses']) ) { $roster->output['html_head'] .= '<script type="text/javascript" src="' . $addon['url_path'] . 'js/overlib_overtwo.js"></script>'; $roster->output['html_head'] .= '<script type="text/javascript" src="' . ROSTER_PATH . 'js/overlib.js"></script>'; } */ include $addon['inc_dir'] . 'header.php'; $char_page .= $char->out(); if ($roster->auth->getAuthorized($addon['config']['show_item_bonuses'])) { $char_page .= "</td><td align=\"left\">\n"; require_once $addon['inc_dir'] . 'charbonus.lib.php'; $char_bonus = new CharBonus($char); $char_page .= $char_bonus->dumpBonus(); unset($char_bonus); } include $addon['inc_dir'] . 'footer.php';