[wp-cvs] wordpress/wp-admin edit.php,1.31,1.32
Matthew Mullenweg
saxmatt at users.sourceforge.net
Tue Sep 14 11:24:54 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1146/wp-admin
Modified Files:
edit.php
Log Message:
Make the posts page a bit friendlier.
Index: edit.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** edit.php 14 Sep 2004 10:02:48 -0000 1.31
--- edit.php 14 Sep 2004 11:24:50 -0000 1.32
***************
*** 7,14 ****
get_currentuserinfo();
$drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
! if ($drafts) {
! ?>
! <div class="wrap">
<p><strong><?php _e('Your Drafts:') ?></strong>
<?php
--- 7,24 ----
get_currentuserinfo();
+
$drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
! if (1 < $user_level) {
! $editable = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_level <= '$user_level' AND ID != $user_ID");
! $editable = join($editable, ',');
! $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) ");
! } else {
! $other_drafts = false;
! }
!
! if ($drafts || $other_drafts) {
! ?>
! <div class="wrap">
! <?php if ($drafts) { ?>
<p><strong><?php _e('Your Drafts:') ?></strong>
<?php
***************
*** 25,39 ****
?>
.</p>
- </div>
<?php } ?>
! <?php
! if (1 < $user_level) {
! $editable = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE user_level <= '$user_level' AND ID != $user_ID");
! $editable = join($editable, ',');
! $other_drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author IN ($editable) ");
! if ($other_drafts) {
! ?>
! <div class="wrap">
<p><strong><?php _e('Other’s Drafts:') ?></strong>
<?php
--- 35,41 ----
?>
.</p>
<?php } ?>
! <?php if ($other_drafts) { ?>
<p><strong><?php _e('Other’s Drafts:') ?></strong>
<?php
***************
*** 50,67 ****
?>
.</p>
- </div>
- <?php } } ?>
! <div class="wrap">
<?php
! if( isset( $_GET['m'] ) )
! {
! echo '<h2>' . $month[substr( $_GET['m'], 4, 2 )]." ".substr( $_GET['m'], 0, 4 )."</h2>";
}
?>
! <form name="viewarc" action="" method="get" style="float: left; width: 20em;">
<fieldset>
! <legend><?php _e('Show Posts From Month of...') ?></legend>
<select name='m'>
<?php
--- 52,85 ----
?>
.</p>
! <?php } ?>
!
! </div>
! <?php } ?>
!
! <div class="wrap">
! <h2>
<?php
! if ( isset( $_GET['m'] ) ) {
! echo $month[substr( $_GET['m'], 4, 2 )] . ' ' . substr( $_GET['m'], 0, 4 );
! } elseif ( isset( $_GET['s'] ) ) {
! printf(__('Search for “%s”'), $_GET['s']);
! } else {
! _e('Last 15 Posts');
}
?>
+ </h2>
! <form name="searchform" action="" method="get" style="float: left; width: 16em; margin-right: 3em;">
! <fieldset>
! <legend><?php _e('Search Posts…') ?></legend>
! <input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
! <input type="submit" name="submit" value="<?php _e('Search') ?>" />
! </fieldset>
! </form>
!
! <form name="viewarc" action="" method="get" style="float: left; width: 20em; margin-bottom: 1em;">
<fieldset>
! <legend><?php _e('Browse Month…') ?></legend>
<select name='m'>
<?php
***************
*** 85,95 ****
</fieldset>
</form>
- <form name="searchform" action="" method="get" style="float: left; width: 20em; margin-left: 3em;">
- <fieldset>
- <legend><?php _e('Show Posts That Contain...') ?></legend>
- <input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
- <input type="submit" name="submit" value="<?php _e('Search') ?>" />
- </fieldset>
- </form>
<br style="clear:both;" />
--- 103,106 ----
***************
*** 109,113 ****
<?php
$what_to_show = 'posts';
! if (empty($m)) {
$showposts = 15;
} else {
--- 120,124 ----
<?php
$what_to_show = 'posts';
! if ( empty($m) && empty($s) ) {
$showposts = 15;
} else {
More information about the cvs
mailing list