public function main() { $url_data = WoW::GetUrlData('discussion'); $blog_id = $url_data['blog_id']; if (!$blog_id || !WoW_Account::IsLoggedIn()) { if (isset($_GET['d_ref'])) { header('Location: ' . $_GET['d_ref']); } else { header('Location: ' . WoW::GetWoWPath() . '/'); } exit; } $replyToGuid = 0; $replyToComment = 0; $postDetail = isset($_POST['detail']) ? $_POST['detail'] : null; if (isset($_POST['replyTo'])) { // have reply $reply = explode(':', $_POST['replyTo']); if (is_array($reply) && isset($reply[1])) { $replyToGuid = $reply[0]; $replyToComment = $reply[1]; } } if ($postDetail != null) { DB::WoW()->query("INSERT INTO `DBPREFIX_blog_comments` (blog_id, account, character_guid, realm_id, postdate, comment_text, answer_to) VALUES (%d, %d, %d, %d, %d, '%s', %d)", $blog_id, WoW_Account::GetUserID(), WoW_Account::GetActiveCharacterInfo('guid'), WoW_Account::GetActiveCharacterInfo('realmId'), time(), $postDetail, $replyToComment); } if (isset($_GET['d_ref'])) { header('Location: ' . $_GET['d_ref']); } else { header('Location: ' . WoW::GetWoWPath() . '/'); } }
public function action_guild_news() { if (!WoW_Account::IsLoggedIn()) { exit; } $guild_name = WoW_Account::GetActiveCharacterInfo('guildName'); $guild_realm = WoW_Account::GetActiveCharacterInfo('realmId'); if (!$guild_name || !$guild_realm) { exit; } if (!WoW_Guild::LoadGuild($guild_name, $guild_realm)) { exit; } WoW_Template::SetTemplateTheme('wow'); WoW_Template::LoadTemplate('guild_news_page'); }
public function main() { $url_data = WoW::GetUrlData('vault'); // Check session if ($url_data['action0'] != 'vault') { // Wrong URL parsing header('Location: ' . WoW::GetWoWPath() . '/wow/'); exit; } if (!WoW_Account::IsLoggedIn()) { header('Location: ' . WoW::GetWoWPath() . '/login/?ref=' . urlencode($_SERVER['REQUEST_URI'])); exit; } WoW_Template::SetTemplateTheme('wow'); switch ($url_data['action1']) { case 'character': switch ($url_data['action2']) { case 'auction': $auction_side = $url_data['action3']; if (!$auction_side || !in_array($auction_side, array('alliance', 'horde', 'neutral'))) { WoW::RedirectTo('wow/' . WoW_Locale::GetLocale() . '/vault/character/auction/' . WoW_Account::GetActiveCharacterInfo('faction_text')); } // Check active character if (WoW_Account::GetActiveCharacterInfo('guid') == 0) { WoW::RedirectTo(); } switch ($url_data['action4']) { default: WoW_Template::SetPageData('auction_side', $auction_side); WoW_Template::SetPageIndex('auction_lots'); WoW_Template::SetPageData('page', 'auction_lots'); break; case 'cancel': // Cancelling, adding, etc. requires core support! if (!isset($_POST['auc'])) { exit; } $auction_id = (int) $_POST['auc']; header('Content-type: text/plain'); echo WoW_Auction::CancelAuction($auction_id); exit; /* if(isset($_POST['auc'])) { $auction_id = (int) $_POST['auc']; // WoW REMOTE FEATURE } file_put_contents('cancel.txt', print_r($_POST, true)); exit; */ break; } break; default: WoW_Template::ErrorPage(404); break; } break; default: WoW_Template::ErrorPage(404); break; } WoW_Template::LoadTemplate('page_index'); }
</div> <a href="<?php echo $character_url; ?> " class="context-link color-c<?php echo WoW_Account::GetActiveCharacterInfo('class'); ?> " rel="np"><?php echo WoW_Account::GetActiveCharacterInfo('name'); ?> </a> </div> <div class="userCharacter"> <div class="character-desc"> <span><?php echo WoW_Account::GetActiveCharacterInfo('level') . ' ' . WoW_Account::GetActiveCharacterInfo('race_text') . ' ' . WoW_Account::GetActiveCharacterInfo('class_text'); ?> </span> </div> <div class="guild"> <a href="<?php echo $guild_url; ?> "><?php echo $character['guildName']; ?> </a> </div> <!--<div class="achievements">460</div>--> </div> </div>
private static function HandleSellingItems() { if (self::$selling_count <= 0 || !is_array(self::$myitems_storage)) { return false; } $item_ids = array(); $item_ids_guids = array(); $items_data = array(); foreach (self::$myitems_storage as $item) { $item_ids[] = $item['item_template']; $item_ids_guids[$item['itemguid']] = $item['item_template']; $items_data[$item['itemguid']] = $item; } $items = DB::World()->select("SELECT `entry`, `name`, `Quality`, `displayid` FROM `item_template` WHERE `entry` IN (%s)", $item_ids); if (!$items) { return false; } $items_storage = array(); $displayids = array(); foreach ($items as $item) { $items_storage[$item['entry']] = $item; $displayids[] = $item['displayid']; } $icons = DB::WoW()->select("SELECT `displayid`, `icon` FROM `DBPREFIX_icons` WHERE `displayid` IN (%s)", $displayids); if (!$icons) { return false; } $icons_storage = array(); foreach ($icons as $icon) { $icons_storage[$icon['displayid']] = $icon['icon']; } unset($icons); self::$items_storage = array(); self::$buyout_price = 0; foreach ($item_ids_guids as $item_guid => $item_id) { if (isset($items_storage[$item_id])) { $item = new WoW_Item(WoWConfig::$Realms[WoW_Account::GetActiveCharacterInfo('realmId')]['type']); $item->LoadFromDBByEntry($item_guid, $item_id); $auc_time = $items_data[$item_guid]['time']; $now = time(); $auction_time = 0; if ($now - $auc_time <= 48 * IN_HOURS) { $auction_time = 3; } elseif ($now - $auc_time <= 24 * IN_HOURS) { $auction_time = 2; } elseif ($now - $auc_time <= 12 * IN_HOURS) { $auction_time = 1; } self::$items_storage[] = array('auction_id' => $items_data[$item_guid]['id'], 'guid' => $item_guid, 'id' => $items_storage[$item_id]['entry'], 'quality' => $items_storage[$item_id]['Quality'], 'name' => WoW_Locale::GetLocaleId() == LOCALE_EN ? $items_storage[$item_id]['name'] : WoW_Items::GetItemName($item_id), 'icon' => $icons_storage[$items_storage[$item_id]['displayid']], 'price_raw' => $items_data[$item_guid]['startbid'], 'price' => WoW_Utils::GetMoneyFormat($items_data[$item_guid]['startbid']), 'buyout_raw' => $items_data[$item_guid]['buyoutprice'], 'buyout' => WoW_Utils::GetMoneyFormat($items_data[$item_guid]['buyoutprice']), 'lastbid' => $items_data[$item_guid]['lastbid'], 'count' => $item->GetStackCount(), 'time' => $auction_time); self::$buyout_price += $items_data[$item_guid]['buyoutprice']; } } unset($items, $items_storage, $displayids); return true; }
} } ?> </div> </div> </div> <div class="filter"> <input type="input" class="input character-filter" value="<?php echo WoW_Locale::GetString('template_filter_caption'); ?> " alt="<?php echo WoW_Locale::GetString('template_filter_caption'); ?> " /><br /> <a href="javascript:;" onclick="CharSelect.swipe('out', this); return false;"><?php echo WoW_Locale::GetString('template_back_to_characters_list'); ?> </a> </div> </div> </div> </div> </div> <?php if (WoW_Account::GetActiveCharacterInfo('guildId') > 0) { echo sprintf('<div class="guild"><a class="guild-name" href="%s">%s</a></div>', WoW_Account::GetActiveCharacterInfo('guildUrl'), WoW_Account::GetActiveCharacterInfo('guildName')); } ?> </div> </div> <div class="card-overlay"></div> </div>
public function LoadFromDBByEntry($item_guid, $item_template) { $item_data = array('item' => $item_guid, 'slot' => 0, 'item_template' => $item_template, 'bag' => 0, 'enchants' => array()); $this->LoadFromDB($item_data, WoW_Account::GetActiveCharacterInfo('guid')); }
<div class="char-wrapper scrollbar-wrapper" id="scroll"> <div class="scrollbar"> <div class="track"><div class="thumb"></div></div> </div> <div class="viewport"> <div class="overview"> <?php echo sprintf('<a href="javascript:;" class="color-c%d pinned" rel="np" data-tooltip="%s %s (%s)"> <img src="%s/wow/static/images/icons/race/%d-%d.gif" alt="" /> <img src="%s/wow/static/images/icons/class/%d.gif" alt="" /> %d %s </a>', WoW_Account::GetActiveCharacterInfo('class'), WoW_Account::GetActiveCharacterInfo('race_text'), WoW_Account::GetActiveCharacterInfo('class_text'), WoW_Account::GetActiveCharacterInfo('realmName'), WoW::GetWoWPath(), WoW_Account::GetActiveCharacterInfo('race'), WoW_Account::GetActiveCharacterInfo('gender'), WoW::GetWoWPath(), WoW_Account::GetActiveCharacterInfo('class'), WoW_Account::GetActiveCharacterInfo('level'), WoW_Account::GetActiveCharacterInfo('name')); if (is_array($characters)) { foreach ($characters as $char) { if ($char['guid'] == WoW_Account::GetActiveCharacterInfo('guid') && $char['realmId'] == WoW_Account::GetActiveCharacterInfo('realmId')) { continue; // Skip active character } echo sprintf('<a href="%s" class="color-c%d" rel="np" onclick="CharSelect.pin(%d, this); return false;" data-tooltip="%s %s (%s)"> <img src="%s/wow/static/images/icons/race/%d-%d.gif" alt="" /> <img src="%s/wow/static/images/icons/class/%d.gif" alt="" /> %d %s </a>', $char['url'], $char['class'], $char['index'], $char['race_text'], $char['class_text'], $char['realmName'], WoW::GetWoWPath(), $char['race'], $char['gender'], WoW::GetWoWPath(), $char['class'], $char['level'], $char['name']); } } ?> <div class="no-results hide"><?php echo WoW_Locale::GetString('template_characters_not_found'); ?> </div>
</div> <div id="price-tooltip-%d" style="display: none"> <div class="price price-tooltip"> <span class="float-right"> <span class="icon-gold">%d</span> <span class="icon-silver">%d</span> <span class="icon-copper">%d</span> </span> %s <br /><span class="float-right"> <span class="icon-gold">%d</span> <span class="icon-silver">%d</span> <span class="icon-copper">%d</span> </span> %s <span class="clear"><!-- --></span> </div> </div> </td> <td class="options"> <a href="browse?itemId=%d" class="ah-button">%s</a> <a href="javascript:;" class="ah-button" onclick="Auction.openCancel(%d);">%s</a> </td> </tr>', $item['auction_id'], $toggleStyle % 2 ? '1' : '2', $item['name'], WoW::GetWoWPath(), $item['id'], $item['id'], $item['guid'], $item['icon'], WoW::GetWoWPath(), $item['id'], $item['id'], $item['guid'], $item['quality'], $item['name'], WoW_Account::GetActiveCharacterInfo('url'), WoW_Account::GetActiveCharacterInfo('name'), WoW_Locale::GetString('template_auction_you_are_the_seller'), WoW::GetWoWPath(), $item['count'], $item['time'], WoW_Locale::GetString('template_auction_title_time_' . $item['time']), WoW_Locale::GetString('template_auction_text_time_' . $item['time']), WoW_Locale::GetString('template_auction_no_bids'), $item['price_raw'], $item['auction_id'], $item['price']['gold'], $item['price']['silver'], $item['price']['copper'], $item['buyout']['gold'], $item['buyout']['silver'], $item['buyout']['copper'], $item['auction_id'], $item['price']['gold'], $item['price']['silver'], $item['price']['copper'], WoW_Locale::GetString('template_auction_price_per_unit'), $item['buyout']['gold'], $item['buyout']['silver'], $item['buyout']['copper'], WoW_Locale::GetString('template_auction_buyout_per_unit'), $item['id'], WoW_Locale::GetString('template_auction_browse'), $item['auction_id'], WoW_Locale::GetString('template_blog_cancel_report')); ++$toggleStyle; } } ?> </tbody> </table> </div>
<div class="user-name"> <span class="char-name-code" style="display: none"> Тонкс </span> <div id="context-3" class="ui-context character-select"> <div class="context"> <?php echo $primary_character_context; ?> </div> <?php WoW_Template::LoadTemplate('block_user_characters'); ?> </div> <?php echo sprintf('<a href="%s" class="context-link" rel="np">%s</a>', WoW_Account::GetActiveCharacterInfo('url'), WoW_Account::GetActiveCharacterInfo('name')); ?> </div> </div> <div class="content"> <div class="comment-ta"> <textarea id="comment-ta" cols="78" rows="3" name="detail" onfocus="textAreaFocused = true;" onblur="textAreaFocused = false;"></textarea> </div> <div class="action"> <div class="cancel"> <span class="spacer">|</span> <a href="javascript:;" onclick="$('#comment-form-reply').slideUp();"><?php echo WoW_Locale::GetString('template_blog_cancel_report'); ?> </a> </div>
public static function EditPost($post_id, &$post_data) { if (WoW_Account::IsHaveActiveCharacter()) { $post_data['message'] = isset($post_data['postCommand_detail']) ? $post_data['postCommand_detail'] : $post_data['detail']; //self::BBCodesToHTML($post_data['message']); $thread_id = DB::WoW()->selectCell("SELECT `thread_id` FROM `DBPREFIX_forum_posts` WHERE `post_id` = %d LIMIT 1", $post_id); DB::WoW()->query("\n UPDATE `DBPREFIX_forum_posts`\n SET `character_guid` = %d,\n `message` = '%s',\n `edit_date` = NOW()\n WHERE `post_id` = %d AND bn_id = %d", WoW_Account::GetActiveCharacterInfo('guid'), $post_data['message'], $post_id, WoW_Account::GetUserID()); return $thread_id; } else { return false; } }
</b>)</span></span></a> </li> </ul> </div> </div> </div> </div> <div class="profile-contents"> <div class="faction tabard-<?php echo WoW_Template::GetPageData('auction_side'); ?> "> <strong><?php echo WoW_Locale::GetString('faction_' . WoW_Account::GetActiveCharacterInfo('faction_text')); ?> </strong><br /> <a href="<?php echo WoW::GetWoWPath(); ?> /wow/vault/character/auction/neutral/"><?php echo WoW_Locale::GetString('template_auction_switch_to_neutral'); ?> </a> </div> <div class="profile-section-header"> <h3 class="category "><?php