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 main() { if (!isset($_POST['index']) || !WoW_Account::IsLoggedIn()) { WoW_Template::ErrorPage(404); exit; } $character_index = $_POST['index']; DB::WoW()->query("UPDATE `DBPREFIX_user_characters` SET `isActive` = 0 WHERE `bn_id` = %d", WoW_Account::GetUserID()); // Clear all DB::WoW()->query("UPDATE `DBPREFIX_user_characters` SET `isActive` = 1 WHERE `index` = %d AND `bn_id` = %d", $character_index, WoW_Account::GetUserID()); }
</div> %s </div> </td> </tr> </table> <div class="post-options"> <div class="respond"> %s <a class="ui-button button2 " href="#new-post"><span><span>%s</span></span></a> <a class="ui-button button2 " href="#new-post" onclick="Cms.Topic.quote(%d);"><span><span><span class="icon-quote">%s</span></span></span></a> </div> <span class="clear"><!-- --></span> </div> </div> </div>', $post['post_id'], $post['blizzpost'] ? ' blizzard' : null, $post_num, $post['blizzpost'] ? 'javascript:;' : $character_url, $post['race'], $post['gender'], $post['author'], $post['blizzpost'] ? ' style="display: none; "' : null, $post['author'], $post['guildName'], $character_links, $post['blizzpost'] ? 'javascript:;' : $character_url, $post['blizzpost'] ? null : ' color-c' . $post['class'], $post['author'], $post['blizzpost'] ? ' class="blizzard-title"' : null, $post['blizzpost'] ? WoW_Locale::GetString('template_forum_blizz_title') : $character_description, $post['edit_date'] != null ? sprintf(WoW_Locale::GetString('template_forum_post_edited'), $post['author'], $post['formated_edit_date']) : null, $post['message'], $post_num, $post_num, $post['fully_formated_date'], $post['formated_date'], $blizz_icon_link, $post['bn_id'] == WoW_Account::GetUserID() ? $post_options : null, WoW_Locale::GetString('template_blog_answer'), $post['post_id'], WoW_Locale::GetString('template_forum_post_quote')); } ++$post_num; } } ?> </div> <div class="forum-actions bottom"> <div class="actions-panel"> <?php echo WoW_Paginator::Initialize(WoW_Template::GetPageData('current_page'), WoW_Forums::GetTotalThreadPosts(), 20, 'forum'); echo WoW_Template::NavigationMenu(); ?> <span class="clear"><!-- --></span> </div> </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; } }