Changeset 139
- Timestamp:
- 06/01/2003 12:10:47 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/b2edit.showposts.php
r109 r139 129 129 <option value="all">All Categories</option> 130 130 <?php 131 $query="SELECT * FROM $tablecategories"; 132 $result=mysql_query($query); 131 $categories = $wpdb->get_results("SELECT * FROM $tablecategories"); 133 132 $querycount++; 134 133 $width = ($mode=="sidebar") ? "100%" : "170px"; 135 while($row = mysql_fetch_object($result)) {136 echo "<option value=\"".$ row->cat_ID."\"";137 if ($ row->cat_ID == $postdata["Category"])134 foreach ($categories as $category) { 135 echo "<option value=\"".$category->cat_ID."\""; 136 if ($category->cat_ID == $postdata["Category"]) 138 137 echo " selected='selected'"; 139 138 echo ">".$row->cat_name."</option>"; … … 231 230 include($abspath.'blog.header.php'); 232 231 233 while($row = mysql_fetch_object($result)) {232 foreach ($posts as $post) { 234 233 $posts_per_page = 10; 235 234 start_b2(); ?> 236 235 <p> 237 <strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="b2edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comment', '1 comment', "% comments") ?>< ?php trackback_number('', ', 1 trackback', ', % trackbacks') ?><?php pingback_number('', ', 1 pingback', ', % pingbacks') ?></a>236 <strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="b2edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comment', '1 comment', "% comments") ?></a> 238 237 <?php 239 238 if (($user_level > $authordata[13]) or ($user_login == $authordata[1])) { 240 echo " - <a href= \"b2edit.php?action=edit&post=".$postdata["ID"];239 echo " - <a href='b2edit.php?action=edit&post=$id"; 241 240 if ($m) 242 241 echo "&m=$m"; 243 echo " \">Edit</a>";244 echo " - <a href= \"b2edit.php?action=delete&post=".$postdata["ID"]."\"onclick=\"return confirm('You are about to delete this post \'".$row->post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete</a> ";242 echo "'>Edit</a>"; 243 echo " - <a href='b2edit.php?action=delete&post=$id' onclick=\"return confirm('You are about to delete this post \'".$row->post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete</a> "; 245 244 } 246 245 ?> … … 250 249 <?php permalink_anchor(); ?> 251 250 <?php 252 if ($safe_mode)253 echo "<xmp>";254 251 the_content(); 255 if ($safe_mode)256 echo "</xmp>";257 252 ?> 258 253 </p> … … 262 257 if (($withcomments) or ($c)) { 263 258 264 $queryc = "SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date"; 265 $resultc = mysql_query($queryc); 266 if ($resultc) { 259 $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date"); 260 if ($comments) { 267 261 ?> 268 262 269 <h3 id="comments">comments</h3>270 263 <h3>Comments</h3> 264 <ol id="comments"> 271 265 <?php 272 while($rowc = mysql_fetch_object($resultc)) {273 $commentdata = get_commentdata($rowc->comment_ID);266 foreach ($comments as $comment) { 267 $commentdata = $comment; 274 268 ?> 275 269 276 270 <!-- comment --> 277 < p>271 <li> 278 272 <b><?php comment_author() ?> ( <?php comment_author_email_link() ?> / <?php comment_author_url_link() ?> )</b> (IP: <?php comment_author_IP() ?>) 279 <br />280 273 <?php comment_text() ?> 281 <br />282 274 <?php comment_date('Y/m/d') ?> @ <?php comment_time() ?> 283 275 <?php 284 276 if (($user_level > $authordata[13]) or ($user_login == $authordata[1])) { 285 echo "[ <a href=\"b2edit.php?action=editcomment& comment=".$commentdata["comment_ID"]."\">Edit</a>";286 echo " - <a href=\"b2edit.php?action=deletecomment& p=".$postdata["ID"]."&comment=".$commentdata["comment_ID"]."\">Delete</a> ]";277 echo "[ <a href=\"b2edit.php?action=editcomment&comment=".$commentdata->comment_ID."\">Edit</a>"; 278 echo " - <a href=\"b2edit.php?action=deletecomment&p=".$post->ID."&comment=".$commentdata->comment_ID."\">Delete</a> ]"; 287 279 } 288 280 ?> 289 </ p>281 </li> 290 282 <!-- /comment --> 291 283 … … 293 285 <?php //end of the loop, don't delete 294 286 } 295 287 echo '</ol>'; 296 288 if ($comment_error) 297 echo "<p> <font color=\"red\">Error: please fill the required fields (name & comment)</font></p>";289 echo "<p>Error: please fill the required fields (name & comment)</p>"; 298 290 ?> 299 291
Note: See TracChangeset
for help on using the changeset viewer.