Example #1
0
 function makeOverlib($tooltip, $caption = '', $caption_color = '', $mode = 0, $locale = '', $extra_parameters = '')
 {
     global $roster, $tooltips, $tooltipss;
     //$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;
     }
     $this->tooltipss = $this->tooltipss + 1;
     //echo $this->tooltipss;
     $num_of_tips = $this->tooltipss;
     //setTooltip($num_of_tips,$tooltip);
     return 'onmouseover="return overlib(\'' . $tooltip . '\'' . $caption . $extra_parameters . ');" onmouseout="return nd();"';
 }
Example #2
0
         $it = $x->html_tooltip;
         $it = str_replace('<br><br><br>', "<br>", $it);
         $it .= '<br>(debug "' . $item_id . '")';
         $output = $it;
     }
     break;
 case 'spell':
     $spell = $roster->api->Data->getSpellInfo($id);
     if (isset($spell['name'])) {
         $tooltip = '' . $spell['name'] . '<br>';
         $tooltip .= isset($spell['powerCost']) ? $spell['powerCost'] : '';
         $tooltip .= isset($spell['range']) ? '<span style="float:right;">' . $spell['range'] . '</span>' : '';
         $tooltip .= isset($spell['castTime']) ? '<br>' . $spell['castTime'] : '';
         $tooltip .= isset($spell['cooldown']) ? '<span style="float:right;">' . $spell['cooldown'] . '</span>' : '';
         $tooltip .= '<br><div class="color-tooltip-yellow">' . $spell['description'] . '</div>';
         $x = colorTooltip($tooltip, $caption_color = '', $locale = '', true);
         $output = $x;
         //$tooltip;
     } else {
         $output = 'No data?!';
     }
     break;
 case 'talent':
     $sqlg = "SELECT * FROM `api_talents_data` WHERE `talent_id` = '" . $id . "' ";
     $resultg = db_query($sqlg);
     $rowg = $resultg->fetchAssoc();
     $tooltip = '';
     $tooltip .= isset($talent['spell']['cost']) ? $talent['spell']['cost'] : '';
     $tooltip .= isset($talent['spell']['range']) ? '<span style="float:right;">' . $talent['spell']['range'] . '</span>' : '';
     $tooltip .= isset($talent['spell']['castTime']) ? '<br>' . $talent['spell']['castTime'] : '';
     $tooltip .= isset($talent['spell']['cooldown']) ? '<span style="float:right;">' . $talent['spell']['cooldown'] . '</span>' : '';
Example #3
0
/**
 * 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 = '', $type = 'text', $member_id = null)
{
    global $roster, $tooltips;
    $tooltip = stripslashes($tooltip);
    if ($type == 'text') {
        // 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 = addslashes($caption) . '<br>';
            $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;
        }
        //$t =
        return 'data-tooltip="text-' . base64_encode($tooltip) . '" data-caption="' . base64_encode($caption) . '"';
    } else {
        if ($type == 'item') {
            return 'data-tooltip="item-' . $tooltip . (isset($member_id) ? '|' . $member_id : '') . '"';
        } else {
            if ($type == 'talent') {
                return 'data-tooltip="talent-' . $tooltip . '"';
            } else {
                return null;
            }
        }
    }
    //return 'onmouseover="return overlib(overlib_' . $num_of_tips . $caption . $extra_parameters . ');" onmouseout="return nd();"';
}
Example #4
0
 /**
  * Reconstructs item's tooltip from parsed information.
  * All HTML Styling is done in the private _getXX() methods
  *
  */
 function _makeTooltipHTML()
 {
     //
     // if Parse Error fall back to colorToolTip() for tooltip parsing.
     if ($this->isParseError || $this->isParseMode == 'simple') {
         if ($this->DEBUG && $this->isParseError || $this->DEBUG == 2) {
             trigger_error('Item parser data' . '<table class="border_frame" cellpadding="0" cellspacing="1" width="350"><tr><td>' . (!empty($this->DEBUG_junk) ? implode('<br>', $this->DEBUG_junk) : '') . '<hr width="80%" /> ' . str_replace("\n", '<br />', $this->tooltip) . '<hr width="80%" /> ' . '</td></tr></table><br />' . aprint($this->parsed_item, '', true));
         }
         $this->html_tooltip = colorTooltip($this->tooltip . ($this->DEBUG ? '<br />Parsed Simple' : ''), $this->color, $this->locale);
     } else {
         $html_tt = $this->_getCaption();
         if (isset($this->attributes['Conjured'])) {
             $html_tt .= $this->_getConjures();
         }
         if (isset($this->attributes['BindType'])) {
             $html_tt .= $this->_getBindType();
         }
         if (isset($this->attributes['Unique'])) {
             $html_tt .= $this->_getUnique();
         }
         if ($this->isArmor) {
             $html_tt .= $this->_getArmor();
         } elseif ($this->isWeapon) {
             $html_tt .= $this->_getWeapon();
         } elseif ($this->isBag) {
             $html_tt .= $this->_getBag();
         }
         if (isset($this->attributes['ArmorClass'])) {
             $html_tt .= $this->_getArmorClass();
         }
         if (isset($this->attributes['BaseStats'])) {
             $html_tt .= $this->_getBaseStats();
         }
         if (isset($this->attributes['Enchantment'])) {
             $html_tt .= $this->_getEnchantment();
         }
         if (isset($this->attributes['TempEnchantment'])) {
             $html_tt .= $this->_getTempEnchantment();
         }
         if ($this->isSocketable) {
             $html_tt .= $this->_getSockets();
             $html_tt .= $this->_getSocketBonus();
         }
         if (isset($this->attributes['Class'])) {
             $html_tt .= $this->_getRequiredClasses();
         }
         if (isset($this->attributes['Race'])) {
             $html_tt .= $this->_getRequiredRaces();
         }
         if (isset($this->attributes['Durability'])) {
             $html_tt .= $this->_getDurability();
         }
         if (isset($this->attributes['Requires'])) {
             $html_tt .= $this->_getRequired();
         }
         if (isset($this->effects)) {
             $html_tt .= $this->_getPassiveBonus();
         }
         if (isset($this->attributes['Charges'])) {
             $html_tt .= $this->_getItemCharges();
         }
         if ($this->isSetPiece) {
             $html_tt .= $this->_getSetPiece();
             $html_tt .= $this->_getSetBonus();
             $html_tt .= $this->_getInactiveSetBonus();
         }
         if (isset($this->attributes['MadeBy']['Line'])) {
             $html_tt .= $this->_getCrafter();
         }
         if (isset($this->attributes['Restrictions'])) {
             $html_tt .= $this->_getRestrictions();
         }
         if (isset($this->attributes['ItemNote'])) {
             $html_tt .= $this->_getItemNote();
         }
         if (isset($this->attributes['Source'])) {
             $html_tt .= $this->_getSource();
         }
         if (isset($this->attributes['Boss'])) {
             $html_tt .= $this->_getBoss();
         }
         if (isset($this->attributes['DropRate'])) {
             $html_tt .= $this->_getDropRate();
         }
         if ($this->DEBUG && $this->isParseError || $this->DEBUG == 2) {
             trigger_error('<table class="border_frame" cellpadding="0" cellspacing="1" width="350"><tr><td>' . $html_tt . '<hr width="80%" /> ' . str_replace("\n", '<br />', $this->tooltip) . '</td></tr></table><br />' . aprint($this->parsed_item, '', true));
         }
         $this->html_tooltip = $html_tt . ($this->DEBUG ? '<br />Parsed Full' : '');
     }
 }