Index: functions.bb-template.php
===================================================================
--- functions.bb-template.php (revision 1903)
+++ functions.bb-template.php (working copy)
@@ -1576,27 +1576,31 @@
if ( !bb_current_user_can( 'delete_post', $bb_post->post_id ) )
return;
- $undelete_uri = bb_get_uri('bb-admin/delete-post.php', array(
- 'id' => $bb_post->post_id,
- 'status' => 0,
- 'view' => 'all'
- ), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
- $undelete_uri = clean_url( bb_nonce_url( $undelete_uri, 'delete-post_' . $bb_post->post_id ) );
+ if ($bb_post->post_status == 1) {
+ $delete_uri = bb_get_uri('bb-admin/delete-post.php', array(
+ 'id' => $bb_post->post_id,
+ 'status' => 1
+ ), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
+ $delete_uri = clean_url( bb_nonce_url( $delete_uri, 'delete-post_' . $bb_post->post_id ) );
- $delete_uri = bb_get_uri('bb-admin/delete-post.php', array(
- 'id' => $bb_post->post_id,
- 'status' => 1
- ), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
- $delete_uri = clean_url( bb_nonce_url( $delete_uri, 'delete-post_' . $bb_post->post_id ) );
+ if ( isset($_GET['view']) && 'all' == $_GET['view'] )
+ $ajax_delete_class = "dim:thread:post-{$bb_post->post_id}:deleted:FF3333:FFFF33:action=delete-post&status=1";
+ else
+ $ajax_delete_class = "delete:thread:post-{$bb_post->post_id}::status=1";
+ $r = "" . __( 'Delete' ) . "";
+ } else {
+ $undelete_uri = bb_get_uri('bb-admin/delete-post.php', array(
+ 'id' => $bb_post->post_id,
+ 'status' => 0,
+ 'view' => 'all'
+ ), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
+ $undelete_uri = clean_url( bb_nonce_url( $undelete_uri, 'delete-post_' . $bb_post->post_id ) );
- $ajax_undelete_class = "dim:thread:post-{$bb_post->post_id}:deleted:FF3333:FFFF33:action=delete-post&status=0";
+ $ajax_undelete_class = "dim:thread:post-{$bb_post->post_id}:deleted:FF3333:FFFF33:action=delete-post&status=0";
- if ( isset($_GET['view']) && 'all' == $_GET['view'] )
- $ajax_delete_class = "dim:thread:post-{$bb_post->post_id}:deleted:FF3333:FFFF33:action=delete-post&status=1";
- else
- $ajax_delete_class = "delete:thread:post-{$bb_post->post_id}::status=1";
+ $r = "" . __( 'Undelete' ). '';
+ }
- $r = "" . __( 'Delete' ) . " " . __( 'Undelete' ). '';
$r = apply_filters( 'post_delete_link', $r, $bb_post->post_status, $bb_post->post_id );
return $r;
}