Changeset 223:e44ed54b1001 for plugins/antispam/index.php
- Timestamp:
- 05/08/11 21:44:10 (14 years ago)
- Branch:
- default
- Children:
- 224:23ec5a339bcf, 225:411ee50a8664, 249:d0a17b7ca6e0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/antispam/index.php
r3 r223 28 28 throw new Exception(__('Filter does not exist.')); 29 29 } 30 30 31 31 if (!$filters[$_GET['f']]->hasGUI()) { 32 32 throw new Exception(__('Filter has no user interface.')); 33 33 } 34 34 35 35 $filter = $filters[$_GET['f']]; 36 36 $filter_gui = $filter->gui($filter->guiURL()); 37 37 } 38 38 39 39 # Remove all spam 40 40 if (!empty($_POST['delete_all'])) 41 41 { 42 42 $ts = dt::str('%Y-%m-%d %H:%M:%S',$_POST['ts'],$core->blog->settings->system->blog_timezone); 43 43 44 44 dcAntispam::delAllSpam($core,$ts); 45 45 http::redirect($p_url.'&del=1'); 46 46 } 47 47 48 48 # Update filters 49 49 if (isset($_POST['filters_upd'])) … … 55 55 $i++; 56 56 } 57 57 58 58 # Enable active filters 59 59 if (isset($_POST['filters_active']) && is_array($_POST['filters_active'])) { … … 62 62 } 63 63 } 64 64 65 65 # Order filters 66 66 if (!empty($_POST['f_order']) && empty($_POST['filters_order'])) … … 74 74 $order = explode(',',trim($_POST['filters_order'],',')); 75 75 } 76 76 77 77 if (isset($order)) { 78 78 foreach ($order as $i => $f) { … … 80 80 } 81 81 } 82 82 83 83 # Set auto delete flag 84 84 if (isset($_POST['filters_auto_del']) && is_array($_POST['filters_auto_del'])) { … … 87 87 } 88 88 } 89 89 90 90 dcAntispam::$filters->saveFilterOpts($filters_opt); 91 91 http::redirect($p_url.'&upd=1'); … … 116 116 echo '<p><a href="'.$p_url.'">'.__('Return to filters').'</a></p>'; 117 117 printf('<h3>'.__('%s configuration').'</h3>',$filter->name); 118 118 119 119 echo $filter_gui; 120 120 } … … 125 125 $published_count = dcAntispam::countPublishedComments($core); 126 126 $moderationTTL = $core->blog->settings->antispam->antispam_moderation_ttl; 127 127 128 128 echo 129 129 '<form action="'.$p_url.'" method="post">'. 130 130 '<fieldset><legend>'.__('Information').'</legend>'; 131 131 132 132 if (!empty($_GET['del'])) { 133 133 echo '<p class="message">'.__('Spam comments have been successfully deleted.').'</p>'; 134 134 } 135 135 136 136 echo 137 137 '<ul class="spaminfo">'. … … 141 141 $published_count.'</li>'. 142 142 '</ul>'; 143 143 144 144 if ($spam_count > 0) 145 145 { … … 153 153 } 154 154 echo '</fieldset></form>'; 155 156 155 156 157 157 # Filters 158 158 echo 159 159 '<form action="'.$p_url.'" method="post">'. 160 160 '<fieldset><legend>'.__('Available spam filters').'</legend>'; 161 161 162 162 if (!empty($_GET['upd'])) { 163 163 echo '<p class="message">'.__('Filters configuration has been successfully saved.').'</p>'; 164 164 } 165 165 166 166 echo 167 167 '<table class="dragable">'. … … 169 169 '<th>'.__('Order').'</th>'. 170 170 '<th>'.__('Active').'</th>'. 171 '<th>'.__('Auto Del.').'</th>'. 171 '<th>'.__('Auto Del.').'</th>'. 172 172 '<th class="nowrap">'.__('Filter name').'</th>'. 173 173 '<th colspan="2">'.__('Description').'</th>'. 174 174 '</tr></thead>'. 175 175 '<tbody id="filters-list" >'; 176 176 177 177 $i = 0; 178 178 foreach ($filters as $fid => $f) … … 185 185 'title="'.__('Filter configuration').'" /></a>'; 186 186 } 187 187 188 188 echo 189 189 '<tr class="line'.($f->active ? '' : ' offline').'" id="f_'.$fid.'">'. 190 '<td class="handle">'.form::field(array('f_order['.$fid.']'),2,5,(string) $i ).'</td>'.191 '<td class="nowrap">'.form::checkbox(array('filters_active[]'),$fid,$f->active ).'</td>'.192 '<td class="nowrap">'.form::checkbox(array('filters_auto_del[]'),$fid,$f->auto_delete ).'</td>'.190 '<td class="handle">'.form::field(array('f_order['.$fid.']'),2,5,(string) $i, '', '', false, 'title="'.__('position').'"').'</td>'. 191 '<td class="nowrap">'.form::checkbox(array('filters_active[]'),$fid,$f->active, '', '', false, 'title="'.__('Active').'"').'</td>'. 192 '<td class="nowrap">'.form::checkbox(array('filters_auto_del[]'),$fid,$f->auto_delete, '', '', false, 'title="'.__('Auto Del.').'"').'</td>'. 193 193 '<td class="nowrap">'.$f->name.'</td>'. 194 194 '<td class="maximal">'.$f->description.'</td>'. … … 203 203 '<input type="submit" name="filters_upd" value="'.__('Save').'" /></p>'. 204 204 '</fieldset></form>'; 205 206 205 206 207 207 # Syndication 208 208 if (DC_ADMIN_URL) 209 209 { 210 $ham_feed = $core->blog->url.$core->url->getBase('hamfeed').'/'.$code = dcAntispam::getUserCode($core); 210 $ham_feed = $core->blog->url.$core->url->getBase('hamfeed').'/'.$code = dcAntispam::getUserCode($core); 211 211 $spam_feed = $core->blog->url.$core->url->getBase('spamfeed').'/'.$code = dcAntispam::getUserCode($core); 212 212 213 213 echo 214 214 '<fieldset><legend>'.__('Syndication').'</legend>'. … … 224 224 </body> 225 225 </html> 226
Note: See TracChangeset
for help on using the changeset viewer.