if ($v_charfeed['accountWide']) {
                     $class = 'accountwide';
                 }
                 $cnf_output = $v_charfeed['hero'] ? sprintf($this->game->glang('charnf_achievement_hero'), '<a href="' . $bnetLink . '" class="' . $class . '">' . $v_charfeed['title'] . '</a>') : sprintf($this->game->glang('charnf_achievement'), '<a href="' . $bnetLink . '" class="' . $class . '">' . $v_charfeed['title'] . '</a>', $v_charfeed['points']);
                 break;
             case 'bosskill':
                 $cnf_output = sprintf($this->game->glang('charnf_bosskill'), $v_charfeed['quantity'], $v_charfeed['title']);
                 break;
             case 'criteria':
                 $achievCat = $this->game->obj['armory']->getCategoryForAchievement((int) $v_charfeed['achievementID'], $arrCharacterAchievements);
                 $bnetLink = $this->game->obj['armory']->bnlink($chardata['name'], unsanitize($this->config->get('servername')), 'achievements', unsanitize($this->config->get('guildtag'))) . '#' . $achievCat . ':a' . $v_charfeed['achievementID'];
                 $cnf_output = sprintf($this->game->glang('charnf_criteria'), '<b>' . $v_charfeed['criteria'] . '</b>', '<a href="' . $bnetLink . '">' . $v_charfeed['title'] . '</a>');
                 break;
             case 'item':
                 $itemData = $this->game->obj['armory']->item($v_charfeed['itemid']);
                 $item = infotooltip($itemData['name'], $v_charfeed['itemid'], false, false, false, true, array(unsanitize($this->config->get('servername')), $chardata['name']));
                 $cnf_output = sprintf($this->game->glang('charnf_item'), $item);
                 $v_charfeed['icon'] = 'http://eu.media.blizzard.com/wow/icons/18/' . $itemData['icon'] . '.jpg';
                 break;
         }
         $this->tpl->assign_block_vars('charfeed', array('TEXT' => $cnf_output, 'ICON' => $v_charfeed['icon'], 'DATE' => $this->time->nice_date($v_charfeed['timestamp'], 60 * 60 * 24 * 7)));
     }
 }
 // item icons
 foreach ($items as $items_pos => $v_items) {
     foreach ($v_items as $slots) {
         $this->tpl->assign_block_vars('itemicons_' . $items_pos, array('SLOTS' => $slots));
     }
 }
 $this->tpl->assign_array('itemlevel', $items['itemlevel']);
 // boss progress
