posts SET post_status='publish' WHERE $where"; $wpdb->query($sql); foreach($_POST['items'] as $id) do_action('private_to_published', $id); break; case 'private': $msg=sprintf(__('%d postmails han pasado a ser privados'), count($_POST['items'])); $sql="UPDATE $wpdb->posts SET post_status='private' WHERE $where"; $wpdb->query($sql); foreach($_POST['items'] as $id) do_action('published_to_private', $id); break; case 'delete': $msg=sprintf(__('Han sido borrados %d postmails'), count($_POST['items'])); $sql="DELETE from $wpdb->posts WHERE $where"; $wpdb->query($sql); foreach($_POST['items'] as $id) do_action('delete_post', $id); break; case 'spam': $msg=sprintf(__('%d postmails han pasado a ser spam'), count($_POST['items'])); $sql="UPDATE $wpdb->post2cat SET category_id='-1' WHERE $where1"; $wpdb->query($sql); foreach($_POST['items'] as $id){ require('../bm-txt.php'); echo ''.shell_exec('sa-learn --spam ../textfile.txt').'
'; do_action('spam', $id); } break; case 'ham': $msg=sprintf(__('%d postmails han dejado de ser spam'), count($_POST['items'])); $sql="UPDATE $wpdb->post2cat SET category_id='2' WHERE $where1"; $wpdb->query($sql); foreach($_POST['items'] as $id){ require('../bm-txt.php'); echo ''.shell_exec('sa-learn --ham ../textfile.txt').'
'; do_action('ham', $id); } break; } ?>

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"); if( is_array( $editable ) == false ) $editable = array( "1" ); $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; } */ ?>

post_title = stripslashes($draft->post_title); if ($draft->post_title == '') $draft->post_title = sprintf(__('Post #%s'), $draft->ID); echo "$draft->post_title"; ++$i; } ?>

post_title = stripslashes($draft->post_title); if ($draft->post_title == '') $draft->post_title = sprintf(__('Post #%s'), $draft->ID); echo "$draft->post_title"; ++$i; } ?>


get_results("SELECT option_value FROM $wpdb->options WHERE option_name='posts_per_page' AND option_name='what_to_show' ORDER BY option_id asc"); global $posts_per_page; while ($options) { if ($options->option_name=='posts_per_page') $posts_per_page = $options->option_value; else $what_to_show = $options->option_value; } ?>


