Make WordPress Core

Changeset 2701


Ignore:
Timestamp:
07/08/2005 10:59:15 PM (21 years ago)
Author:
matt
Message:

Drafts clean up.

Location:
trunk
Files:
1 added
7 edited

Legend:

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

    r2699 r2701  
    13891389add_action('admin_footer', 'pimp_firefox');
    13901390
     1391function documentation_link( $for ) {
     1392    return;
     1393}
     1394
    13911395?>
  • trunk/wp-admin/admin.php

    r2623 r2701  
    66   
    77require_once(ABSPATH . 'wp-admin/admin-functions.php');
     8require_once(ABSPATH . 'wp-admin/admin-db.php');
    89auth_redirect();
    910
  • trunk/wp-admin/edit.php

    r2646 r2701  
    1010get_currentuserinfo();
    1111
    12 $drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
    13 if (1 < $user_level) {
    14     $editable = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_level <= '$user_level' AND ID != $user_ID");
    15     if( is_array( $editable ) == false )
    16             $other_drafts = '';
    17     else {
    18         $editable = join(',', $editable);
    19         $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) ");
    20     }
    21 } else {
    22     $other_drafts = false;
    23 }
     12$drafts = get_users_drafts( $user_ID );
     13$other_drafts = get_others_drafts( $user_ID);
    2414
    2515if ($drafts || $other_drafts) {
  • trunk/wp-admin/index.php

    r2570 r2701  
    5252<div>
    5353<h3><?php _e('Comments'); ?> <a href="edit-comments.php" title="<?php _e('More comments...'); ?>">&raquo;</a></h3>
     54
     55<?php
     56if ( $numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_approved = '0'") ) :
     57?>
     58<p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s)'), number_format($numcomments) ); ?> &raquo;</a></strong></p>
     59<?php endif; ?>
     60</div>
     61
     62<?php endif; ?>
     63
    5464<ul>
    5565<?php
     
    6171?>
    6272</ul>
    63 <?php
    64 if ( $numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_approved = '0'") ) :
    65 ?>
    66 <p><strong><a href="moderation.php"><?php echo sprintf(__('There are comments in moderation (%s)'), number_format($numcomments) ); ?> &raquo;</a></strong></p>
    67 <?php endif; ?>
    68 </div>
    69 
    70 <?php endif; ?>
    7173
    7274<div>
     
    147149</div>
    148150</div>
    149 <?php
    150 $drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
    151 if ($drafts) {
    152 ?>
    153 <div class="wrap">
    154151
    155     <p><strong><?php _e('Your Drafts:') ?></strong>
    156     <?php
    157     $i = 0;
    158     foreach ($drafts as $draft) {
    159         if (0 != $i)
    160             echo ', ';
    161         $draft->post_title = stripslashes($draft->post_title);
    162         if ($draft->post_title == '')
    163             $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
    164         echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
    165         ++$i;
    166         }
    167     ?>
    168     .</p>
    169 </div>
    170 <?php } ?>
    171152<?php
    172153require('./admin-footer.php');
  • trunk/wp-admin/post.php

    r2692 r2701  
    323323<?php endif; ?>
    324324<?php
    325     if (user_can_create_draft($user_ID)) {
     325    if ( user_can_create_draft($user_ID) ) {
    326326        $action = 'post';
    327327        get_currentuserinfo();
    328         $drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
    329         if ($drafts) {
     328        if ( $drafts = get_users_drafts( $user_ID ) ) {
    330329            ?>
    331330            <div class="wrap">
    332331            <p><strong><?php _e('Your Drafts:') ?></strong>
    333332            <?php
    334             $i = 0;
    335             foreach ($drafts as $draft) {
    336                 if (0 != $i)
     333            for ( $i = 0; $i < 15; $i++ ) {
     334                $draft = $drafts[$i];
     335                if ( 0 != $i )
    337336                    echo ', ';
    338337                $draft->post_title = stripslashes($draft->post_title);
    339                 if ($draft->post_title == '')
     338                if ( empty($draft->post_title) )
    340339                    $draft->post_title = sprintf(__('Post # %s'), $draft->ID);
    341340                echo "<a href='post.php?action=edit&amp;post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
    342                 ++$i;
    343                 }
    344             ?>.</p>
     341            }
     342            ?>
     343            <?php if ( 15 < count($drafts) ) { ?>
     344            , <a href="edit.php"><?php echo sprintf(__('and %s more'), (count($drafts) - 15) ); ?> &raquo;</a>
     345            <?php } ?>
     346            .</p>
    345347            </div>
    346348            <?php
  • trunk/wp-admin/upgrade-schema.php

    r2636 r2701  
    88  category_description longtext NOT NULL,
    99  category_parent bigint(20) NOT NULL default '0',
     10  category_count bigint(20) NOT NULL default '0',
    1011  PRIMARY KEY  (cat_ID),
    1112  KEY category_nicename (category_nicename)
  • trunk/wp-settings.php

    r2700 r2701  
    5050$wpdb->postmeta         = $table_prefix . 'postmeta';
    5151$wpdb->usermeta         = $table_prefix . 'usermeta';
     52
     53$wpdb->prefix           = $table_prefix;
    5254
    5355if ( defined('CUSTOM_USER_TABLE') )
Note: See TracChangeset for help on using the changeset viewer.