Exemple #2
0
 public function parse_shorttags($text, $filter = array())
 {
     $tags = preg_split('/{{([^}]+)}}/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
     $strBuffer = '';
     for ($rit = 0; $rit < count($tags); $rit = $rit + 2) {
         $strBuffer .= $tags[$rit];
         if (!isset($tags[$rit + 1])) {
             break;
         }
         $strTag = $tags[$rit + 1];
         $arrCache = array();
         // Load value from cache array
         if (isset($arrCache[$strTag])) {
             $strBuffer .= $arrCache[$strTag];
             continue;
         }
         $elements = explode('::', $strTag);
         //Check Filter
         if (is_array($filter) && count($filter) > 0 && !in_array(strtolower($elements[0]), $filter)) {
             continue;
         }
         // Replace tag
         switch (strtolower($elements[0])) {
             case 'article_url':
                 $strPath = $this->controller_path . $this->pdh->get('articles', 'path', array($elements[1]));
                 $arrCache[$strTag] = $strPath ? $strPath : '';
                 break;
             case 'article_url_plain':
                 $strPath = $this->controller_path_plain . $this->pdh->get('articles', 'path', array($elements[1]));
                 $arrCache[$strTag] = $strPath ? $strPath : '';
                 break;
             case 'category_url':
                 $strPath = $this->controller_path . $this->pdh->get('article_categories', 'path', array($elements[1]));
                 $arrCache[$strTag] = $strPath ? $strPath : '';
                 break;
             case 'category_url_plain':
                 $strPath = $this->controller_path_plain . $this->pdh->get('article_categories', 'path', array($elements[1]));
                 $arrCache[$strTag] = $strPath ? $strPath : '';
                 break;
             case 'server':
                 switch ($elements[1]) {
                     case 'name':
                         $arrCache[$strTag] = $this->config->get('servername');
                         break;
                     case 'location':
                         $arrCache[$strTag] = $this->config->get('uc_server_loc');
                         break;
                 }
                 break;
             case 'user':
                 switch ($elements[1]) {
                     case 'name':
                         $this->username = !$this->user->is_signedin() ? $this->user->lang('guest') : $this->pdh->get('user', 'name', array($this->user->data['user_id']));
                         $arrCache[$strTag] = $this->username;
                         break;
                 }
                 break;
             case 'guild':
                 switch ($elements[1]) {
                     case 'name':
                         $arrCache[$strTag] = $this->config->get('guildtag');
                         break;
                 }
                 break;
             case 'char':
                 if (is_numeric($elements[1])) {
                     $member_id = intval($elements[1]);
                 } else {
                     $member_id = $this->pdh->get('member', 'id', array($elements[1]));
                 }
                 if ($member_id) {
                     $arrCache[$strTag] = $this->pdh->get('member', 'memberlink_decorated', array($member_id, $this->routing->simpleBuild('character'), '', true));
                 }
                 break;
             case 'itemid':
                 infotooltip_js();
                 $item = "";
                 $game_id = strip_tags($elements[1]);
                 $str = infotooltip($item, $game_id);
                 $arrCache[$strTag] = $str;
                 break;
             case 'item':
                 infotooltip_js();
                 $item = strip_tags($elements[1]);
                 if (strpos('id:', $item) === 0) {
                     $game_id = substr($item, 3);
                     $str = infotooltip("", $game_id);
                     $arrCache[$strTag] = $str;
                 } else {
                     $game_id = is_numeric($item) ? intval($item) : 0;
                     $str = infotooltip($item, $game_id);
                     $arrCache[$strTag] = $str;
                 }
                 break;
         }
         $strBuffer .= $arrCache[$strTag];
     }
     return $strBuffer;
 }
Exemple #3
0
 public function get_itt_itemname($item_id, $lang = false, $direct = 0, $onlyicon = 0, $noicon = false, $in_span = false)
 {
     if (!in_array($item_id, $this->index)) {
         return false;
     }
     if ($this->config->get('infotooltip_use')) {
         $lang = !$lang || ($lang = '') ? $this->user->lang('XML_LANG') : $lang;
         $ext = '';
         if ($direct && !register('config')->get('infotooltip_own_enabled')) {
             $options = array('url' => $this->server_path . "infotooltip/infotooltip_feed.php?name=" . urlencode(base64_encode($this->get_name($item_id))) . "&lang=" . $lang . "&update=1&direct=1", 'height' => '340', 'width' => '400', 'onclose' => $this->env->request);
             if ($this->get_game_itemid($item_id) != '') {
                 $options['url'] .= "&game_id=" . $this->get_game_itemid($item_id);
             }
             $this->jquery->Dialog("infotooltip_update", "Item-Update", $options);
             $ext = '<br /><span style="cursor:pointer;" onclick="infotooltip_update()"><i class="fa fa-refresh"></i> Refresh Item</span>';
         }
         return infotooltip($this->get_name($item_id), $this->get_game_itemid($item_id), $lang, $direct, $onlyicon, $noicon, array(), $in_span, $this->get_item_color($item_id)) . $ext;
     }
     return $this->get_name($item_id);
 }
Exemple #4
0
 /**
  * Return an array(left,right,button) with the wow char icons
  *
  * @param array $data
  * @param string $member_name
  * @return array
  */
 public function getItemArray($data, $member_name, $icons_size = 53)
 {
     $d_itemoptions = array('head' => array('position' => 'left', 'bnetid' => '0'), 'neck' => array('position' => 'left', 'bnetid' => '1'), 'shoulder' => array('position' => 'left', 'bnetid' => '2'), 'back' => array('position' => 'left', 'bnetid' => '14'), 'chest' => array('position' => 'left', 'bnetid' => '4'), 'shirt' => array('position' => 'left', 'bnetid' => '3'), 'tabard' => array('position' => 'left', 'bnetid' => '18'), 'wrist' => array('position' => 'left', 'bnetid' => '8'), 'hands' => array('position' => 'right', 'bnetid' => '9'), 'waist' => array('position' => 'right', 'bnetid' => '5'), 'legs' => array('position' => 'right', 'bnetid' => '6'), 'feet' => array('position' => 'right', 'bnetid' => '7'), 'finger1' => array('position' => 'right', 'bnetid' => '10'), 'finger2' => array('position' => 'right', 'bnetid' => '11'), 'trinket1' => array('position' => 'right', 'bnetid' => '12'), 'trinket2' => array('position' => 'right', 'bnetid' => '13'), 'mainHand' => array('position' => 'bottom', 'bnetid' => '15'), 'offHand' => array('position' => 'bottom', 'bnetid' => '16'));
     // reset the array
     $a_items = array();
     // set the itemlevel
     $a_items['itemlevel'] = array('averageItemLevel' => $data['averageItemLevel'], 'averageItemLevelEquipped' => $data['averageItemLevelEquipped']);
     // fill the item slots with data
     foreach ($d_itemoptions as $slot => $options) {
         $item_id_full = isset($data[$slot]['id']) && $data[$slot]['id'] > 0 ? $this->game->obj['armory']->armory2itemid($data[$slot]['id'], $data[$slot]['context'], $data[$slot]['bonusLists'], $data[$slot]['itemLevel']) : 0;
         $a_items[$options['position']][] = isset($data[$slot]['id']) && $data[$slot]['id'] > 0 ? infotooltip($data[$slot]['name'], $item_id_full, false, 0, $icons_size, false, array(false, $member_name, $slot)) : "<img src='" . $this->server_path . "games/wow/profiles/slots/" . $options['bnetid'] . ".png' height='{$icons_size}' width='{$icons_size}' alt='' />";
     }
     return $a_items;
 }
                 if ($v_charfeed['accountWide']) {
                     $class = 'accountwide';
                 }
                 $cnf_output = $v_charfeed['hero'] ? sprintf($this->game->glang('charnf_achievement_hero'), '<a href="' . $bnetLink . '" class="' . $class . '">' . $v_charfeed['title'] . '</a>') : sprintf($this->game->glang('charnf_achievement'), '<a href="' . $bnetLink . '" class="' . $class . '">' . $v_charfeed['title'] . '</a>', $v_charfeed['points']);
                 break;
             case 'bosskill':
                 $cnf_output = sprintf($this->game->glang('charnf_bosskill'), $v_charfeed['quantity'], $v_charfeed['title']);
                 break;
             case 'criteria':
                 $achievCat = $this->game->obj['armory']->getCategoryForAchievement((int) $v_charfeed['achievementID'], $arrCharacterAchievements);
                 $bnetLink = $this->game->obj['armory']->bnlink($chardata['name'], $this->config->get('uc_servername'), 'achievements', $this->config->get('guildtag')) . '#' . $achievCat . ':a' . $v_charfeed['achievementID'];
                 $cnf_output = sprintf($this->game->glang('charnf_criteria'), '<b>' . $v_charfeed['criteria'] . '</b>', '<a href="' . $bnetLink . '">' . $v_charfeed['title'] . '</a>');
                 break;
             case 'item':
                 $itemData = $this->game->obj['armory']->item($v_charfeed['itemid']);
                 $item = infotooltip($itemData['name'], $v_charfeed['itemid'], false, false, false, true, $chardata['name'], $this->config->get('uc_servername'));
                 $cnf_output = sprintf($this->game->glang('charnf_item'), $item);
                 $v_charfeed['icon'] = 'http://eu.media.blizzard.com/wow/icons/18/' . $itemData['icon'] . '.jpg';
                 break;
         }
         $this->tpl->assign_block_vars('charfeed', array('TEXT' => $cnf_output, 'ICON' => $v_charfeed['icon'], 'DATE' => $this->time->nice_date($v_charfeed['timestamp'], 60 * 60 * 24 * 7)));
     }
 }
 // item icons
 foreach ($items as $items_pos => $v_items) {
     foreach ($v_items as $slots) {
         $this->tpl->assign_block_vars('itemicons_' . $items_pos, array('SLOTS' => $slots));
     }
 }
 $this->tpl->assign_array('itemlevel', $items['itemlevel']);
 // boss progress
 public function get_itt_itemname($id, $lang = false, $direct = 0, $onlyicon = 0, $noicon = false, $in_span = false)
 {
     if (!isset($this->data[$id])) {
         return false;
     }
     if ($this->config->get('infotooltip_use')) {
         $lang = !$lang ? $this->user->lang('XML_LANG') : $lang;
         $ext = '';
         if ($direct) {
             $options = array('url' => $this->root_path . "infotooltip/infotooltip_feed.php?name=" . urlencode(base64_encode($this->get_name($id))) . "&lang=" . $lang . "&update=1&direct=1", 'height' => '340', 'width' => '400', 'onclose' => $this->env->request);
             $this->jquery->Dialog("infotooltip_update", "Item-Update", $options);
             $ext = '<span style="cursor:pointer;" onclick="infotooltip_update()">Refresh</span>';
         }
         return infotooltip($this->get_name($id), 0, $lang, $direct, $onlyicon, $noicon, '', false, false, $in_span, false) . $ext;
     }
     return $this->get_name($id);
 }
}
');
    //$this->tpl->js_file('http://content.turbine.com/sites/lorebook.lotro.com/js/onering.js');
    $this->tpl->assign_vars(array('DATA_CLASSID' => $member['class_id'], 'ARMORY' => 1));
    $this->tpl->assign_array('CHARDATA', $chardata['character']['@attributes']);
    $arrStats = array();
    if (isset($chardata['character']['stats'])) {
        foreach ($chardata['character']['stats']['stat'] as $value) {
            $arrStats[$value['@attributes']['name']] = $value['@attributes']['value'];
        }
    }
    $this->tpl->assign_array('CHARSTATS', $arrStats);
    $arrEquip = array();
    $arrSlots = $this->game->obj['ldata']->slots;
    infotooltip_js();
    if (isset($chardata['character']['equipment'])) {
        foreach ($chardata['character']['equipment']['item'] as $value) {
            $slot_id = $arrSlots[$value['@attributes']['slot']];
            if (!$slot_id) {
                echo "Unknown slot: " . $value['@attributes']['slot'];
            }
            $this->tpl->assign_block_vars('equipment', array('SLOT_ID' => $slot_id, 'LINK' => $value['@attributes']['lorebookEntry'], 'ITEM_ID' => $value['@attributes']['item_id'], 'ITEM_NAME' => $value['@attributes']['name'], 'ICON' => infotooltip($value['@attributes']['name'], intval($value['@attributes']['item_id']), false, 0, 32)));
        }
    }
    if (isset($chardata['character']['vocation'])) {
        $this->tpl->assign_vars(array('DATA_VOCATION' => $chardata['character']['vocation']['@attributes']['name'], 'S_VOCATION' => true));
        $this->tpl->assign_array('DATA_PROF1', $chardata['character']['vocation']['professions']['profession'][0]['@attributes']);
        $this->tpl->assign_array('DATA_PROF2', $chardata['character']['vocation']['professions']['profession'][1]['@attributes']);
        $this->tpl->assign_array('DATA_PROF3', $chardata['character']['vocation']['professions']['profession'][2]['@attributes']);
    }
}
 public function parse_shorttags($text, $filter = array())
 {
     $tags = preg_split('/{{([^}]+)}}/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
     $strBuffer = '';
     for ($rit = 0; $rit < count($tags); $rit = $rit + 2) {
         $strBuffer .= $tags[$rit];
         if (!isset($tags[$rit + 1])) {
             break;
         }
         $strTag = $tags[$rit + 1];
         $arrCache = array();
         // Load value from cache array
         if (isset($arrCache[$strTag])) {
             $strBuffer .= $arrCache[$strTag];
             continue;
         }
         $elements = explode('::', $strTag);
         //Check Filter
         if (is_array($filter) && count($filter) > 0 && !in_array(strtolower($elements[0]), $filter)) {
             continue;
         }
         // Replace tag
         switch (strtolower($elements[0])) {
             // Date
             case 'page':
                 $arrCache[$strTag] = $this->pdh->get('pages', 'page_exists', array($elements[1])) ? '<a href="' . $this->pdh->get('pages', 'url', array($elements[1])) . '">' . $this->pdh->get('pages', 'title', array($elements[1])) . '</a>' : '';
                 break;
             case 'page_url':
                 $arrCache[$strTag] = $this->pdh->get('pages', 'page_exists', array($elements[1])) ? $this->pdh->get('pages', 'url', array($elements[1])) : '';
                 break;
             case 'server':
                 switch ($elements[1]) {
                     case 'name':
                         $arrCache[$strTag] = $this->config->get('uc_servername');
                         break;
                     case 'location':
                         $arrCache[$strTag] = $this->config->get('uc_server_loc');
                         break;
                 }
                 break;
             case 'user':
                 switch ($elements[1]) {
                     case 'name':
                         $this->username = !$this->user->is_signedin() ? $this->user->lang('guest') : $this->pdh->get('user', 'name', array($this->user->data['user_id']));
                         $arrCache[$strTag] = $this->username;
                         break;
                 }
                 break;
             case 'guild':
                 switch ($elements[1]) {
                     case 'name':
                         $arrCache[$strTag] = $this->config->get('guildtag');
                         break;
                 }
                 break;
             case 'char':
                 $member_id = $this->pdh->get('member', 'id', array($elements[1]));
                 if ($member_id) {
                     $arrCache[$strTag] = $this->pdh->get('member', 'html_memberlink', array($member_id, 'viewcharacter.php', '', false, false, true));
                 }
                 break;
         }
         //Infotooltips
         if (strpos('item', strtolower($elements[0])) === 0) {
             infotooltip_js();
             $item = strip_tags($elements[1]);
             $game_id = is_numeric($item) ? intval($item) : 0;
             $str = infotooltip($item, $game_id);
             $arrCache[$strTag] = $str;
         }
         $strBuffer .= $arrCache[$strTag];
     }
     return $strBuffer;
 }
    } else {
        $nrmark = 'bad';
    }
    $eresist = $cdata['resists']['elemental']['effective'];
    if ($eresist >= $minresists) {
        $ermark = 'good';
    } else {
        $ermark = 'bad';
    }
    //Output
    if (floor((double) $cdata['stats']['combat']['critchance']) >= $mincrit) {
        $cmark = 'good';
    } else {
        $cmark = 'bad';
    }
    $this->tpl->assign_block_vars('raid_ready', array('CAST_SPEED' => floor((double) $cdata['stats']['ability']['spelltimecastpct']), 'REUSE_SPEED' => floor((double) $cdata['stats']['ability']['spelltimereusepct']), 'RECOVERY_SPEED' => floor((double) $cdata['stats']['ability']['spelltimerecoverypct']), 'ER' => $ercheck, 'EICONID1' => $erico1, 'EICONID2' => $erico2, 'DEITY' => $deity, 'DPIC' => $dpic, 'SING' => $singularcheck, 'SICO' => $singularicon, 'FDVALUE' => isset($fdname) ? infotooltip($fdname, 0, false, 0, 0, 1) : '', 'FDICONID' => isset($fdicon) ? $fdicon : 0, 'DRVALUE' => isset($drname) ? infotooltip($drname, 0, false, 0, 0, 1) : '', 'DRICONID' => isset($dricon) ? $dricon : 0, 'EMARK' => $emark, 'CMARK' => $cmark, 'GMARK' => $gmark, 'SMARK' => $smark, 'ARMARK' => $armark, 'NRMARK' => $nrmark, 'ERMARK' => $ermark, 'MINRESIST' => number_format($minresists), 'ARESIST' => number_format($aresist), 'NRESIST' => number_format($nresist), 'ERESIST' => number_format($eresist), 'AAPNTS' => $aatotal, 'PTPNTS' => $aaptotal, 'AAMARK' => $aamark, 'PTMARK' => $ptmark));
    $this->tpl->add_css('
			.spellbkg1{
				background: url("http://census.daybreakgames.com/s:eqdkpplus/img/eq2/icons/' . $erbak1 . '/spell") no-repeat;
				float: left;
				text-align: center;
				width: 42px;
			}
			.spellbkg2{
				background: url("http://census.daybreakgames.com/s:eqdkpplus/img/eq2/icons/' . $erbak2 . '/spell") no-repeat;
				float: left;
				text-align: center;
				width: 42px;
			}
			.singbkg{
				background: url("http://census.daybreakgames.com/s:eqdkpplus/img/eq2/icons/317/spell") no-repeat;