Make WordPress Core


Ignore:
Timestamp:
10/05/2004 08:27:13 AM (20 years ago)
Author:
saxmatt
Message:

Pages update and tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-pages.php

    r1551 r1747  
    99?>
    1010
    11 <div class="wrap">
    12     <?php echo "<p> <a href='post.php?action=createpage' title='" . __('Create a new page') . "'>Create New Page</a></p>";  ?>
    13 </div>
     11<div class="wrap">
     12<h2><?php _e('Page Management'); ?></h2>
    1413
    15 <div class="wrap">
    16 <form name="searchform" action="" method="get" style="float: left; width: 20em;">
    17   <fieldset>
    18   <legend><?php _e('Show Pages That Contain...') ?></legend>
    19   <input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
    20   <input type="submit" name="submit" value="<?php _e('Search') ?>"  />
    21   </fieldset>
    22 </form>
    23 
    24 <br style="clear:both;" />
    25 
    26 <table width="100%" cellpadding="3" cellspacing="3">
    27   <tr>
    28     <th scope="col"><?php _e('ID') ?></th>
    29     <th scope="col"><?php _e('When') ?></th>
    30     <th scope="col"><?php _e('Title') ?></th>
    31     <th scope="col"><?php _e('Author') ?></th>
    32     <th scope="col"></th>
    33     <th scope="col"></th>
    34     <th scope="col"></th>
    35   </tr>
    3614<?php
    37 
    38 include(ABSPATH.'wp-blog-header.php');
    39 
    4015if (isset($user_ID) && ('' != intval($user_ID))) {
    4116    $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_author = $user_ID");
     
    4520
    4621if ($posts) {
     22?>
     23<table width="100%" cellpadding="3" cellspacing="3">
     24  <tr>
     25    <th scope="col"><?php _e('ID') ?></th>
     26    <th scope="col"><?php _e('Title') ?></th>
     27    <th scope="col"><?php _e('Owner') ?></th>
     28    <th scope="col"><?php _e('Updated') ?></th>
     29    <th scope="col"></th>
     30    <th scope="col"></th>
     31    <th scope="col"></th>
     32  </tr>
     33<?php
    4734$bgcolor = '';
    48 foreach ($posts as $post) { start_wp();
     35foreach ($posts as $post) : start_wp();
    4936$class = ('alternate' == $class) ? '' : 'alternate';
    5037?>
    5138  <tr class='<?php echo $class; ?>'>
    5239    <th scope="row"><?php echo $id ?></th>
    53     <td><?php the_time('Y-m-d \<\b\r \/\> g:i:s a'); ?></td>
    5440    <td>
    5541      <?php the_title() ?>
    5642    </td>
    57     <td><?php the_author() ?></td>
     43    <td><?php the_author() ?></td>
     44    <td><?php the_time('Y-m-d g:i a'); ?></td>
    5845    <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit">View</a></td>
    5946    <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    6047    <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td>
    6148  </tr>
     49<?php endforeach; ?>
     50</table>
    6251<?php
    63 }
    6452} else {
    6553?>
    66   <tr style='background-color: <?php echo $bgcolor; ?>'>
    67     <td colspan="8"><?php _e('No pages found.') ?></td>
    68   </tr>
     54<p><?php _e('No pages yet.') ?></p>
    6955<?php
    7056} // end if ($posts)
    7157?>
    72 </table>
     58
     59</div>
     60
    7361<?php
    74 if ( 1 == count($posts) ) {
     62if ($user_level > 0) {
     63    $action = 'post';
     64    get_currentuserinfo();
     65    //set defaults
     66    $post_status = 'static';
     67    $comment_status = get_settings('default_comment_status');
     68    $ping_status = get_settings('default_ping_status');
     69    $post_pingback = get_settings('default_pingback_flag');
    7570
    76     $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id ORDER BY comment_date");
    77     if ($comments) {
    78     ?>
    79 <h3><?php _e('Comments') ?></h3>
    80 <ol id="comments">
    81 <?php
    82 foreach ($comments as $comment) {
    83 $comment_status = wp_get_comment_status($comment->comment_ID);
    84 ?>
     71    include('edit-page-form.php');
     72}
     73?>
    8574
    86 <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> >
    87   <?php comment_date('Y-n-j') ?>
    88   @
    89   <?php comment_time('g:m:s a') ?>
    90   <?php
    91             if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) {
    92                 echo "[ <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" .  __('Edit') . "</a>";
    93                 echo " - <a href=\"post.php?action=deletecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), $comment->comment_author) . "')\">" . __('Delete') . "</a> ";
    94                 if ( ('none' != $comment_status) && ($user_level >= 3) ) {
    95                     if ('approved' == wp_get_comment_status($comment->comment_ID)) {
    96                         echo " - <a href=\"post.php?action=unapprovecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> ";
    97                     } else {
    98                         echo " - <a href=\"post.php?action=approvecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Approve') . "</a> ";
    99                     }
    100                 }
    101                 echo "]";
    102             } // end if any comments to show
    103             ?>
    104   <br />
    105   <strong>
    106   <?php comment_author() ?>
    107   (
    108   <?php comment_author_email_link() ?>
    109   /
    110   <?php comment_author_url_link() ?>
    111   )</strong> (IP:
    112   <?php comment_author_IP() ?>
    113   )
    114   <?php comment_text() ?>
    115 
    116 </li>
    117 <!-- /comment -->
    118 <?php //end of the loop, don't delete
    119         } // end foreach
    120     echo '</ol>';
    121     }//end if comments
    122     ?>
    123 <?php } ?>
    124 </div>
    125 <?php
    126  include('admin-footer.php');
    127 ?>
     75<?php include('admin-footer.php'); ?>
Note: See TracChangeset for help on using the changeset viewer.