/** * Print the message */ function text($indexName, $extra = FALSE) { include_once "MISC.php"; include_once "../UTF8.php"; $utf8 = new UTF8(); $arrays = $this->loadArrays(); $string = $arrays[$indexName]; $string = $extra ? preg_replace("/###/", $utf8->smartUtf8_decode($extra), $string) : preg_replace("/###/", "", $string); return MISC::p($utf8->encodeUtf8($string), "success", "center"); }
function createUrl() { if (!$this->row['url']) { return FALSE; } $url = htmlspecialchars(stripslashes($this->row['url'])); unset($this->row['url']); return MISC::a('rLink', $url, $url, "_blank"); }
function display() { $this->pString = MISC::h($this->messages->text("heading", "helpStyles"), FALSE, 3); $this->pString .= MISC::aName("top"); $this->pString .= MISC::p(TEXT4); $this->pString .= MISC::p(TEXT5); $this->pString .= MISC::p(TEXT10); $this->pString .= MISC::p(TEXT6); $this->pString .= MISC::p(TEXT7); $this->pString .= MISC::p(MISC::hr()); $this->pString .= MISC::h(SYNTAX_HEADING); $this->pString .= MISC::p(SYNTAX1); $this->pString .= MISC::ol(MISC::li(SYNTAX2) . MISC::li(SYNTAX3) . MISC::li(MISC::b(SYNTAX4) . ' ' . SYNTAX5) . MISC::li(SYNTAX6) . MISC::li(SYNTAX7) . MISC::li(SYNTAX8) . MISC::li(SYNTAX9) . MISC::li(SYNTAX10) . MISC::li(SYNTAX11) . MISC::li(SYNTAX12) . MISC::li(SYNTAX13)); $this->pString .= MISC::p(TEXT11); $this->pString .= MISC::p(MISC::hr()); $this->pString .= MISC::h(EXAMPLE_HEADING); $this->pString .= MISC::p("<code>" . EXAMPLE1 . "</code>" . MISC::BR() . EXAMPLE2 . "</code>" . MISC::BR() . "<code>" . EXAMPLE3 . "</code>"); $this->pString .= MISC::p(EXAMPLE4 . MISC::BR() . "<code>" . EXAMPLE5 . "</code>"); $this->pString .= MISC::hr(); $this->pString .= MISC::p("<code>" . EXAMPLE7 . "</code>" . MISC::BR() . EXAMPLE2 . "</code>" . MISC::BR() . "<code>" . EXAMPLE8 . "</code>"); $this->pString .= MISC::p(EXAMPLE9 . MISC::BR() . "<code>" . EXAMPLE10 . "</code>"); $this->pString .= MISC::hr(); $this->pString .= MISC::p("<code>" . EXAMPLE11 . "</code>" . MISC::BR() . EXAMPLE2 . "</code>" . MISC::BR() . "<code>" . EXAMPLE12 . "</code>"); $this->pString .= MISC::p(EXAMPLE13 . MISC::BR() . "<code>" . EXAMPLE14 . "</code>"); $this->pString .= MISC::hr(); $this->pString .= MISC::p(EXAMPLE15 . MISC::BR() . "<code>" . EXAMPLE16 . "</code>" . MISC::BR() . EXAMPLE2 . MISC::BR() . "<code>" . EXAMPLE17 . "</code>" . MISC::br() . EXAMPLE18 . MISC::br() . "<code>" . EXAMPLE19 . "</code>"); $this->pString .= MISC::p(EXAMPLE20 . MISC::BR() . "<code>" . EXAMPLE21 . "</code>" . MISC::BR() . EXAMPLE2 . MISC::BR() . "<code>" . EXAMPLE22 . "</code>" . MISC::br() . EXAMPLE23 . MISC::br() . "<code>" . EXAMPLE24 . "</code>"); $this->pString .= MISC::p(EXAMPLE25); $this->pString .= MISC::hr(); $this->pString .= MISC::p(TEXT8); $this->pString .= MISC::p(TEXT9); $this->pString .= MISC::p(MISC::a("link", $this->utf8->decodeUtf8($this->messages->text("misc", "top")), "#top"), "small", "right"); return $this->pString; }
/** * Format hyperlinks and clean up citation * @author Mark Grimshaw * * @return string ready for printing to the output medium. */ function hyperLink($citation) { // Ensure we have no preliminary punctuation left over $citation = preg_replace("/^\\s*[.,;:]\\s*/U", "", $citation); if ($this->hyperlinkBase) { $citation = MISC::a("link", $this->export->format(trim($citation)), $this->hyperlinkBase . $this->item['id']); } return $citation; }
/** * Sum heal bonuses from target (jewels, chest and potion) * * @param stdClass $data Data object * * @return float */ public static function sumTargetHealBonus(stdClass $data) { //limit max earrings to 2 self::limit($data, array('oldEarrings', 'newEarrings'), 2); if (!$data->includeTargetBonus) { return 0; } $bonus = 0; $isMw = ($data->chestEnchant == ENCHANT_MW_NINE or $data->chestEnchant == ENCHANT_MW_TWELVE); //earrings $bonus += $data->oldEarrings * BONUS_EARRING_OLD; $bonus += $data->newEarrings * BONUS_EARRING_NEW; //earring bonus stats if ($data->earringBonusLeft) { $bonus += MISC::getEarringBonusValue($data->earringBonusLeft); } if ($data->earringBonusRight) { $bonus += MISC::getEarringBonusValue($data->earringBonusRight); } //heart potion if ($data->heartPotion) { $bonus += BONUS_HEART_POTION; } //if chest is disabled, stop here if ($data->chestType == TYPE_NONE) { return $bonus; } //base (current only) if ($data->chestType == TYPE_CURRENT and $data->chestBonusBase) { $bonus += $isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN; } //+0 (current only) if ($data->chestType == TYPE_CURRENT and $data->chestBonusZero) { $bonus += $isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN; } //plus if ($data->chestType == TYPE_CURRENT and $data->chestBonusPlus and $data->chestEnchant != ENCHANT_NONE) { $bonus += $isMw ? BONUS_CHEST_OLD : BONUS_CHEST_OLD_PLAIN; } elseif ($data->chestBonusPlus and $data->chestEnchant != ENCHANT_NONE) { $bonus += $isMw ? BONUS_CHEST_NEW : BONUS_CHEST_NEW_PLAIN; } return $bonus; }
function createUrl() { if (!$this->row['url']) { return FALSE; } $url = $this->output == 'html' ? htmlspecialchars(stripslashes($this->row['url'])) : stripslashes($this->row['url']); unset($this->row['url']); if ($this->output == 'html') { return MISC::a('rLink', $url, $url, "_blank"); } else { return $url; } }