function manageStatus() { global $isadmin; $threads = countThreads(); $bans = count(allBans()); $info = $threads . ' ' . plural('thread', $threads) . ', ' . $bans . ' ' . plural('ban', $bans); $output = ''; if ($isadmin && TINYIB_DBMODE == 'mysql' && function_exists('mysqli_connect')) { // Recommend MySQLi $output .= <<<EOF \t<fieldset> \t<legend>Notice</legend> \t<p><b>TINYIB_DBMODE</b> is currently <b>mysql</b> in <b>settings.php</b>, but <a href="http://www.php.net/manual/en/book.mysqli.php">MySQLi</a> is installed. Please change it to <b>mysqli</b>. This will not affect your data.</p> \t</fieldset> EOF; } $reqmod_html = ''; if (TINYIB_REQMOD != 'disable') { $reqmod_post_html = ''; $reqmod_posts = latestPosts(false); foreach ($reqmod_posts as $post) { if ($reqmod_post_html != '') { $reqmod_post_html .= '<tr><td colspan="2"><hr></td></tr>'; } $reqmod_post_html .= '<tr><td>' . buildPost($post, TINYIB_INDEXPAGE) . '</td><td valign="top" align="right"> <table border="0"><tr><td> <form method="get" action="?"><input type="hidden" name="manage" value=""><input type="hidden" name="approve" value="' . $post['id'] . '"><input type="submit" value="Approve" class="managebutton"></form> </td><td> <form method="get" action="?"><input type="hidden" name="manage" value=""><input type="hidden" name="moderate" value="' . $post['id'] . '"><input type="submit" value="More Info" class="managebutton"></form> </td></tr><tr><td align="right" colspan="2"> <form method="get" action="?"><input type="hidden" name="manage" value=""><input type="hidden" name="delete" value="' . $post['id'] . '"><input type="submit" value="Delete" class="managebutton"></form> </td></tr></table> </td></tr>'; } if ($reqmod_post_html != '') { $reqmod_html = <<<EOF \t<fieldset> \t<legend>Pending posts</legend> \t<table border="0" cellspacing="0" cellpadding="0" width="100%"> \t{$reqmod_post_html} \t</table> \t</fieldset> EOF; } } $post_html = ''; $posts = latestPosts(true); foreach ($posts as $post) { if ($post_html != '') { $post_html .= '<tr><td colspan="2"><hr></td></tr>'; } $post_html .= '<tr><td>' . buildPost($post, TINYIB_INDEXPAGE) . '</td><td valign="top" align="right"><form method="get" action="?"><input type="hidden" name="manage" value=""><input type="hidden" name="moderate" value="' . $post['id'] . '"><input type="submit" value="Moderate" class="managebutton"></form></td></tr>'; } $output .= <<<EOF \t<fieldset> \t<legend>Status</legend> \t \t<fieldset> \t<legend>Info</legend> \t<table border="0" cellspacing="0" cellpadding="0" width="100%"> \t<tbody> \t<tr><td> \t\t{$info} \t</td> EOF; if ($isadmin) { $output .= <<<EOF \t<td valign="top" align="right"> \t\t<form method="get" action="?"> \t\t\t<input type="hidden" name="manage"> \t\t\t<input type="hidden" name="update"> \t\t\t<input type="submit" value="Update TinyIB" class="managebutton"> \t\t</form> \t</td> EOF; } $output .= <<<EOF \t</tr> \t</tbody> \t</table> \t</fieldset> \t{$reqmod_html} \t \t<fieldset> \t<legend>Recent posts</legend> \t<table border="0" cellspacing="0" cellpadding="0" width="100%"> \t{$post_html} \t</table> \t</fieldset> \t \t</fieldset> \t<br> EOF; return $output; }
function load_data_request() { if (isset($_REQUEST['currentpost'])) { $currentpost = $_REQUEST['currentpost']; $numpost = $_REQUEST['numpost']; $post_addr = $_REQUEST['post_addr']; $categoy_id = $_REQUEST['categoy_id']; $post_id = $_REQUEST['get_post_id']; if ($post_addr == 1) { $result = latestPosts($currentpost, $numpost); } elseif ($post_addr == 2) { $result = popularPosts($currentpost, $numpost); } elseif ($post_addr == 3) { $result = tagPosts($currentpost, $numpost, $categoy_id); } elseif ($post_addr == 4) { $result = stylelk_request_postpage($currentpost, $numpost, $post_id); } elseif ($_post_addr == 5) { categoryPosts($curentpost, $numpost, $tag_slug); } echo $result; die; } }