Dotclear


Ignore:
Timestamp:
07/31/12 13:18:23 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
sexy
Message:

sexy step 1 : no more comments ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.pager.php

    r270 r848  
    4949               '<th>'.__('Category').'</th>'. 
    5050               '<th>'.__('Author').'</th>'. 
    51                '<th>'.__('Comments').'</th>'. 
    52                '<th>'.__('Trackbacks').'</th>'. 
    5351               '<th>'.__('Status').'</th>'. 
    5452               '</tr>%s</table>'; 
     
    134132          '<td class="nowrap">'.$cat_title.'</td>'. 
    135133          '<td class="nowrap">'.$this->rs->user_id.'</td>'. 
    136           '<td class="nowrap">'.$this->rs->nb_comment.'</td>'. 
    137           '<td class="nowrap">'.$this->rs->nb_trackback.'</td>'. 
    138134          '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    139135          '</tr>'; 
     
    233229          '<td class="nowrap status">'.$img_status.' '.$selected.' '.$protected.' '.$attach.'</td>'. 
    234230          '</tr>'; 
    235            
    236           return $res; 
    237      } 
    238 } 
    239  
    240 class adminCommentList extends adminGenericList 
    241 { 
    242      public function display($page,$nb_per_page,$enclose_block='') 
    243      { 
    244           if ($this->rs->isEmpty()) 
    245           { 
    246                echo '<p><strong>'.__('No comment').'</strong></p>'; 
    247           } 
    248           else 
    249           { 
    250                $pager = new pager($page,$this->rs_count,$nb_per_page,10); 
    251                $pager->html_prev = $this->html_prev; 
    252                $pager->html_next = $this->html_next; 
    253                $pager->var_page = 'page'; 
    254                 
    255                $html_block = 
    256                '<table><tr>'. 
    257                '<th colspan="2">'.__('Title').'</th>'. 
    258                '<th>'.__('Date').'</th>'. 
    259                '<th>'.__('Author').'</th>'. 
    260                '<th>'.__('Type').'</th>'. 
    261                '<th>'.__('Status').'</th>'. 
    262                '<th>&nbsp;</th>'. 
    263                '</tr>%s</table>'; 
    264                 
    265                if ($enclose_block) { 
    266                     $html_block = sprintf($enclose_block,$html_block); 
    267                } 
    268                 
    269                echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    270                 
    271                $blocks = explode('%s',$html_block); 
    272                 
    273                echo $blocks[0]; 
    274                 
    275                while ($this->rs->fetch()) 
    276                { 
    277                     echo $this->commentLine(); 
    278                } 
    279                 
    280                echo $blocks[1]; 
    281                 
    282                echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 
    283           } 
    284      } 
    285       
    286      private function commentLine() 
    287      { 
    288           global $author, $status, $sortby, $order, $nb_per_page; 
    289            
    290           $author_url = 
    291           'comments.php?n='.$nb_per_page. 
    292           '&amp;status='.$status. 
    293           '&amp;sortby='.$sortby. 
    294           '&amp;order='.$order. 
    295           '&amp;author='.rawurlencode($this->rs->comment_author); 
    296            
    297           $post_url = $this->core->getPostAdminURL($this->rs->post_type,$this->rs->post_id); 
    298            
    299           $comment_url = 'comment.php?id='.$this->rs->comment_id; 
    300            
    301           $comment_dt = 
    302           dt::dt2str($this->core->blog->settings->system->date_format.' - '. 
    303           $this->core->blog->settings->system->time_format,$this->rs->comment_dt); 
    304            
    305           $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 
    306           switch ($this->rs->comment_status) { 
    307                case 1: 
    308                     $img_status = sprintf($img,__('published'),'check-on.png'); 
    309                     break; 
    310                case 0: 
    311                     $img_status = sprintf($img,__('unpublished'),'check-off.png'); 
    312                     break; 
    313                case -1: 
    314                     $img_status = sprintf($img,__('pending'),'check-wrn.png'); 
    315                     break; 
    316                case -2: 
    317                     $img_status = sprintf($img,__('junk'),'junk.png'); 
    318                     break; 
    319           } 
    320            
    321           $comment_author = html::escapeHTML($this->rs->comment_author); 
    322           if (mb_strlen($comment_author) > 20) { 
    323                $comment_author = mb_strcut($comment_author,0,17).'...'; 
    324           } 
    325            
    326           $res = '<tr class="line'.($this->rs->comment_status != 1 ? ' offline' : '').'"'. 
    327           ' id="c'.$this->rs->comment_id.'">'; 
    328            
    329           $res .= 
    330           '<td class="nowrap">'. 
    331           form::checkbox(array('comments[]'),$this->rs->comment_id,'','','',0).'</td>'. 
    332           '<td class="maximal"><a href="'.$post_url.'">'. 
    333           html::escapeHTML($this->rs->post_title).'</a>'. 
    334           ($this->rs->post_type != 'post' ? ' ('.html::escapeHTML($this->rs->post_type).')' : '').'</td>'. 
    335           '<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->comment_dt).'</td>'. 
    336           '<td class="nowrap"><a href="'.$author_url.'">'.$comment_author.'</a></td>'. 
    337           '<td class="nowrap">'.($this->rs->comment_trackback ? __('trackback') : __('comment')).'</td>'. 
    338           '<td class="nowrap status">'.$img_status.'</td>'. 
    339           '<td class="nowrap status"><a href="'.$comment_url.'">'. 
    340           '<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>'; 
    341            
    342           $res .= '</tr>'; 
    343231           
    344232          return $res; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map