| 86 | | ?> |
|---|
| 87 | | </form> |
|---|
| 88 | | </td> |
|---|
| 89 | | <td> |
|---|
| 90 | | <form name="nextXposts" method="get" action=""> |
|---|
| 91 | | <input type="hidden" name="showposts" value="<?php echo $showposts; ?>" /> |
|---|
| 92 | | <input type="hidden" name="poststart" value="<?php echo $nextXstart; ?>" /> |
|---|
| 93 | | <input type="hidden" name="postend" value="<?php echo $nextXend; ?>" /> |
|---|
| 94 | | <input type="submit" name="submitnext" class="search" value="<?php echo $showposts ?> >" /> |
|---|
| 95 | | </form> |
|---|
| 96 | | </td> |
|---|
| 97 | | </tr> |
|---|
| 98 | | </table> |
|---|
| 99 | | </td> |
|---|
| 100 | | </tr> |
|---|
| 101 | | <tr> |
|---|
| 102 | | <td valign="top" width="200"><!-- show X first/last posts --> |
|---|
| 103 | | <form name="showXfirstlastposts" method="get" action=""> |
|---|
| 104 | | <input type="text" name="showposts" value="<?php echo $showposts ?>" style="width:40px;" /?> |
|---|
| 105 | | <?php |
|---|
| 106 | | if (!isset($order)) |
|---|
| 107 | | $order="DESC"; |
|---|
| 108 | | $i = $order; |
|---|
| 109 | | if ($i == "DESC") |
|---|
| 110 | | $besp_selected = "selected='selected'"; |
|---|
| 111 | | ?> |
|---|
| 112 | | <select name="order"> |
|---|
| 113 | | <option value="DESC" <?php echo $besp_selected ?>>last posts</option> |
|---|
| 114 | | <?php |
|---|
| 115 | | $besp_selected = ""; |
|---|
| 116 | | if ($i == "ASC") |
|---|
| 117 | | $besp_selected = "selected='selected'"; |
|---|
| 118 | | ?> |
|---|
| 119 | | <option value="ASC" <?php echo $besp_selected?>>first posts</option> |
|---|
| 120 | | </select> |
|---|
| 121 | | <input type="submit" name="submitfirstlast" class="search" value="OK" /> |
|---|
| 122 | | </form> |
|---|
| 123 | | </td> |
|---|
| 124 | | <td valign="top"><!-- show post X to post X --> |
|---|
| 125 | | <form name="showXfirstlastposts" method="get" action=""> |
|---|
| 126 | | <input type="text" name="poststart" value="<?php echo $poststart ?>" style="width:40px;" /?> to <input type="text" name="postend" value="<?php echo $postend ?>" style="width:40px;" /?> |
|---|
| 127 | | <select name="order"> |
|---|
| 128 | | <?php |
|---|
| 129 | | $besp_selected = ""; |
|---|
| 130 | | $i = $order; |
|---|
| 131 | | if ($i == "DESC") |
|---|
| 132 | | $besp_selected = "selected='selected'"; |
|---|
| 133 | | ?> |
|---|
| 134 | | <option value="DESC" "<?php echo $besp_selected ?>">from the end</option> |
|---|
| 135 | | <?php |
|---|
| 136 | | $besp_selected = ""; |
|---|
| 137 | | if ($i == "ASC") |
|---|
| 138 | | $besp_selected = "selected='selected'"; |
|---|
| 139 | | ?> <option value="ASC" "<?php echo $besp_selected ?>">from the start</option> |
|---|
| 140 | | </select> |
|---|
| 141 | | <input type="submit" name="submitXtoX" class="search" value="OK" /> |
|---|
| 142 | | </form> |
|---|
| 143 | | </td> |
|---|
| 144 | | </tr> |
|---|
| 145 | | </table> |
|---|
| 146 | | </div> |
|---|
| 147 | | |
|---|
| 148 | | <?php |
|---|
| 149 | | $posts_nav_bar = ob_get_contents(); |
|---|
| 150 | | ob_end_clean(); |
|---|
| 151 | | echo $posts_nav_bar; |
|---|
| 152 | | ?> |
|---|
| 153 | | |
|---|
| 154 | | <div class="wrap"> |
|---|
| 155 | | <table width="100%"> |
|---|
| 156 | | <tr> |
|---|
| 157 | | <td valign="top" width="33%"> |
|---|
| 158 | | <form name="searchform" action="" method="get"> |
|---|
| 159 | | <input type="hidden" name="a" value="s" /> |
|---|
| 160 | | <input onfocus="this.value='';" onblur="if (this.value=='') {this.value='search...';}" type="text" name="s" value="search..." size="7" style="width: 100px;" /> |
|---|
| 161 | | <input type="submit" name="submit" value="search" class="search" /> |
|---|
| 162 | | </form> |
|---|
| 163 | | </td> |
|---|
| 164 | | <td valign="top" width="33%" align="center"> |
|---|
| 165 | | <form name="viewcat" action="" method="get"> |
|---|
| 166 | | <select name="cat" style="width:140px;"> |
|---|
| 167 | | <option value="all">All Categories</option> |
|---|
| 168 | | <?php |
|---|
| 169 | | $categories = $wpdb->get_results("SELECT * FROM $tablecategories"); |
|---|
| 170 | | $width = ($mode=="sidebar") ? "100%" : "170px"; |
|---|
| 171 | | foreach ($categories as $category) { |
|---|
| 172 | | echo "<option value=\"".$category->cat_ID."\""; |
|---|
| 173 | | if ($category->cat_ID == $postdata["Category"]) |
|---|
| 174 | | echo " selected='selected'"; |
|---|
| 175 | | echo ">".$category->cat_name."</option>"; |
|---|
| 176 | | } |
|---|
| 177 | | ?> |
|---|
| 178 | | </select> |
|---|
| 179 | | <input type="submit" name="submit" value="View" class="search" /> |
|---|
| 180 | | </form> |
|---|
| 181 | | </td> |
|---|
| 182 | | <td valign="top" width="33%" align="right"> |
|---|
| 183 | | <form name="viewarc" action="" method="get"> |
|---|
| 184 | | <?php |
|---|
| 185 | | |
|---|
| 186 | | if ($archive_mode == "monthly") { |
|---|
| 187 | | echo "<select name=\"m\" style=\"width:120px;\">"; |
|---|
| 188 | | $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date) FROM $tableposts ORDER BY post_date DESC",ARRAY_A); |
|---|
| 189 | | foreach ($arc_result as $arc_row) { |
|---|
| 190 | | $arc_year = $arc_row["YEAR(post_date)"]; |
|---|
| 191 | | $arc_month = $arc_row["MONTH(post_date)"]; |
|---|
| 192 | | echo "<option value=\"$arc_year".zeroise($arc_month,2)."\">"; |
|---|
| 193 | | echo $month[zeroise($arc_month,2)]." $arc_year"; |
|---|
| 194 | | echo "</option>\n"; |
|---|
| 195 | | } |
|---|
| 196 | | } elseif ($archive_mode == "daily") { |
|---|
| 197 | | echo "<select name=\"d\" style=\"width:120px;\">"; |
|---|
| 198 | | $archive_day_date_format = "Y/m/d"; |
|---|
| 199 | | $arc_result=$wpdb->get_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) FROM $tableposts ORDER BY post_date DESC", ARRAY_A); |
|---|
| 200 | | foreach ($arc_result as $arc_row) { |
|---|
| 201 | | $arc_year = $arc_row["YEAR(post_date)"]; |
|---|
| 202 | | $arc_month = $arc_row["MONTH(post_date)"]; |
|---|
| 203 | | $arc_dayofmonth = $arc_row["DAYOFMONTH(post_date)"]; |
|---|
| 204 | | echo "<option value=\"$arc_year".zeroise($arc_month,2).zeroise($arc_dayofmonth,2)."\">"; |
|---|
| 205 | | echo mysql2date($archive_day_date_format, $arc_year.zeroise($arc_month,2).zeroise($arc_dayofmonth,2)." 00:00:00"); |
|---|
| 206 | | echo "</option>\n"; |
|---|
| 207 | | } |
|---|
| 208 | | } elseif ($archive_mode == "weekly") { |
|---|
| 209 | | echo "<select name=\"w\" style=\"width:120px;\">"; |
|---|
| 210 | | if (!isset($start_of_week)) { |
|---|
| 211 | | $start_of_week = 1; |
|---|
| 212 | | } |
|---|
| 213 | | $archive_week_start_date_format = "Y/m/d"; |
|---|
| 214 | | $archive_week_end_date_format = "Y/m/d"; |
|---|
| 215 | | $archive_week_separator = " - "; |
|---|
| 216 | | $arc_result=$wpdb->geT_results("SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date), WEEK(post_date) FROM $tableposts ORDER BY post_date DESC", ARRAY_A); |
|---|
| 217 | | $arc_w_last = ''; |
|---|
| 218 | | foreach ($arc_result as $arc_row) { |
|---|
| 219 | | $arc_year = $arc_row["YEAR(post_date)"]; |
|---|
| 220 | | $arc_w = $arc_row["WEEK(post_date)"]; |
|---|
| 221 | | if ($arc_w != $arc_w_last) { |
|---|
| 222 | | $arc_w_last = $arc_w; |
|---|
| 223 | | $arc_ymd = $arc_year."-".zeroise($arc_row["MONTH(post_date)"],2)."-" .zeroise($arc_row["DAYOFMONTH(post_date)"],2); |
|---|
| 224 | | $arc_week = get_weekstartend($arc_ymd, $start_of_week); |
|---|
| 225 | | $arc_week_start = date($archive_week_start_date_format, $arc_week['start']); |
|---|
| 226 | | $arc_week_end = date($archive_week_end_date_format, $arc_week['end']); |
|---|
| 227 | | echo "<option value=\"$arc_w\">"; |
|---|
| 228 | | echo $arc_week_start.$archive_week_separator.$arc_week_end; |
|---|
| 229 | | echo "</option>\n"; |
|---|
| 230 | | } |
|---|
| 231 | | } |
|---|
| 232 | | } elseif ($archive_mode == "postbypost") { |
|---|
| 233 | | echo '<input type="hidden" name="more" value="1" />'; |
|---|
| 234 | | echo '<select name="p" style="width:120px;">'; |
|---|
| 235 | | $resultarc = $wpdb->get_results("SELECT ID,post_date,post_title FROM $tableposts ORDER BY post_date DESC"); |
|---|
| 236 | | foreach ($resultarc as $row) { |
|---|
| 237 | | if ($row->post_date != "0000-00-00 00:00:00") { |
|---|
| 238 | | echo "<option value=\"".$row->ID."\">"; |
|---|
| 239 | | if (strip_tags($row->post_title)) { |
|---|
| 240 | | echo strip_tags(stripslashes($row->post_title)); |
|---|
| 241 | | } else { |
|---|
| 242 | | echo $row->ID; |
|---|
| 243 | | } |
|---|
| 244 | | echo "</option>\n"; |
|---|
| 245 | | } |
|---|
| 246 | | } |
|---|
| 247 | | } |
|---|
| 248 | | |
|---|
| 249 | | echo "</select>"; |
|---|
| 250 | | ?> |
|---|
| 251 | | <input type="submit" name="submit" value="View" class="search" /> |
|---|
| 252 | | </form> |
|---|
| 253 | | </td> |
|---|
| 254 | | </tr> |
|---|
| 255 | | </table> |
|---|
| 256 | | |
|---|
| 257 | | <?php |
|---|
| | 34 | ?> |
|---|
| | 35 | <div class="wrap"> |
|---|
| | 36 | <form name="searchform" action="" method="get"> |
|---|
| | 37 | <fieldset> |
|---|
| | 38 | <legend>Show Posts That Contain...</legend> |
|---|
| | 39 | <input type="text" name="s" value="<?php echo $s; ?>" size="17" /> |
|---|
| | 40 | <input type="submit" name="submit" value="Search" /> |
|---|
| | 41 | </fieldset> |
|---|
| | 42 | </form> |
|---|
| | 43 | <table width="100%" cellpadding="3" cellspacing="3"> |
|---|
| | 44 | <tr> |
|---|
| | 45 | <th scope="col">ID</th> |
|---|
| | 46 | <th scope="col">When</th> |
|---|
| | 47 | <th scope="col">Title</th> |
|---|
| | 48 | <th scope="col">Categories</th> |
|---|
| | 49 | <th scope="col">Comments</th> |
|---|
| | 50 | <th scope="col">Author</th> |
|---|
| | 51 | <th scope="col">Edit</th> |
|---|
| | 52 | <th scope="col">Delete</th> |
|---|
| | 53 | </tr> |
|---|
| | 54 | <?php |
|---|
| 263 | | <p> |
|---|
| 264 | | <strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comments', '1 comment', "% comments") ?></a> |
|---|
| 265 | | <?php |
|---|
| 266 | | if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { |
|---|
| 267 | | echo " - <a href='post.php?action=edit&post=$id"; |
|---|
| 268 | | if ($m) |
|---|
| 269 | | echo "&m=$m"; |
|---|
| 270 | | echo "'>Edit</a>"; |
|---|
| 271 | | echo " - <a href='post.php?action=delete&post=$id' onclick=\"return confirm('You are about to delete this post \'".the_title('','',0)."\'\\n \'OK\' to delete, \'Cancel\' to stop.')\">Delete</a> "; |
|---|
| | 80 | <tr style='background-color: <?php echo $bgcolor; ?>'> |
|---|
| | 81 | <td colspan="8">No posts found.</td> |
|---|
| | 82 | </tr> |
|---|
| | 83 | <?php |
|---|
| | 84 | } // end if ($posts) |
|---|
| | 85 | ?> |
|---|
| | 86 | </table> |
|---|
| | 87 | <?php |
|---|
| | 88 | if (($withcomments) or ($single)) { |
|---|
| | 89 | |
|---|
| | 90 | $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date"); |
|---|
| | 91 | if ($comments) { |
|---|
| | 92 | ?> |
|---|
| | 93 | <h3>Comments</h3> |
|---|
| | 94 | <ol id="comments"> |
|---|
| | 95 | <?php |
|---|
| | 96 | foreach ($comments as $comment) { |
|---|
| | 97 | $comment_status = wp_get_comment_status($comment->comment_ID); |
|---|
| | 98 | ?> |
|---|
| | 99 | |
|---|
| | 100 | <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> > |
|---|
| | 101 | <?php comment_date('Y-n-j') ?> |
|---|
| | 102 | @ |
|---|
| | 103 | <?php comment_time('g:m:s a') ?> |
|---|
| | 104 | <?php |
|---|
| | 105 | if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { |
|---|
| | 106 | echo "[ <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">Edit</a>"; |
|---|
| | 107 | echo " - <a href=\"post.php?action=deletecomment&p=".$post->ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('You are about to delete this comment by \'".$comment->comment_author."\'\\n \'OK\' to delete, \'Cancel\' to stop.')\">Delete</a> "; |
|---|
| | 108 | if ( ('none' != $comment_status) && ($user_level >= 3) ) { |
|---|
| | 109 | if ('approved' == wp_get_comment_status($comment->comment_ID)) { |
|---|
| | 110 | echo " - <a href=\"post.php?action=unapprovecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">Unapprove</a> "; |
|---|
| | 111 | } else { |
|---|
| | 112 | echo " - <a href=\"post.php?action=approvecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">Approve</a> "; |
|---|
| | 113 | } |
|---|
| 284 | | // comments |
|---|
| 285 | | if (($withcomments) or ($single)) { |
|---|
| 286 | | |
|---|
| 287 | | $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date"); |
|---|
| 288 | | if ($comments) { |
|---|
| 289 | | ?> |
|---|
| 290 | | |
|---|
| 291 | | <h3>Comments</h3> |
|---|
| 292 | | <ol id="comments"> |
|---|
| 293 | | <?php |
|---|
| 294 | | foreach ($comments as $comment) { |
|---|
| 295 | | ?> |
|---|
| 296 | | |
|---|
| 297 | | <!-- comment --> |
|---|
| 298 | | <li> |
|---|
| 299 | | <?php |
|---|
| 300 | | $comment_status = wp_get_comment_status($comment->comment_ID); |
|---|
| 301 | | |
|---|
| 302 | | if ("unapproved" == $comment_status) { |
|---|
| 303 | | echo "<span class=\"unapproved\">"; |
|---|
| 304 | | } |
|---|
| 305 | | ?> |
|---|
| 306 | | <?php comment_date('Y/m/d') ?> @ <?php comment_time() ?> |
|---|
| 307 | | <?php |
|---|
| 308 | | if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { |
|---|
| 309 | | echo "[ <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">Edit</a>"; |
|---|
| 310 | | echo " - <a href=\"post.php?action=deletecomment&p=".$post->ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('You are about to delete this comment by \'".$comment->comment_author."\'\\n \'OK\' to delete, \'Cancel\' to stop.')\">Delete</a> "; |
|---|
| 311 | | if ( ('none' != $comment_status) && ($user_level >= 3) ) { |
|---|
| 312 | | if ('approved' == wp_get_comment_status($comment->comment_ID)) { |
|---|
| 313 | | echo " - <a href=\"post.php?action=unapprovecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">Unapprove</a> "; |
|---|
| 314 | | } else { |
|---|
| 315 | | echo " - <a href=\"post.php?action=approvecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">Approve</a> "; |
|---|
| 316 | | } |
|---|
| 317 | | } |
|---|
| 318 | | echo "]"; |
|---|
| 319 | | } // end if any comments to show |
|---|
| 320 | | ?> |
|---|
| 321 | | <br /> |
|---|
| 322 | | <strong><?php comment_author() ?> ( <?php comment_author_email_link() ?> / <?php comment_author_url_link() ?> )</strong> (IP: <?php comment_author_IP() ?>) |
|---|
| 323 | | <?php comment_text() ?> |
|---|
| 324 | | <?php |
|---|
| 325 | | if ("unapproved" == $comment_status) { |
|---|
| 326 | | echo "</span>"; |
|---|
| 327 | | } |
|---|
| 328 | | ?> |
|---|
| 329 | | </li> |
|---|
| 330 | | <!-- /comment --> |
|---|
| 331 | | |
|---|
| 332 | | <?php //end of the loop, don't delete |
|---|
| 333 | | } // end foreach |
|---|
| 334 | | echo '</ol>'; |
|---|
| 335 | | }//end if comments |
|---|
| 336 | | if ($comment_error) |
|---|
| 337 | | echo "<p>Error: please fill the required fields (name & comment)</p>"; |
|---|
| 338 | | ?> |
|---|
| 339 | | |
|---|
| 340 | | <h3>Leave Comment</h3> |
|---|
| 341 | | |
|---|
| 342 | | |
|---|
| 343 | | <!-- form to add a comment --> |
|---|
| 344 | | |
|---|
| 345 | | <form action="<?php echo $siteurl.'/wp-comments-post.php'?>" method="post"> |
|---|
| 346 | | <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> |
|---|
| 347 | | <input type="hidden" name="redirect_to" value="<?php echo $HTTP_SERVER_VARS["REQUEST_URI"]; ?>" /> |
|---|
| 348 | | <input type="text" name="author" class="textarea" value="<?php echo $user_nickname ?>" size="20" tabindex="1" /><br /> |
|---|
| 349 | | <input type="text" name="email" class="textarea" value="<?php echo $user_email ?>" size="20" tabindex="2" /><br /> |
|---|
| 350 | | <input type="text" name="url" class="textarea" value="<?php echo $user_url ?>" size="20" tabindex="3" /><br /> |
|---|
| 351 | | <textarea cols="40" rows="4" name="comment" tabindex="4" class="textarea">comment</textarea><br /> |
|---|
| 352 | | <input type="submit" name="submit" class="buttonarea" value="ok" tabindex="5" /> |
|---|
| 353 | | </form> |
|---|
| 354 | | <!-- /form --> |
|---|
| 355 | | |
|---|
| 356 | | <?php // if you delete this the sky will fall on your head |
|---|
| 357 | | } |
|---|
| 358 | | ?> |
|---|
| 359 | | <br /> |
|---|
| 360 | | |
|---|
| 361 | | <?php |
|---|
| 362 | | |
|---|
| 363 | | } // end b2 loop |
|---|
| 364 | | |
|---|
| 365 | | } else { |
|---|
| 366 | | |
|---|
| 367 | | ?> |
|---|
| 368 | | <p> |
|---|
| 369 | | <strong>No results found.</strong> |
|---|
| 370 | | </p> |
|---|
| 371 | | |
|---|
| 372 | | <?php |
|---|
| 373 | | } // end if ($posts) |
|---|
| 374 | | |
|---|
| | 130 | </li> |
|---|
| | 131 | <!-- /comment --> |
|---|
| | 132 | <?php //end of the loop, don't delete |
|---|
| | 133 | } // end foreach |
|---|
| | 134 | echo '</ol>'; |
|---|
| | 135 | }//end if comments |
|---|