Esempio n. 1
0
$itemlist['tier1'] = array(16828, 16829, 16830, 16831, 16833, 16834, 16835, 16836, 16845, 16846, 16847, 16848, 16849, 16850, 16851, 16852, 16795, 16796, 16797, 16798, 16799, 16800, 16801, 16802, 16853, 16854, 16855, 16856, 16857, 16858, 16859, 16860, 16811, 16812, 16813, 16814, 16815, 16816, 16817, 16819, 16820, 16821, 16822, 16823, 16824, 16825, 16826, 16827, 16837, 16838, 16839, 16840, 16841, 16842, 16843, 16844, 16803, 16804, 16805, 16806, 16807, 16808, 16809, 16810, 16861, 16862, 16863, 16864, 16865, 16866, 16867, 16868);
$itemlist['tier2'] = array(16897, 16898, 16899, 16900, 16901, 16902, 16903, 16904, 16935, 16936, 16937, 16938, 16939, 16940, 16941, 16942, 16818, 16912, 16913, 16914, 16915, 16916, 16917, 16918, 16951, 16952, 16953, 16954, 16955, 16956, 16957, 16958, 16919, 16920, 16921, 16922, 16923, 16924, 16925, 16926, 16832, 16905, 16906, 16907, 16908, 16909, 16910, 16911, 16943, 16944, 16945, 16946, 16947, 16948, 16949, 16950, 16927, 16928, 16929, 16930, 16931, 16932, 16933, 16934, 16959, 16960, 16961, 16962, 16963, 16964, 16965, 16966);
$itemlist['tier3'] = array(22488, 22489, 22490, 22491, 22492, 22493, 22494, 22495, 23064, 22436, 22437, 22438, 22439, 22440, 22441, 22442, 22443, 23067, 22496, 22497, 22498, 22499, 22500, 22501, 22502, 22503, 23062, 22424, 22425, 22426, 22427, 22428, 22429, 22430, 22431, 23066, 22512, 22513, 22514, 22515, 22516, 22517, 22518, 22519, 23061, 22476, 22477, 22478, 22479, 22480, 22481, 22482, 22483, 22464, 22465, 22466, 22467, 22468, 22469, 22470, 22471, 22504, 22505, 22506, 22507, 22508, 22509, 22510, 22511, 23063, 22416, 22417, 22418, 22419, 22420, 22421, 22422, 22423, 23059);
$itemlist['zg_loot'] = array(19727, 19852, 19853, 19854, 19855, 19856, 19857, 19859, 19861, 19862, 19863, 19864, 19865, 19866, 19867, 19869, 19870, 19871, 19872, 19873, 19874, 19875, 19876, 19877, 19878, 19884, 19885, 19886, 19887, 19888, 19889, 19890, 19891, 19892, 19893, 19894, 19895, 19896, 19897, 19898, 19899, 19900, 19901, 19902, 19903, 19904, 19905, 19906, 19907, 19908, 19909, 19910, 19912, 19913, 19914, 19915, 19918, 19919, 19920, 19921, 19922, 19923, 19925, 19927, 19928, 19929, 19930, 19944, 19945, 19946, 19947, 19961, 19962, 19963, 19964, 19965, 19967, 19968, 19993, 20032, 20038, 20257, 20258, 20259, 20260, 20261, 20262, 20263, 20264, 20265, 20266, 22711, 22712, 22713, 22714, 22715, 22716, 22718, 22720, 22721, 22722, 22739);
$itemlist['zg_quest'] = array(19610, 19611, 19612, 19613, 19838, 19839, 19840, 19955, 19618, 19619, 19620, 19621, 19831, 19832, 19833, 19953, 19598, 19599, 19600, 19601, 19845, 19846, 19959, 20034, 19579, 19585, 19586, 19588, 19825, 19826, 19827, 19952, 19591, 19592, 19593, 19594, 19841, 19842, 19843, 19958, 19614, 19615, 19616, 19617, 19834, 19835, 19836, 19954, 19606, 19607, 19608, 19609, 19828, 19829, 19830, 19956, 19602, 19603, 19604, 19605, 19848, 19849, 19957, 20033, 19574, 19575, 19576, 19577, 19822, 19823, 19824, 19951, 19948, 19949, 19950);
$status = array();
$updating = false;
if (isset($HTTP_POST_VARS['update']) && $HTTP_POST_VARS['update'] == 1) {
    wow_item_cache_map();
    $updating = true;
    $status[] = $lang['wow_items_status_update'];
}
$precaching = array();
if (isset($HTTP_POST_VARS['precache']) && count($HTTP_POST_VARS['precache']) > 0) {
    foreach ($HTTP_POST_VARS['precache'] as $set) {
        wow_item_cache_item($itemlist[$set]);
        $precaching[] = $set;
        $status[] = str_replace("{SET}", $lang['wow_items_set'][$set], $lang['wow_items_status_precache']);
    }
}
$template->set_filenames(array("body" => "admin/wow_items.tpl"));
foreach ($status as $text) {
    $template->assign_block_vars("status", array("TEXT" => $text));
}
$items = array();
$update_items = $updating ? $lang['wow_items_cache_updating'] : 0;
$update_cached = $updating ? $lang['wow_items_cache_updating'] : 0;
if ($result = $db->sql_query("SELECT item_id FROM " . WOW_ITEMS_TABLE)) {
    if ($result = $db->sql_fetchrowset($result)) {
        $update_items = count($result);
    }
Esempio n. 2
0
function wow_item_bbcode_first_pass($text)
{
    $found_items = array();
    preg_match_all('#\\[item(?:desc)?((?:=[1-9]\\d*)?)\\]([^\\[]+)\\[/item(?:desc)?\\]#is', $text, $matches, PREG_SET_ORDER);
    foreach ($matches as $match) {
        if ($match[1]) {
            $found_items[] = intval(substr($match[1], 1));
        } else {
            if (preg_match('/^[1-9]\\d*$/', $match[2])) {
                $found_items[] = intval($match[2]);
            } else {
                // For items with description matches (e.g. "Eldre'Thalas
                // (Warlock)"), the part in parentheses is ignored during the first
                // pass, to ensure that the data is available to the second pass.
                $found_items = array_merge($found_items, wow_item_search(str_replace("\\'", "'", $match[2]), false));
            }
        }
    }
    // There's no way to gather useful info ahead of time on non-cached items,
    // so we'll cache them on the first pass and process on the second.
    wow_item_cache_item($found_items);
}