function itemidname($item_id) { global $roster, $tab_data, $tooltips; foreach ($tab_data as $tab) { if (is_object($tab)) { foreach ($tab->contents as $object) { $object_id = explode(':', $object->data['item_id']); $object_id = $object_id[0]; $id = explode(':', $item_id); $id = $id[0]; if ($object_id == $id) { $tooltip = makeOverlib($object->html_tooltip, '', '', 2, '', ', WIDTH, 325'); $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$roster->config['locale']]['itemlinks'] as $key => $ilink) { $linktip .= '<a href="' . $ilink . $item_id . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$roster->config['locale']]['itemlink']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; return '<span style="color:#' . $object->data['item_color'] . ';font-weight:bold;" ' . $tooltip . $linktip . '>[' . $object->data['item_name'] . ']</span>'; } } } } return $item_id; }
function out() { global $roster, $addon, $tooltips; $lang = $this->data['locale']; $bag_type = strpos($this->data['item_slot'], 'Bank') !== false ? 'bank' : 'bag'; $bag_type = $this->data['item_slot'] == 'Bag5' ? 'key' : $bag_type; $bag_style = $this->data['item_quantity'] % 4; if ($bag_style == 0) { $offset = $this->data['item_quantity'] / 4 * 41; $offset += 42; } elseif ($bag_style == 2) { $offset = ($this->data['item_quantity'] - 2 + 1) / 4 * 41; $offset += 53; } // Item links list($item_id) = explode(':', $this->item_id); $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$lang]['itemlinks'] as $key => $ilink) { $linktip .= '<a href="' . $ilink . $item_id . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$lang]['itemlink']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; $roster->tpl->assign_block_vars('bag', array('NAME' => $this->data['item_name'], 'SLOT' => $this->data['item_slot'], 'TYPE' => $bag_type, 'STYLE' => $bag_style, 'OFFSET' => $offset, 'ICON' => $this->data['item_texture'], 'TOOLTIP' => makeOverlib($this->data['item_tooltip'], '', $this->data['item_color'], 0, $lang), 'LINKTIP' => $linktip)); // Select all item for this bag for ($slot = 0; $slot < $this->data['item_quantity']; $slot++) { if (isset($this->contents[$slot + 1])) { $item = $this->contents[$slot + 1]; $roster->tpl->assign_block_vars('bag.item', array('ICON' => $item->out())); } else { $roster->tpl->assign_block_vars('bag.item', array('ICON' => '<div class="item"><img src="' . $roster->config['img_url'] . 'pixel.gif" class="noicon" alt="" /></div>')); } } }
function alt_name_hover() { global $roster; $alt_hover = ''; if (active_addon('memberslist')) { $sql = "SELECT `main_id` FROM `" . $roster->db->table('alts', 'memberslist') . "` WHERE `member_id` = " . $roster->data['member_id'] . ";"; $main_id = $roster->db->query_first($sql); if ($main_id != 0) { // we know the main, get alt info $sql = "SELECT `m`.`name`, `m`.`level`, `m`.`class`, `a`.* FROM `" . $roster->db->table('alts', 'memberslist') . "` AS a, `" . $roster->db->table('players') . "` AS m " . " WHERE `a`.`member_id` = `m`.`member_id` " . " AND `a`.`main_id` = {$main_id};"; $qry = $roster->db->query($sql); $alts = $roster->db->fetch_all($qry, SQL_ASSOC); if (isset($alts[1])) { $html = $caption = ''; foreach ($alts as $alt) { if ($alt['main_id'] == $alt['member_id']) { $caption = 'Alts of: <a href="' . makelink('char-info&a=c:' . $alt['member_id']) . '">' . $alt['name'] . ' (' . $roster->locale->act['level'] . ' ' . $alt['level'] . ' ' . $alt['class'] . ')</a>'; } else { $html .= '<a href="' . makelink('char-info&a=c:' . $alt['member_id']) . '">' . $alt['name'] . ' (' . $roster->locale->act['level'] . ' ' . $alt['level'] . ' ' . $alt['class'] . ')</a><br />'; } } setTooltip('alt_html', $html); setTooltip('alt_cap', $caption); $alt_hover = ' style="cursor:pointer;" onmouseover="return overlib(overlib_alt_html,CAPTION,overlib_alt_cap);" ' . 'onclick="return overlib(overlib_alt_html,CAPTION,overlib_alt_cap,STICKY,OFFSETX,-10,OFFSETY,-10,NOCLOSE);" ' . 'onmouseout="return nd();"'; } } } $roster->tpl->assign_var('ALT_TOOLTIP', $alt_hover); }
function event_LOOT($data) { global $roster, $tooltips; require_once ROSTER_LIB . 'item.php'; //$x = new item(); // lets be fancy now... $item = $roster->api->Data->getItemInfo($data['itemId']); $item_color = $roster->api->Data->_setQualityc($item['quality']); $html_tooltip = $roster->api->Item->item($item, null, null); $i = array(); $i['item_id'] = $item['id'] . ':0:0:0:0:0'; $i['item_name'] = $item['name']; $i['item_level'] = $item['itemLevel']; $i['level'] = $item['requiredLevel']; $i['item_texture'] = $item['icon']; $i['item_tooltip'] = $html_tooltip; $i['item_color'] = $item_color; $i['item_quantity'] = $item['quality']; $i['item_slot'] = ''; $i['item_parent'] = ''; $i['member_id'] = ''; $x = new item($i, 'full'); $it = $x->html_tooltip; $item_id = $item['id']; $tooltip = makeOverlib($it, '', '', 2, '', ', WIDTH, 325'); $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$roster->config['locale']]['itemlinks'] as $key => $ilink) { $linktip .= '<a href="' . $ilink . $item_id . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$roster->config['locale']]['itemlink']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; $ts = $data['timestamp'] / 1000; /*8 echo 'Obtained <span style="color:#' . $item_color . ';font-weight:bold;text-align: center;" ' . $tooltip . $linktip . '>'. '<div class="item-sm"><img src="http://www.wowroster.net/Interface/Icons/'.$item['icon'].'.png" /><span class="mask"></span></a></div>' . $item['name'] . '</span><br>';*/ echo '<li> <dl> <dd> <a href="http://battle.net/wow/en/item/' . $item['id'] . '" target"_blank"> <span class="icon-frame frame-36" > <img src="http://www.wowroster.net/Interface/Icons/' . $item['icon'] . '.png" /> </span> </a> Obtained <span style="color:#' . $item_color . ';font-weight:bold;text-align: center;" ' . $tooltip . $linktip . '>' . $item['name'] . '</span></a>. </dd> <dt>' . convert_date($ts) . '</dt> </dl> </li>'; }
function out() { global $roster, $char, $tooltips; if (!is_object($char)) { $lang = $roster->config['locale']; } else { $lang = $char->data['clientLocale']; } $path = $roster->config['interface_url'] . 'Interface/Icons/' . $this->data['recipe_texture'] . '.' . $roster->config['img_suffix']; // Item links $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$lang]['data_links'] as $key => $ilink) { $linktip .= '<a href="' . $ilink . urlencode(utf8_decode($this->data['recipe_name'])) . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$lang]['data_search']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; $tooltip = makeOverlib($this->data['recipe_tooltip'], '', $this->data['item_color'], 0, $lang); $returnstring = '<div class="item" ' . $tooltip . $linktip . '>'; $returnstring .= '<img src="' . $path . '" class="icon" alt="" />' . "\n"; $returnstring .= '</div>'; return $returnstring; }
function printBonus() { global $roster, $tooltips; foreach ($roster->locale->act['item_bonuses_tabs'] as $catkey => $catval) { // check to see if the catagory has data don't display if none if (isset($this->bonus[$catkey])) { $cat = $this->bonus[$catkey]; $roster->tpl->assign_block_vars('bonus', array('KEY' => $catkey, 'VALUE' => $catval)); foreach ($cat as $key => $value) { $value = explode(':', $value); $idx = count($tooltips) + 1; setTooltip($idx, $this->bonus_tooltip[$catkey][$key]['html']); setTooltip('cap_' . $idx, str_replace(array('XX', 'YY'), $value, $key)); $roster->tpl->assign_block_vars('bonus.row', array('ROW_CLASS' => $roster->switch_row_class(), 'IDX' => $idx, 'VALUE' => str_replace(array('XX', 'YY'), $value, $key))); } } } // aprint($this->bonus,'bonus'); // aprint($this->bonus_tooltip,'bonus HTML'); }
function tpl_get_itemlink() { global $roster, $tooltips; // Item links $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$this->lang]['data_links'] as $key => $ilink) { $linktip .= '<a href="' . $ilink . urlencode(utf8_decode($this->data['recipe_name'])) . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$this->lang]['data_search']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; return $linktip; }
} } if (!empty($questid)) { $sql = "SELECT * FROM `" . $roster->db->table('quest_data') . "` WHERE `quest_name` = '" . $questid . "';"; $result = $roster->db->query($sql) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $sql); // Set our questlink caption name setTooltip('questlink', $roster->locale->act['quest_links']); $qnrow = $roster->db->fetch($result, SQL_ASSOC); $roster->tpl->assign_vars(array('S_SHOW' => true, 'ZONE_NAME' => $qnrow['zone'])); // Quest links $num_of_tips = count($tooltips) + 1; $linktip = array(); foreach ($roster->locale->act['questlinks'] as $link) { $linktip[] = '<a href="' . sprintf($link['url'], $qnrow['quest_id']) . '" target="_blank">' . $link['name'] . '</a>'; } setTooltip($num_of_tips, implode('<br />', $linktip)); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_questlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; $roster->tpl->assign_block_vars('quests', array('ID' => $qnrow['quest_id'], 'NAME' => $qnrow['quest_name'], 'LEVEL' => $qnrow['quest_level'], 'TAG' => $qnrow['quest_tag'], 'GROUP' => $qnrow['group'], 'DAILY' => $qnrow['daily'], 'TOOLTIP' => ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_questlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"')); $query = "SELECT `q`.*, `p`.`name`, `p`.`server`, `p`.`member_id`, `p`.`level`" . " FROM `" . $roster->db->table('quests') . "` AS q, `" . $roster->db->table('players') . "` AS p" . " WHERE `p`.`server` = '" . $roster->db->escape($roster->data['server']) . "' AND `q`.`quest_id` = '" . $qnrow['quest_id'] . "' AND `q`.`member_id` = `p`.`member_id`" . " ORDER BY `p`.`level` DESC, `p`.`name` ASC;"; $result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query); while ($row = $roster->db->fetch($result)) { // Set template variables $roster->tpl->assign_block_vars('quests.members', array('ROW_CLASS' => $roster->switch_row_class(), 'LINK' => makelink('char-info-quests&a=c:' . $row['member_id']), 'NAME' => $row['name'], 'LEVEL' => $row['level'], 'COMPLETE' => $row['is_complete'])); } $roster->db->free_result($result); } $roster->tpl->set_handle('body', $addon['basename'] . '/questlist.html'); $roster->tpl->display('body'); function selectQuery($table, $fieldtoget, $field, $current, $urltorun) { global $roster;
/** * Easy all in one function to make overlib tooltips * Creates a string for insertion into any html tag that has "onmouseover" and "onmouseout" events * * @param string $tooltip | Tooltip as a string (delimited by "\n" character) * @param string $caption | (optional) Text to set as a true OverLib caption * @param string $caption_color | (optional) Color for the caption * Default is 'ffffff' - white * @param bool $mode| (optional) Options 0=colorize,1=clean,2=pass through * Default 0 (colorize) * @param string $locale | Locale so color parser can work correctly * Only needed when $colorize is true * Default is $roster->config['locale'] * @param string $extra_parameters | (optional) Extra OverLib parameters you wish to pass * @param string $item_id * @return unknown */ function makeOverlib($tooltip, $caption = '', $caption_color = '', $mode = 0, $locale = '', $extra_parameters = '') { global $roster, $tooltips; $tooltip = stripslashes($tooltip); // Use main locale if one is not specified if ($locale == '') { $locale = $roster->config['locale']; } // Detect caption text and display accordingly $caption_mode = 1; if ($caption_color != '') { if (strlen($caption_color) > 6) { $caption_color = substr($caption_color, 2); } } if ($caption != '') { if ($caption_color != '') { $caption = '<span style="color:#' . $caption_color . ';">' . $caption . '</span>'; } $caption = ",CAPTION,'" . addslashes($caption) . "'"; $caption_mode = 0; } switch ($mode) { case 0: $tooltip = colorTooltip($tooltip, $caption_color, $locale, $caption_mode); break; case 1: $tooltip = cleanTooltip($tooltip, $caption_color, $caption_mode); break; case 2: break; default: $tooltip = colorTooltip($tooltip, $caption_color, $locale, $caption_mode); break; } $num_of_tips = count($tooltips) + 1; setTooltip($num_of_tips, $tooltip); return 'onmouseover="return overlib(overlib_' . $num_of_tips . $caption . $extra_parameters . ');" onmouseout="return nd();"'; }
function out() { global $roster, $tooltips; $lang = isset($this->locale) ? $this->locale : $roster->config['locale']; $path = $roster->config['interface_url'] . 'Interface/Icons/' . $this->icon . '.' . $roster->config['img_suffix']; $tooltip = makeOverlib($this->html_tooltip, '', '', 2, '', ', WIDTH, 325'); list($item_id) = explode(':', $this->item_id); // Item links $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$lang]['itemlinks'] as $key => $ilink) { //$linktip .= '<a href="' . $ilink . urlencode(utf8_decode($this->data['item_name'])) . '" target="_blank">' . $key . '</a><br />'; $linktip .= '<a href="' . $ilink . $item_id . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$lang]['itemlink']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; $output = '<div class="item" ' . $tooltip . $linktip . '>'; if ($this->slot == 'Ammo') { $output .= '<img src="' . $path . '" class="iconsmall" alt="" />' . "\n"; } else { $output .= '<img src="' . $path . '" class="icon" alt="" />' . "\n"; } if ($this->quantity > 1) { $output .= '<b>' . $this->quantity . '</b>'; $output .= '<span>' . $this->quantity . '</span>'; } $output .= '</div>'; return $output; }
function tpl_get_itemlink() { global $roster, $tooltips; $lang = isset($this->locale) ? $this->locale : $roster->config['locale']; list($item_id) = explode(':', $this->item_id); // Item links $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$lang]['itemlinks'] as $key => $ilink) { $linktip .= '<a href="' . $ilink . $item_id . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$lang]['itemlink']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; return $linktip; }
function processItem($item) { global $roster, $tooltips; require_once ROSTER_LIB . 'item.php'; //$x = new item(); // lets be fancy now... if (isset($item['id'])) { $item_color = $roster->api->Data->_setQualityc($item['quality']); $item_id = $item['id']; $tooltip = 'data-tooltip="item-' . $item_id . '"'; //makeOverlib($it, '', '' , 2, '', ', WIDTH, 325'); $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->wordings[$roster->config['locale']]['itemlinks'] as $key => $ilink) { $linktip .= '<a href="' . $ilink . $item_id . '" target="_blank">' . $key . '</a><br />'; } setTooltip($num_of_tips, $linktip); setTooltip('itemlink', $roster->locale->wordings[$roster->config['locale']]['itemlink']); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_itemlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; return '<span style="color:#' . $item_color . ';font-weight:bold;text-align: center;" ' . $tooltip . $linktip . '>' . $item['name'] . '</span>'; } return ''; }
} } if (!empty($questid)) { $sql = "SELECT DISTINCT `quest_name`, `quest_level`, `zone` FROM `" . $roster->db->table('quests') . "` WHERE `quest_name` = '" . $questid . "' ORDER BY `quest_name`;"; $result = $roster->db->query($sql) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $sql); // Set our questlink caption name setTooltip('questlink', $roster->locale->act['quest_links']); $qnrow = $roster->db->fetch($result, SQL_ASSOC); $roster->tpl->assign_vars(array('S_SHOW' => true, 'ZONE_NAME' => $qnrow['zone'])); // Quest links $num_of_tips = count($tooltips) + 1; $linktip = ''; foreach ($roster->locale->act['questlinks'] as $link) { $linktip .= '<a href="' . $link['url1'] . urlencode(utf8_decode($qnrow['quest_name'])) . '" target="_blank">' . $link['name'] . '</a><br />'; } setTooltip($num_of_tips, $linktip); $linktip = ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_questlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"'; $roster->tpl->assign_block_vars('quests', array('NAME' => $qnrow['quest_name'], 'LEVEL' => $qnrow['quest_level'], 'TOOLTIP' => ' onclick="return overlib(overlib_' . $num_of_tips . ',CAPTION,overlib_questlink,STICKY,NOCLOSE,WRAP,OFFSETX,5,OFFSETY,5);"')); $query = "SELECT `q`.`zone`, `q`.`quest_name`, `q`.`quest_level`, `q`.`quest_tag`, `q`.`is_complete`, `p`.`name`, `p`.`server`, `p`.`member_id`, `p`.`level`" . " FROM `" . $roster->db->table('quests') . "` AS q, `" . $roster->db->table('players') . "` AS p" . " WHERE `p`.`server` = '" . $roster->db->escape($roster->data['server']) . "' AND `q`.`member_id` = `p`.`member_id` AND `q`.`quest_name` = '" . addslashes($qnrow['quest_name']) . "'" . " ORDER BY `q`.`zone`, `q`.`quest_name`, `q`.`quest_level`, `p`.`name`;"; $result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query); while ($row = $roster->db->fetch($result)) { $quest_tags = $tagstring = ''; if ($row['quest_tag']) { $quest_tags[] = $row['quest_tag']; } if ($row['is_complete'] == 1) { $quest_tags[] = $roster->locale->act['complete']; } elseif ($row['is_complete'] == -1) { $quest_tags[] = $roster->locale->act['failed']; } if (is_array($quest_tags)) {