Dotclear

Changeset 1049:1d17674d50ad for admin


Ignore:
Timestamp:
12/02/12 16:04:27 (13 years ago)
Author:
JcDenis
Branch:
default
Message:

Fix #903 : Added action "Delete all spam" to comments page.

Location:
admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/comments.php

    r796 r1049  
    211211     if (!$with_spam) { 
    212212          $spam_count = $core->blog->getComments(array('comment_status'=>-2),true)->f(0); 
    213           if ($spam_count == 1) { 
    214                echo '<p>'.sprintf(__('You have one spam comments.'),'<strong>'.$spam_count.'</strong>').' '. 
    215                '<a href="comments.php?status=-2">'.__('Show it.').'</a></p>'; 
    216           } elseif ($spam_count > 1) { 
    217                echo '<p>'.sprintf(__('You have %s spam comments.'),'<strong>'.$spam_count.'</strong>').' '. 
    218                '<a href="comments.php?status=-2">'.__('Show them.').'</a></p>'; 
     213           
     214          if (!empty($_GET['delspam'])) { 
     215               dcPage::message(__('Spam comments have been successfully deleted.')); 
     216          } 
     217           
     218          if ($spam_count > 0) { 
     219               $moderationTTL = $core->blog->settings->antispam->antispam_moderation_ttl; 
     220                
     221               echo  
     222               '<form action="plugin.php?p=antispam" method="post" class="fieldset">'; 
     223                
     224               if ($spam_count == 1) { 
     225                    echo '<p>'.sprintf(__('You have one spam comments.'),'<strong>'.$spam_count.'</strong>').' '. 
     226                    '<a href="comments.php?status=-2">'.__('Show it.').'</a></p>'; 
     227               } elseif ($spam_count > 1) { 
     228                    echo '<p>'.sprintf(__('You have %s spam comments.'),'<strong>'.$spam_count.'</strong>').' '. 
     229                    '<a href="comments.php?status=-2">'.__('Show them.').'</a></p>'; 
     230               } 
     231                
     232               if ($core->plugins->moduleExists('antispam')) { 
     233                    $spam_redir = 
     234                    'comments.php?type='.$type. 
     235                    '&author='.preg_replace('/%/','%%',$author). 
     236                    '&status='.$status. 
     237                    '&sortby='.$sortby. 
     238                    '&ip='.preg_replace('/%/','%%',$ip). 
     239                    '&order='.$order. 
     240                    '&page='.$page. 
     241                    '&nb='.$nb_per_page; 
     242                     
     243                    echo 
     244                    $core->formNonce(). 
     245                    form::hidden('ts',time()). 
     246                    form::hidden('redir',$spam_redir). 
     247                    '<input name="delete_all_spam" class="delete" type="submit" value="'.__('Delete all spams').'" /></p>'; 
     248               } 
     249                
     250               if ($moderationTTL != null && $moderationTTL >=0) { 
     251                    echo '<p>'.sprintf(__('All spam comments older than %s day(s) will be automatically deleted.'), $moderationTTL).' '. 
     252                    __('You can modify this duration in '). 
     253                    '<a href="blog_pref.php"> '.__('Blog preferences').'</a></p>'; 
     254               } 
     255               echo '</form>'; 
    219256          } 
    220257     } 
  • admin/js/_comments.js

    r1034 r1049  
    115115     $('#form-comments td input[type=checkbox]').enableShiftClick(); 
    116116     dotclear.commentsActionsHelper(); 
     117     $('form input[type=submit][name=delete_all_spam]').click(function(){ 
     118          return window.confirm(dotclear.msg.confirm_spam_delete); 
     119     }); 
    117120}); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map