2004-04-28 15:49:27 -04:00
< ? php
2004-04-24 00:47:27 -04:00
require_once ( '../wp-includes/wp-l10n.php' );
$title = __ ( 'Posts' );
2003-12-10 19:22:36 -05:00
require_once ( 'admin-header.php' );
2003-10-26 15:34:24 -05:00
?>
2004-02-13 10:36:28 -05:00
< ul id = " adminmenu2 " >
2004-04-24 00:47:27 -04:00
< li >< a href = " edit.php " class = " current " >< ? php _e ( 'Posts' ) ?> </a></li>
2004-07-28 03:18:59 -04:00
< li >< a href = " categories.php " >< ? php _e ( 'Categories' ) ?> </a></li>
2004-04-24 00:47:27 -04:00
< li >< a href = " edit-comments.php " >< ? php _e ( 'Comments' ) ?> </a></li>
2004-07-28 03:18:59 -04:00
< li >< a href = " moderation.php " >< ? php _e ( 'Awaiting Moderation' ) ?> </a></li>
2004-02-13 10:36:28 -05:00
</ ul >
2003-12-31 17:21:50 -05:00
< ? php
get_currentuserinfo ();
2004-05-24 04:22:18 -04:00
$drafts = $wpdb -> get_results ( " SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID " );
2003-12-31 17:21:50 -05:00
if ( $drafts ) {
2004-02-13 10:36:28 -05:00
?>
< div class = " wrap " >
2004-04-24 00:47:27 -04:00
< p >< strong >< ? php _e ( 'Your Drafts:' ) ?> </strong>
2004-02-13 10:36:28 -05:00
< ? php
2003-12-31 17:21:50 -05:00
$i = 0 ;
foreach ( $drafts as $draft ) {
if ( 0 != $i )
echo ', ' ;
$draft -> post_title = stripslashes ( $draft -> post_title );
if ( $draft -> post_title == '' )
2004-04-24 00:47:27 -04:00
$draft -> post_title = sprintf ( __ ( 'Post #%s' ), $draft -> ID );
echo " <a href='post.php?action=edit&post= $draft->ID ' title=' " . __ ( 'Edit this draft' ) . " '> $draft->post_title </a> " ;
2003-12-31 17:21:50 -05:00
++ $i ;
}
2004-02-13 10:36:28 -05:00
?>
.</ p >
</ div >
2003-10-26 15:34:24 -05:00
< ? php
}
2004-02-13 10:36:28 -05:00
?>
< div class = " wrap " >
2004-04-28 04:57:11 -04:00
< ? php
if ( isset ( $_GET [ 'm' ] ) )
{
2004-04-30 03:37:51 -04:00
echo '<h2>' . $month [ substr ( $_GET [ 'm' ], 4 , 2 )] . " " . substr ( $_GET [ 'm' ], 0 , 4 ) . " </h2> " ;
2004-04-28 04:57:11 -04:00
}
?>
< form name = " viewarc " action = " " method = " get " style = " float: left; width: 20em; " >
< fieldset >
2004-04-28 15:49:27 -04:00
< legend >< ? php _e ( 'Show Posts From Month of...' ) ?> </legend>
2004-05-09 01:47:02 -04:00
< select name = 'm' >
2004-04-28 04:57:11 -04:00
< ? php
2004-05-24 04:22:18 -04:00
$arc_result = $wpdb -> get_results ( " SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts ORDER BY post_date DESC " );
2004-04-28 04:57:11 -04:00
foreach ( $arc_result as $arc_row ) {
2004-05-09 01:47:02 -04:00
$arc_year = $arc_row -> yyear ;
$arc_month = $arc_row -> mmonth ;
2004-04-28 04:57:11 -04:00
2004-05-09 01:47:02 -04:00
if ( isset ( $_GET [ 'm' ]) && $arc_year . zeroise ( $arc_month , 2 ) == $_GET [ 'm' ] )
$default = 'selected="selected"' ;
2004-04-28 04:57:11 -04:00
else
$default = null ;
2004-05-09 01:47:02 -04:00
echo " <option $default value= \" " . $arc_year . zeroise ( $arc_month , 2 ) . '">' ;
echo $month [ zeroise ( $arc_month , 2 )] . " $arc_year " ;
2004-04-28 04:57:11 -04:00
echo " </option> \n " ;
}
?>
2004-05-09 01:47:02 -04:00
</ select >
2004-04-28 04:57:11 -04:00
< input type = " submit " name = " submit " value = " <?php _e('Show Month') ?> " />
</ fieldset >
</ form >
2004-04-28 15:49:27 -04:00
< form name = " searchform " action = " " method = " get " style = " float: left; width: 20em; margin-left: 3em; " >
2004-02-13 10:36:28 -05:00
< fieldset >
2004-04-24 00:47:27 -04:00
< legend >< ? php _e ( 'Show Posts That Contain...' ) ?> </legend>
2004-05-07 19:56:33 -04:00
< input type = " text " name = " s " value = " <?php if (isset( $s )) echo $s ; ?> " size = " 17 " />
2004-04-24 00:47:27 -04:00
< input type = " submit " name = " submit " value = " <?php _e('Search') ?> " />
2004-04-28 04:57:11 -04:00
</ fieldset >
</ form >
2004-04-28 15:49:27 -04:00
< br style = " clear:both; " />
2004-04-28 04:57:11 -04:00
2004-02-13 10:36:28 -05:00
< table width = " 100% " cellpadding = " 3 " cellspacing = " 3 " >
< tr >
2004-04-24 00:47:27 -04:00
< th scope = " col " >< ? php _e ( 'ID' ) ?> </th>
< th scope = " col " >< ? php _e ( 'When' ) ?> </th>
< th scope = " col " >< ? php _e ( 'Title' ) ?> </th>
< th scope = " col " >< ? php _e ( 'Categories' ) ?> </th>
< th scope = " col " >< ? php _e ( 'Comments' ) ?> </th>
< th scope = " col " >< ? php _e ( 'Author' ) ?> </th>
2004-07-28 03:18:59 -04:00
< th scope = " col " ></ th >
< th scope = " col " ></ th >
< th scope = " col " ></ th >
2004-02-13 10:36:28 -05:00
</ tr >
2004-05-14 02:19:46 -04:00
< ? php
if ( empty ( $m )) $showposts = 15 ;
2003-12-18 04:36:13 -05:00
include ( ABSPATH . 'wp-blog-header.php' );
2003-10-26 15:34:24 -05:00
if ( $posts ) {
2004-05-09 01:47:02 -04:00
$bgcolor = '' ;
2003-12-18 04:36:13 -05:00
foreach ( $posts as $post ) { start_wp ();
2004-07-06 14:14:42 -04:00
$class = ( 'alternate' == $class ) ? '' : 'alternate' ;
2004-02-13 10:36:28 -05:00
?>
2004-07-06 14:14:42 -04:00
< tr class = '<?php echo $class; ?>' >
2004-02-13 10:36:28 -05:00
< th scope = " row " >< ? php echo $id ?> </th>
< td >< ? php the_time ( 'Y-m-d \<\b\r \/\> g:i:s a' ); ?> </td>
2004-07-28 03:18:59 -04:00
< td >
2004-02-13 10:36:28 -05:00
< ? php the_title () ?>
2004-04-24 00:47:27 -04:00
< ? php if ( 'private' == $post -> post_status ) _e ( ' - <strong>Private</strong>' ); ?> </td>
2004-02-13 10:36:28 -05:00
< td >< ? php the_category ( ',' ); ?> </td>
2004-06-11 14:23:12 -04:00
< td >< a href = " edit.php?p=<?php echo $id ?>&c=1 " >
2004-07-28 03:18:59 -04:00
< ? php comments_number ( __ ( '0' ), __ ( '1' ), __ ( '%' )) ?>
2004-02-13 10:36:28 -05:00
</ a ></ td >
< td >< ? php the_author () ?> </td>
2004-07-28 03:18:59 -04:00
< td >< a href = " <?php the_permalink(); ?> " rel = " permalink " class = " edit " > View </ a ></ td >
2004-04-24 00:47:27 -04:00
< td >< ? php if (( $user_level > $authordata -> user_level ) or ( $user_login == $authordata -> user_login )) { echo " <a href='post.php?action=edit&post= $id ' class='edit'> " . __ ( 'Edit' ) . " </a> " ; } ?> </td>
< td >< ? php if (( $user_level > $authordata -> user_level ) or ( $user_login == $authordata -> user_login )) { echo " <a href='post.php?action=delete&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>
2004-02-13 10:36:28 -05:00
</ tr >
< ? php
}
} else {
2003-10-26 15:34:24 -05:00
?>
2004-02-13 10:36:28 -05:00
< tr style = 'background-color: <?php echo $bgcolor; ?>' >
2004-04-24 00:47:27 -04:00
< td colspan = " 8 " >< ? php _e ( 'No posts found.' ) ?> </td>
2004-02-13 10:36:28 -05:00
</ tr >
< ? php
} // end if ($posts)
?>
</ table >
< ? php
2004-05-09 01:47:02 -04:00
if ( 1 == count ( $posts ) ) {
2003-10-26 15:34:24 -05:00
2004-05-24 04:22:18 -04:00
$comments = $wpdb -> get_results ( " SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id ORDER BY comment_date " );
2004-02-13 10:36:28 -05:00
if ( $comments ) {
?>
2004-04-24 00:47:27 -04:00
< h3 >< ? php _e ( 'Comments' ) ?> </h3>
2004-02-13 10:36:28 -05:00
< ol id = " comments " >
< ? php
foreach ( $comments as $comment ) {
$comment_status = wp_get_comment_status ( $comment -> comment_ID );
?>
< li < ? php if ( " unapproved " == $comment_status ) echo " class='unapproved' " ; ?> >
< ? php comment_date ( 'Y-n-j' ) ?>
@
< ? php comment_time ( 'g:m:s a' ) ?>
< ? php
if (( $user_level > $authordata -> user_level ) or ( $user_login == $authordata -> user_login )) {
2004-04-24 00:47:27 -04:00
echo " [ <a href= \" post.php?action=editcomment&comment= " . $comment -> comment_ID . " \" > " . __ ( 'Edit' ) . " </a> " ;
echo " - <a href= \" post.php?action=deletecomment&p= " . $post -> ID . " &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> " ;
2004-02-13 10:36:28 -05:00
if ( ( 'none' != $comment_status ) && ( $user_level >= 3 ) ) {
if ( 'approved' == wp_get_comment_status ( $comment -> comment_ID )) {
2004-04-24 00:47:27 -04:00
echo " - <a href= \" post.php?action=unapprovecomment&p= " . $post -> ID . " &comment= " . $comment -> comment_ID . " \" > " . __ ( 'Unapprove' ) . " </a> " ;
2004-02-13 10:36:28 -05:00
} else {
2004-04-24 00:47:27 -04:00
echo " - <a href= \" post.php?action=approvecomment&p= " . $post -> ID . " &comment= " . $comment -> comment_ID . " \" > " . __ ( 'Approve' ) . " </a> " ;
2004-02-13 10:36:28 -05:00
}
2003-10-26 15:34:24 -05:00
}
2004-02-13 10:36:28 -05:00
echo " ] " ;
} // end if any comments to show
?>
< br />
< strong >
< ? php comment_author () ?>
(
< ? php comment_author_email_link () ?>
/
< ? php comment_author_url_link () ?>
) </ strong > ( IP :
< ? php comment_author_IP () ?>
)
< ? php comment_text () ?>
</ li >
<!-- / comment -->
< ? php //end of the loop, don't delete
} // end foreach
echo '</ol>' ;
} //end if comments
2003-10-26 15:34:24 -05:00
?>
2004-02-13 10:36:28 -05:00
< ? php } ?>
</ div >
2003-10-26 15:34:24 -05:00
< ? php
2003-12-10 19:22:36 -05:00
include ( 'admin-footer.php' );
2004-02-13 10:36:28 -05:00
?>