Example #1
0
function getThreadHtml($thread_id)
{
    $sql = sprintf("call sp_get_thread(%s)", $thread_id);
    $db = DB_GetConnection();
    if ($db->multi_query($sql)) {
        $thread = $db->store_result();
        if ($db->next_result()) {
            $posts = $db->store_result();
        }
    }
    $db->close();
    $t = $thread->fetch_assoc();
    $skin = new skin("thread.skn");
    $skin->token("THREAD_TITLE", $t["thread_title"]);
    //posts
    $num_rows = $posts->num_rows;
    for ($r = 0; $r < $num_rows; $r++) {
        $p = $posts->fetch_assoc();
        $skin->addRow("posts", $p["post_user_id"], $p["post_message"]);
    }
    $skin->flushRows("posts");
    return $skin->html;
}
Example #2
0
if (!empty($_REQUEST["i"])) {
    $id = $_REQUEST["i"];
} else {
    die("No item specified!");
}
//get item data
$item = DB_GetItem($id);
$d = $item->fetch_assoc();
/*
$thread_id = $d["item_thread_id"];
if($thread_id == 0)
{
	$thread_id = saveThread(0, "User Comments");
	$sql = sprintf("UPDATE item SET item_thread_id = %s WHERE item_id = %s", $thread_id, $id);
	$db = DB_GetConnection();
	$db->query($sql);
	$db->close();
}
*/
$item = buildItemBox($d);
$skin = new skin("item2.skn");
$skin->token("ITEM_NAME", $d["item_name"]);
$skin->token("ITEM_BOX", $item);
$skin->token("ICON_SRC", getIconPath($d["itemdisplay_icon"]));
$skin->addRow("props", "Item ID", $id);
$skin->addRow("props", "Item Level", $d["item_level"]);
$skin->flushRows("props");
//User comments section
//$skin->token("USER_COMMENTS", getThreadHtml($thread_id));
//$skin->token("ADD_COMMENT", getQuickReplyHtml($thread_id));
$skin->dump();
Example #3
0
function buildItemBox($d)
{
    //fill skin file with item data
    $skin = new skin("item_box.skn");
    $skin->token("QUALITY_ID", $d["item_qualityID"]);
    $skin->token("NAME", $d["item_name"]);
    $skin->flag("bond", $d["item_bondID"] > 0);
    $skin->token("BOND_TYPE", Text_BondType($d["item_bondID"]));
    $skin->flag("unique", $d["item_isUnique"] == 1);
    $skin->flag("slot", $d["item_slotID"] > 0);
    $skin->token("SLOT_TYPE", Text_SlotType($d["item_slotID"]));
    $skin->token("SUB_CLASS", $d["itemsubclass_name"]);
    $skin->flag("armor", $d["item_armor"] > 0);
    $skin->token("ARMOR", $d["item_armor"]);
    $skin->flag("dmg1", $d["item_dmg1min"] > 0);
    if ($d["item_dmg1min"] > 0) {
        $speed = $d["item_weaponDelay"] / 1000;
        $dps = ($d["item_dmg1min"] + $d["item_dmg1max"]) / 2 / $speed;
        $skin->token("DMG1_RANGE", sprintf("%s - %s", $d["item_dmg1min"], $d["item_dmg1max"]));
        $skin->token("WEAPON_SPEED", number_format($speed, 2));
        $skin->token("WEAPON_DPS", number_format($dps, 1));
    }
    if ($d["item_statStr"] > 0) {
        $skin->addRow("stats", sprintf("+%s Strength", $d["item_statStr"]));
    }
    if ($d["item_statAgi"] > 0) {
        $skin->addRow("stats", sprintf("+%s Agility", $d["item_statAgi"]));
    }
    if ($d["item_statSta"] > 0) {
        $skin->addRow("stats", sprintf("+%s Stamina", $d["item_statSta"]));
    }
    if ($d["item_statInt"] > 0) {
        $skin->addRow("stats", sprintf("+%s Intellect", $d["item_statInt"]));
    }
    if ($d["item_statSpr"] > 0) {
        $skin->addRow("stats", sprintf("+%s Spirit", $d["item_statSpr"]));
    }
    if ($d["item_resistHoly"] > 0) {
        $skin->addRow("stats", sprintf("+%s Holy Resistance", $d["item_statHoly"]));
    }
    if ($d["item_resistFire"] > 0) {
        $skin->addRow("stats", sprintf("+%s Fire Resistance", $d["item_resistFire"]));
    }
    if ($d["item_resistNature"] > 0) {
        $skin->addRow("stats", sprintf("+%s Nature Resistance", $d["item_resistNature"]));
    }
    if ($d["item_resistFrost"] > 0) {
        $skin->addRow("stats", sprintf("+%s Frost Resistance", $d["item_resistFrost"]));
    }
    if ($d["item_resistShadow"] > 0) {
        $skin->addRow("stats", sprintf("+%s Shadow Resistance", $d["item_resistShadow"]));
    }
    if ($d["item_resistArcane"] > 0) {
        $skin->addRow("stats", sprintf("+%s Arcane Resistance", $d["item_resistArcane"]));
    }
    $skin->flushRows("stats");
    if ($d["item_spell1ID"] > 0) {
        $skin->addRow("spells", Text_SpellTrigger($d["item_spell1TriggerID"]) . ": " . $d["spell1text"], "spell.php?i=" . $d["item_spell1ID"]);
    }
    if ($d["item_spell2ID"] > 0) {
        $skin->addRow("spells", Text_SpellTrigger($d["item_spell2TriggerID"]) . ": " . $d["spell2text"], "spell.php?i=" . $d["item_spell2ID"]);
    }
    if ($d["item_spell3ID"] > 0) {
        $skin->addRow("spells", Text_SpellTrigger($d["item_spell3TriggerID"]) . ": " . $d["spell3text"], "spell.php?i=" . $d["item_spell3ID"]);
    }
    $skin->flushRows("spells");
    $skin->flag("reqlvl", $d["item_reqLevel"] > 1);
    $skin->token("REQ_LEVEL", $d["item_reqLevel"]);
    $skin->flag("quest", $d["item_beginQuestID"] > 0);
    $skin->token("QUEST_URL", sprintf("quest.php?i=%s", $d["item_beginQuestID"]));
    $skin->flag("descrip", $d["item_description"] != null);
    $skin->token("DESCRIPTION", "\"" . $d["item_description"] . "\"");
    $skin->flag("set", $d["item_setID"] > 0);
    $skin->token("SET_NAME", $d["itemset_name"]);
    $skin->token("ITEMSET_URL", sprintf("itemset.php?i=%s", $d["item_setID"]));
    return $skin->html;
}
Example #4
0
}
$db->close();
$d = $result->fetch_assoc();
$skin = new skin("quest.skn");
$skin->token("QUEST_NAME", $d["quest_name"]);
$skin->token("QUEST_DESCRIPTION", $d["quest_description"]);
$skin->token("LEVEL", $d["quest_level"]);
$text = $d["quest_details"];
$text = str_replace('$B', "<br/>", $text);
$text = str_replace('$b', "<br/>", $text);
$skin->token("DETAILS", $text);
//objective section
$skin->flag("obj", !empty($d["quest_objective1"]));
for ($i = 1; $i < 5; $i++) {
    if (!empty($d["quest_objective" . $i])) {
        $skin->addRow("obj", $d["quest_objective" . $i]);
    }
}
$skin->flushRows("obj");
//collect item section
$skin->flag("collect", $d["quest_collectItem1ID"] > 0);
for ($i = 1; $i < 5; $i++) {
    if ($d["quest_collectItem" . $i . "ID"] > 0) {
        $url = sprintf("item2.php?i=%s", $d["quest_collectItem" . $i . "ID"]);
        $item_name = !empty($d["c_name" . $i]) ? $d["c_name" . $i] : "Unknown Item";
        $skin->addRow("collect", $url, $item_name, $d["quest_collectItem" . $i . "Amount"]);
    }
}
$skin->flushRows("collect");
//kill creature section
$skin->flag("mob", $d["quest_killMob1ID"] > 0);
Example #5
0
if (!empty($strtmp)) {
    $db = DB_GetConnection();
    $sql = "select * from vw_item where item_name like '%" . $s . "%' order by item_name";
    $items = $db->query($sql);
    $sql = "select * from quest where quest_name like '%" . $s . "%' order by quest_name";
    $quests = $db->query($sql);
    $db->close();
    $skin = new skin("search_result.skn");
    $box->token("SEARCH_VALUE", $s);
    $skin->token("SEARCH_BOX", $box->html);
    $skin->token("NUM_ITEMS", $items->num_rows);
    $skin->token("NUM_QUESTS", $quests->num_rows);
    for ($r = 0; $r < $items->num_rows; $r++) {
        $d = $items->fetch_assoc();
        $icon = getIconPath($d["itemdisplay_icon"]);
        $skin->addRow("items", buildItemLink($d), $d["item_reqLevel"], $icon);
    }
    $skin->flushRows("items");
    for ($r = 0; $r < $quests->num_rows; $r++) {
        $d = $quests->fetch_assoc();
        $url = sprintf("quest.php?i=%s", $d["quest_id"]);
        $skin->addRow("quests", $d["quest_name"], $url);
    }
    $skin->flushRows("quests");
    $skin->dump();
} else {
    $box->token("SEARCH_VALUE", "");
    $skin = new skin("adv_search.skn");
    $skin->token("STUFF", $box->html);
    $skin->dump();
}
Example #6
0
<?php

