示例#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;
}
示例#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();
示例#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;
}
示例#4
0
//quest.php
include "includes/common.php";
if (!empty($_REQUEST["i"])) {
    $id = $_REQUEST["i"];
} else {
    die("No quest specified!");
}
$sql = sprintf("call sp_getquest(%s);", $id);
$db = DB_GetConnection();
if ($db->multi_query($sql)) {
    $result = $db->store_result();
}
$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
示例#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();
}
示例#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();
示例#7
0
                    //Yay! File was uploaded and moved successfully
                    $msg = doOkMsg("File upload worked! Thank you for feeding WoW Monkey!");
                } else {
                    //could not move the temp file for some reason
                    $msg = doErrMsg("File upload failed! Could not move temp file.");
                }
            } else {
                //file is not with our select list
                $msg = doErrMsg("File upload failed! Invalid file.");
            }
        } else {
            //could not open the temp file for some reason
            $msg = doErrMsg("File upload failed! Could not read uploaded file.");
        }
    } else {
        //a file upload error occured
        $msg = "File upload failed!";
        if ($err == 1 || $err == 2) {
            $msg .= " Maximum file size exceeded.";
        }
        $msg = doErrMsg($msg);
    }
}
$skin = new skin("upload.skn");
$url = "upload.php";
$skin->token("FORM_ACTION", $url);
$skin->token("MAX_FILE_SIZE", $max_size);
$skin->token("MAX_MB", $max_size / 1000000);
//for display only
$skin->token("MESSAGE", $msg);
$skin->dump();
示例#8
0
    $id = $_REQUEST["i"];
} else {
    die("No itemset specified!");
}
$sql = sprintf("call sp_getitemset(%s);", $id);
$db = DB_GetConnection();
if ($db->multi_query($sql)) {
    $itemset = $db->store_result();
    if ($db->next_result()) {
        $items = $db->store_result();
    }
}
$db->close();
$i = $itemset->fetch_assoc();
$skin = new skin("itemset.skn");
$skin->token("SET_NAME", $i["itemset_name"]);
//init set stats
$setStrength = 0;
$setAgility = 0;
$setIntellect = 0;
$setStamina = 0;
$setSpirit = 0;
$setArmor = 0;
//init set resists
$setResHoly = 0;
$setResArcane = 0;
$setResFire = 0;
$setResFrost = 0;
$setResNature = 0;
$setResShadow = 0;
//items in set
示例#9
0
 if ($t == 0 || $t == 1) {
     $sql = "select * from vw_item where item_name like '%" . $s . "%' order by item_name";
     $items = $db->query($sql);
 }
 if ($t == 0 || $t == 2) {
     $sql = "select * from quest where quest_name like '%" . $s . "%' order by quest_name";
     $quests = $db->query($sql);
 }
 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();
示例#10
0
文件: mob.php 项目: geoffb/wowmonkey
<?php

include "includes/common.php";
if (!empty($_REQUEST["i"])) {
    $id = $_REQUEST["i"];
} else {
    die("No mob specified!");
}
//get item data
$db = DB_GetConnection();
$sql = sprintf("select * from mob where mob_id = %s", $id);
$mob = $db->query($sql);
$db->close();
$d = $mob->fetch_assoc();
$skin = new skin("mob.skn");
$skin->setPageTitle(sprintf("Mob: %s", $d["mob_name"]));
$skin->token("MOB_NAME", $d["mob_name"]);
$title = $d["mob_description"];
if (strlen($title) > 0) {
    $title = "&lt;" . $title . "&gt;";
}
$skin->token("MOB_TITLE", $title);
$skin->dump();
$mob->close();