$smarty->assign('is_board_view', FALSE); $simple_posts_html = ''; foreach ($posts as $p) { // Find if author of this post is admin. $author_admin = posts_is_author_admin($p['user']); // Set default post author name if enabled. if (!$board['force_anonymous'] && $board['default_name'] !== null && $p['name'] === null) { $p['name'] = $board['default_name']; } // Original post or reply. if ($thread['original_post'] == $p['number']) { $original_post_html = post_original_generate_html($smarty, $board, $thread, $p, $posts_attachments, $attachments, false, null, false, null, false, $author_admin, is_geoip_enabled($board), is_postid_enabled($board)); } else { $simple_posts_html .= post_simple_generate_html($smarty, $board, $thread, $p, $posts_attachments, $attachments, false, null, $author_admin, is_geoip_enabled($board), is_postid_enabled($board)); } } favorites_mark_readed($_SESSION['user'], $thread['id']); $smarty->assign('original_post_html', $original_post_html); $smarty->assign('simple_posts_html', $simple_posts_html); $smarty->assign('threads_html', $smarty->fetch('thread.tpl')); $smarty->assign('hidden_threads', $hidden_threads); $smarty->display('thread_view.tpl'); // Cleanup. DataExchange::releaseResources(); exit(0); } catch (KotobaException $e) { // Cleanup. DataExchange::releaseResources(); display_exception_page($smarty, $e, is_admin() || is_mod()); exit(1); }
} // Perform action. $action = $_REQUEST['action']; $thread = isset($_REQUEST['thread']) ? $_REQUEST['thread'] : NULL; switch ($action) { case 'add': favorites_add($_SESSION['user'], threads_check_id($thread)); break; case 'delete': favorites_delete($_SESSION['user'], threads_check_id($thread)); break; case 'mark_readed': favorites_mark_readed($_SESSION['user'], threads_check_id($thread)); break; case 'mark_all_readed': favorites_mark_readed($_SESSION['user']); break; default: break; } // Cleanup. DataExchange::releaseResources(); // Redirection. header('Location: ' . Config::DIR_PATH . '/edit_settings.php'); exit(0); } catch (KotobaException $e) { // Cleanup. DataExchange::releaseResources(); display_exception_page($smarty, $e, is_admin() || is_mod()); exit(1); }