Make WordPress Core


Ignore:
Timestamp:
09/14/2004 10:02:48 AM (22 years ago)
Author:
saxmatt
Message:

View other's drafts. Still need author editing on the advanced edit form.

File:
1 edited

Legend:

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

    r1579 r1647  
    2626    .</p>
    2727</div>
    28 <?php
    29 }
    30 ?>
     28<?php } ?>
     29
     30<?php
     31if (1 < $user_level) {
     32$editable = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_level <= '$user_level' AND ID != $user_ID");
     33$editable = join($editable, ',');
     34$other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) ");
     35if ($other_drafts) {
     36    ?>
     37<div class="wrap">
     38    <p><strong><?php _e('Other&#8217;s Drafts:') ?></strong>
     39    <?php
     40    $i = 0;
     41    foreach ($other_drafts as $draft) {
     42        if (0 != $i)
     43            echo ', ';
     44        $draft->post_title = stripslashes($draft->post_title);
     45        if ($draft->post_title == '')
     46            $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
     47        echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
     48        ++$i;
     49        }
     50    ?>
     51    .</p>
     52</div>
     53<?php } } ?>
     54
    3155<div class="wrap">
    3256<?php
Note: See TracChangeset for help on using the changeset viewer.