Dotclear

Changeset 3263:a2e2eabd0f86


Ignore:
Timestamp:
07/03/16 12:47:07 (9 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add email and web site filters on comments list (admin), closes #995

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/comments.php

    r3182 r3263  
    5454/* Get comments 
    5555-------------------------------------------------------- */ 
    56 $author = isset($_GET['author']) ? $_GET['author'] : ''; 
    57 $status = isset($_GET['status']) ?      $_GET['status'] : ''; 
    58 $type = !empty($_GET['type']) ?         $_GET['type'] : ''; 
    59 $sortby = !empty($_GET['sortby']) ?     $_GET['sortby'] : 'comment_dt'; 
    60 $order = !empty($_GET['order']) ?       $_GET['order'] : 'desc'; 
    61 $ip = !empty($_GET['ip']) ?             $_GET['ip'] : ''; 
     56$author = isset($_GET['author']) ? $_GET['author'] : ''; 
     57$status = isset($_GET['status']) ? $_GET['status'] : ''; 
     58$type   = !empty($_GET['type']) ? $_GET['type'] : ''; 
     59$sortby = !empty($_GET['sortby']) ? $_GET['sortby'] : 'comment_dt'; 
     60$order  = !empty($_GET['order']) ? $_GET['order'] : 'desc'; 
     61$ip     = !empty($_GET['ip']) ? $_GET['ip'] : ''; 
     62$email  = !empty($_GET['email']) ? $_GET['email'] : ''; 
     63$site   = !empty($_GET['site']) ? $_GET['site'] : ''; 
    6264 
    6365$with_spam = $author || $status || $type || $sortby != 'comment_dt' || $order != 'desc' || $ip; 
     
    108110if ($ip) { 
    109111     $params['comment_ip'] = $ip; 
     112     $show_filters = true; 
     113} 
     114 
     115# - email filter 
     116if ($email) { 
     117     $params['comment_email'] = $email; 
     118     $show_filters = true; 
     119} 
     120 
     121# - site filter 
     122if ($site) { 
     123     $params['comment_site'] = $site; 
    110124     $show_filters = true; 
    111125} 
     
    237251     '<p><label for="ip" class="ib">'.__('IP address:').'</label> '. 
    238252     form::field('ip',20,39,html::escapeHTML($ip)).'</p>'. 
     253     '<p><label for="email" class="ib">'.__('Email:').'</label> '. 
     254     form::field('email',20,255,html::escapeHTML($email)).'</p>'. 
     255     '<p><label for="site" class="ib">'.__('Web site:').'</label> '. 
     256     form::field('site',20,255,html::escapeHTML($site)).'</p>'. 
    239257     '</div>'. 
    240258 
     
    276294     form::hidden(array('page'),$page). 
    277295     form::hidden(array('nb'),$nb_per_page). 
     296     form::hidden(array('email'),html::escapeHTML(preg_replace('/%/','%%',$email))). 
     297     form::hidden(array('site'),html::escapeHTML(preg_replace('/%/','%%',$site))). 
    278298     '</div>'. 
    279299 
  • inc/core/class.dc.blog.php

    r3262 r3263  
    20392039          } 
    20402040 
     2041          if (isset($params['comment_email'])) { 
     2042               $comment_email = $this->con->escape(str_replace('*','%',$params['comment_email'])); 
     2043               $strReq .= "AND comment_email LIKE '".$comment_email."' "; 
     2044          } 
     2045 
    20412046          if (isset($params['comment_site'])) { 
    20422047               $comment_site = $this->con->escape(str_replace('*','%',$params['comment_site'])); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map