='$d1' AND post_date<'$d2'"; } // control de selecci� de estado if(isset($_GET['status']) && ($_GET['status']!='all')) { switch($_GET['status']) { case 'publish': $status = " post_status='publish'"; break; case 'private': $status = " post_status='private'"; break; case 'draft': $status = " post_status='draft'"; break; default: break; } } // control de categoria if (isset($_GET['cat']) && $_GET['cat']!='all' ) { $category = $_GET['cat']; $cat = " $wpdb->post2cat.category_id='$category' AND $wpdb->posts.ID=$wpdb->post2cat.post_id"; } // ruta para el paginador $ruta_url = $_SERVER['PHP_SELF']; // control de condicion (where) para las consultas a la BD if ( isset($_GET['m']) ) { // si le paso 'm' le estoy pasando 'm', 'satuts' y 'cat' $where = " WHERE "; // si solo le paso 'm' if ( $_GET['m']!='all' && $_GET['status']=='all' && $_GET['cat']=='all' ) { $where .= $m; // si solo le paso 'status' } else if ( $_GET['m']=='all' && $_GET['status']!='all' && $_GET['cat']=='all' ) { $where .= $status; // si solo le paso 'cat' } else if ( $_GET['m']=='all' && $_GET['status']=='all' && $_GET['cat']!='all' ) { $where .= $cat; // si le paso 'm' y 'status' } else if ( $_GET['m']!='all' && $_GET['status']!='all' && $_GET['cat']=='all' ) { $where .= $m.' AND '.$status; // si le paso 'm' y 'cat' } else if ( $_GET['m']!='all' && $_GET['status']=='all' && $_GET['cat']!='all' ) { $where .= $m.' AND '.$cat; // si le paso 'status' y 'cat' } else if ( $_GET['m']=='all' && $_GET['status']!='all' && $_GET['cat']!='all' ) { $where .= $status.' AND '.$cat; // si le paso todo: 'm', 'status' y 'cat' } else if ( $_GET['m']!='all' && $_GET['status']!='all' && $_GET['cat']!='all' ) { $where .= $m.' AND '.$status.' AND '.$cat; // si no le paso nada } else if ( $_GET['m']=='all' && $_GET['status']=='all' && $_GET['cat']=='all') $where .= '1'; // ruta con parametros $ruta_url .= "?m=".$_GET['m']."&status=".$_GET['status']."&cat=".$_GET['cat'].'&'; } else { // sino le paso parametros, consulta por defecto (inbox, cat=2) $where = " WHERE $wpdb->post2cat.category_id=2 AND $wpdb->posts.ID=$wpdb->post2cat.post_id"; $ruta_url .= "?"; // ruta sin parametros } if (!isset($_GET['paged'])) { $_GET['paged'] = 0; // $_GET['paged'] es la pagina actual } $init = $_GET['paged'] * $posts_per_page; // $init es el primer mail de la p�ina actual // numero de resultados por consutla a la BD $showposts = "LIMIT ".$init.",".$posts_per_page; // consulta BD: // si no filtramos por categoria, solo consultamos a una tabla (posts) if ( $_GET['cat'] == 'all' ) { // numero de mail's $numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts $where"); // obtenci� de mail's $posts = $wpdb->get_results("SELECT ID, post_content, post_title, post_name, post_status, post_author, post_date FROM $wpdb->posts $where ORDER BY post_date DESC $showposts") ; // si filtramos por categoria, consultamos 2 tablas (posts y post2cat) } else { // numero de mail's $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT $wpdb->posts.ID) FROM $wpdb->posts,$wpdb->post2cat $where"); // DISTINCT para no duplicar mail's (un mail puede estar en varias categorias) // obtenci� de mail's $posts = $wpdb->get_results("SELECT DISTINCT $wpdb->posts.ID, $wpdb->posts.post_content, $wpdb->posts.post_title, $wpdb->posts.post_name, $wpdb->posts.post_status, $wpdb->posts.post_author, $wpdb->posts.post_date FROM $wpdb->posts, $wpdb->post2cat $where ORDER BY post_date DESC $showposts") ; } $max_page = ceil($numposts/$posts_per_page)-1; // numero de p�inas // si hay correos if ($posts) { // mostrar paginador echo 'Pagina:
'; if ($_GET['paged'] != 0) { ?> ">Principio Anterior Siguiente Final $numposts) $total = $numposts; else $total = intval($init+$posts_per_page); echo "    Del ".intval($init+1)." al $total de $numposts"; $bgcolor = ''; ?> Marcar todos Desmarcar todos ID; //$class = ('alternate' == $class) ? '' : 'alternate'; if(!bm_is_read($id)) { $class='is_read'; } else { $class='not_read'; } ?>
<> - 80 ? substr($content,0,80-strlen($title)-3)."..." : $content ?> post_status) _e(' - Private'); ?>   
get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id ORDER BY comment_date"); if ($comments) { ?>

    comment_ID); ?>
  1. > @ $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "[ comment_ID."\">" . __('Edit') . ""; echo " - 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') . " "; if ( ('none' != $comment_status) && ($user_level >= 3) ) { if ('approved' == bm_get_comment_status($comment->comment_ID)) { echo " - ID."&comment=".$comment->comment_ID."\">" . __('Unapprove') . " "; } else { echo " - ID."&comment=".$comment->comment_ID."\">" . __('Approve') . " "; } } echo "]"; } // end if any comments to show ?>
    ( / ) (IP: )
  2. '; }//end if comments ?>