include "includes/common.php";
if (!empty($_REQUEST["i"])) {
    $id = $_REQUEST["i"];
} else {
    die("No spell specified!");
}
//get item data
$spell = DB_GetSpell($id);
$d = $spell->fetch_assoc();
$skin = new skin("spell.skn");
$skin->token("SPELL_NAME", $d["spell_name"]);
$skin->token("FINAL_TEXT", $d["spell_final_text"]);
$p = strrpos($d["spellicon_icon"], "\\");
$icon = substr($d["spellicon_icon"], $p + 1);
$skin->token("ICON_SRC", getIconPath($icon));
$skin->addRow("props", "Mana Cost", $d["spell_manacost"]);
$skin->addRow("props", "Max Stack", $d["spell_stackamount"]);
$skin->flushRows("props");
$skin->dump();
Example #7
0
                $setResNature = $setResNature + $d["item_resistNature"];
            }
            if (isset($d["item_resistFrost"])) {
                $setResFrost = $setResFrost + $d["item_resistFrost"];
            }
            if (isset($d["item_resistShadow"])) {
                $setResShadow = $setResShadow + $d["item_resistShadow"];
            }
            if (isset($d["item_resistArcane"])) {
                $setResArcane = $setResArcane + $d["item_resistArcane"];
            }
        } else {
            $h[$r2] = "";
        }
    }
    $skin->addRow("items", $h[0], $h[1], $h[2]);
}
$skin->flushRows("items");
//set bonuses
for ($b = 1; $b <= 8; $b++) {
    if ($i["itemset_spell" . $b . "ID"] > 0) {
        //store the keys since they're usually out of order
        $j[substr($i["itemset_bonus" . $b], -1, 1)] = $b;
    }
}
for ($b = 1; $b <= 8; $b++) {
    if (isset($j[$b])) {
        //and then display them in the correct order
        $skin->addRow("bonus", $i["itemset_bonus" . $j[$b]], $i["spell" . $j[$b] . "text"], "spell.php?i=" . $i["itemset_spell" . $j[$b] . "ID"]);
    }
}
Example #8
0
<?php

