blog->getAllCommentStatus() as $k => $v) { $status_combo[$v] = (string) $k; } $type_combo = array( __('comment') => '0', __('trackback') => '1' ); $sortby_combo = array( __('Date') => 'comment_dt', __('Entry title') => 'post_title', __('Author') => 'comment_author', __('Status') => 'comment_status' ); $order_combo = array( __('Descending') => 'desc', __('Ascending') => 'asc' ); $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; $nb_per_page = 30; if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { if ($nb_per_page != $_GET['nb']) { $show_filters = true; } $nb_per_page = (integer) $_GET['nb']; } $params = new ArrayObject(); $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page); $params['no_content'] = true; # Actions combo box $combo_action = array(); if ($core->auth->check('publish,contentadmin',$core->blog->id)) { $combo_action[__('publish')] = 'publish'; $combo_action[__('unpublish')] = 'unpublish'; $combo_action[__('mark as pending')] = 'pending'; $combo_action[__('mark as junk')] = 'junk'; } if ($core->auth->check('delete,contentadmin',$core->blog->id)) { $combo_action[__('delete')] = 'delete'; } # --BEHAVIOR-- adminCommentsActionsCombo $core->callBehavior('adminCommentsActionsCombo',array(&$combo_action)); $filterSet = new dcFilterSet('comments','comments.php'); $authorFilter = new textFilter( 'author',__('Author'),'q_author',20,255); $filterSet ->addFilter(new comboFilter( 'status',__('Status'), 'comment_status', $status_combo)) ->addFilter(new booleanFilter( 'type',__('Type'), 'comment_trackback', $type_combo)) ->addFilter($authorFilter) ->addFilter(new textFilter( 'ip',__('IP address'),'comment_ip',20,39)); $core->callBehavior('adminCommentsFilters',$filterSet); $filterSet->setFormValues($_GET); if (isset($_GET['author'])) { $authorFilter->add(); $authorFilter->setValue($_GET['author']); } /* Get comments -------------------------------------------------------- */ try { $nfparams = $params->getArrayCopy(); $filtered = $filterSet->applyFilters($params); $core->callBehavior('adminCommentsParams',$params); $comments = $core->blog->getComments($params); $counter = $core->blog->getComments($params,true); if ($filtered) { $totalcounter = $core->blog->getComments($nfparams,true); $page_title = sprintf(__('Comments and Trackacks / %s filtered out of %s'),$counter->f(0),$totalcounter->f(0)); } else { $page_title = __('Comments and Trackacks'); } $comment_list = new adminCommentList($core,$comments,$counter->f(0)); } catch (Exception $e) { $core->error->add($e->getMessage()); } $filterSet->setColumnsForm($comment_list->getColumnsForm()); /* DISPLAY -------------------------------------------------------- */ $starting_script = dcPage::jsLoad('js/_comments.js').$filterSet->header();; # --BEHAVIOR-- adminCommentsHeaders $starting_script .= $core->callBehavior('adminCommentsHeaders'); dcPage::open(__('Comments and trackbacks'),$starting_script); echo '
'.sprintf(__('You have one spam comments.'),''.$spam_count.'').' '. ''.__('Show it.').'
'; } elseif ($spam_count > 1) { echo ''.sprintf(__('You have %s spam comments.'),''.$spam_count.'').' '. ''.__('Show them.').'
'; } } # Show comments $comment_list->display($page,$nb_per_page, '' ); } dcPage::helpBlock('core_comments'); dcPage::close(); ?>