function event_infoline($events) { global $DB; if (!$events || !is_array($events) || count($events) == 0) { return array(); } $entries = array_select_key($events, 'eventEntry'); $rows = $DB->select(' SELECT eventEntry, UNIX_TIMESTAMP(start_time) AS gen_start, UNIX_TIMESTAMP(end_time) AS gen_end, occurence, length, holiday, cat, description AS name, ae.icon as icon, ae.id as id FROM game_event LEFT JOIN aowow_events ae ON ae.id=eventEntry WHERE eventEntry IN (?a)', $entries); // Merge original array with new information $result = array(); foreach ($events as $event) { if (isset($event['eventEntry'])) { $result[$event['eventEntry']] = $event; } } if ($rows) { foreach ($rows as $row) { $result[$row['eventEntry']] = array_merge($result[$row['eventEntry']], $row, event_startend($row['gen_start'], $row['gen_end'], $row['occurence'], $row['length']), array('id' => $row['eventEntry'])); } } return $result; }
', $_SESSION['locale'], $_SESSION['locale'], array(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT), $object['entry'], $_SESSION['locale']); if ($rows) { $object['criteria_of'] = array(); foreach ($rows as $row) { allachievementsinfo2($row['id']); $object['criteria_of'][] = achievementinfo2($row); } } // Положения объектофф: $object['position'] = position($object['entry'], 'gameobject'); // Исправить type, чтобы подсвечивались event-овые объекты if ($object['position']) { foreach ($object['position'] as $z => $zone) { foreach ($zone['points'] as $p => $pos) { if ($pos['type'] == 0 && ($events = event_find(array('object_guid' => $pos['guid'])))) { $names = array_select_key(event_name($events), 'name'); $object['position'][$z]['points'][$p]['type'] = 4; $object['position'][$z]['points'][$p]['events'] = implode(", ", $names); } } } } save_cache(OBJECT_PAGE, $cache_key, $object); } global $page; $page = array('Mapper' => true, 'Book' => $object['pagetext'] ? true : false, 'Title' => $object['name'] . ' - ' . $smarty->get_config_vars('Objects'), 'tab' => 0, 'type' => 2, 'typeid' => $object['entry'], 'username' => $_SESSION['username'], 'path' => path(0, 5, $object['type'])); $smarty->assign('page', $page); // Комментарии $smarty->assign('comments', getcomments($page['type'], $page['typeid'])); $smarty->assign('screenshots', getscreenshots($page['type'], $page['typeid'])); $smarty->assign('wh_ss', get_wowhead_screenshots($page['type'], $page['typeid'], 'page'));
<?php require __DIR__ . '/../../../init.php'; $error = array(); if (empty($_GET['name']) && empty($_POST['name'])) { redirect(); } $name = isset($_GET['name']) ? $_GET['name'] : $_POST['name']; $trick = new Trick($db, $user->get_id()); $tag = new Tag($db, $user->get_id()); $tricks = $trick->by_name($name); $tricks_old = array_select_prefix($tricks); $tags_old = array_select_key($tricks, 'tag_id'); $stances_old = array_select_key($tricks, 'stance'); $directions_old = array_select_key($tricks, 'direction'); $tags_all = $tag->all(); $tags_echo = tag_ids_checkbox_ul($tags_all, $tags_old); if (!$tags_echo) { redirect('/tag/create/index.php?no_tags=1'); } if (isset($_POST['name'])) { if (strlen(validate_name($_POST['name'])) > 0) { $error['name'] = validate_name($_POST['name']); } if (isset($_POST['tag_ids']) && count($_POST['tag_ids']) == 0) { $error['tag_ids'] = 'no tags were selected'; } if (count($error) == 0) { $prefixes = generate_prefixes(array_keys($_POST['stance']), array_keys($_POST['direction']), $_POST['tag_ids']); $delete_tricks = compare_prefixes($tricks_old, $prefixes); $create_tricks = compare_prefixes($prefixes, $tricks_old);