include "includes/common.php";
//test comment
$skin = new skin("news.skn");
for ($i = 0; $i < 3; $i++) {
    $skin->addRow("news", "Lorem Ipsum", "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque leo metus, sodales eget, faucibus a, ultrices fringilla, nulla. Donec eleifend, ligula eu feugiat egestas, enim tellus blandit nisl, ut tincidunt lacus diam in mauris. Proin semper ultricies eros. Vestibulum eu est. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque lectus. In placerat lectus gravida urna tempus vestibulum. Curabitur aliquam ultricies lectus. Pellentesque magna erat, aliquet nec, facilisis eget, bibendum a, dui. Aenean massa massa, faucibus nec, interdum quis, ultrices non, odio. Integer porttitor justo in nunc. Ut ac mi ut ante aliquam iaculis. Donec arcu. Phasellus condimentum. Praesent ultricies purus et lorem. Vivamus sodales. Duis quis neque ac leo iaculis aliquet. Nullam eu nulla. Cras luctus.");
}
$skin->flushRows("news");
$skin->dump();
Example #9
0
 if ($t == 0 || $t == 3) {
     $sql = "select * from spell2 where spell_name like '%" . $s . "%' order by spell_name";
     $spells = $db->query($sql);
 }
 $db->close();
 $skin = new skin("search_result.skn");
 $box->token("SEARCH_VALUE", $s);
 $skin->token("SEARCH_BOX", $box->html);
 $skin->token("NUM_ITEMS", $items->num_rows);
 $skin->token("NUM_QUESTS", $quests->num_rows);
 $skin->token("NUM_SPELLS", $spells->num_rows);
 for ($r = 0; $r < $items->num_rows; $r++) {
     $d = $items->fetch_assoc();
     $icon = getIconPath($d["itemdisplay_icon"]);
     if ($d["item_setID"] > 0) {
         $skin->addRow("items", buildItemLink($d), $d["item_reqLevel"], $icon, "<br/>" . buildSetLink($d));
     } else {
         $skin->addRow("items", buildItemLink($d), $d["item_reqLevel"], $icon, "");
     }
 }
 $skin->flushRows("items");
 for ($r = 0; $r < $quests->num_rows; $r++) {
     $d = $quests->fetch_assoc();
     $url = sprintf("quest.php?i=%s", $d["quest_id"]);
     $skin->addRow("quests", $d["quest_name"], $url);
 }
 $skin->flushRows("quests");
 for ($r = 0; $r < $spells->num_rows; $r++) {
     $d = $spells->fetch_assoc();
     $url = sprintf("spell.php?i=%s", $d["spell_id"]);
     $skin->addRow("spells", $d["spell_name"], $url);