- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/antispam/inc/class.dc.spamfilter.php
r2322 r2566 20 20 public $auto_delete = false; 21 21 public $help = null; 22 22 23 23 protected $has_gui = false; 24 24 protected $gui_url = null; 25 25 26 26 protected $core; 27 27 28 28 /** 29 29 Object constructor 30 30 31 31 @param core <b>dcCore</b> Dotclear core object 32 32 */ … … 35 35 $this->core =& $core; 36 36 $this->setInfo(); 37 37 38 38 if (!$this->name) { 39 39 $this->name = get_class($this); 40 40 } 41 41 42 42 $this->gui_url = 'plugin.php?p=antispam&f='.get_class($this); 43 43 } 44 44 45 45 /** 46 46 This method is called by the constructor and allows you to change some … … 51 51 $this->description = __('No description'); 52 52 } 53 53 54 54 /** 55 55 This method should return if a comment is a spam or not. If it returns true 56 56 or false, execution of next filters will be stoped. If should return nothing 57 57 to let next filters apply. 58 58 59 59 Your filter should also fill $status variable with its own information if 60 60 comment is a spam. 61 61 62 62 @param type <b>string</b> Comment type (comment or trackback) 63 63 @param author <b>string</b> Comment author … … 73 73 { 74 74 } 75 75 76 76 /** 77 77 This method is called when a non-spam (ham) comment becomes spam or when a 78 78 spam becomes a ham. 79 79 80 80 @param type <b>string</b> Comment type (comment or trackback) 81 81 @param filter <b>string</b> Filter name … … 92 92 { 93 93 } 94 94 95 95 /** 96 96 This method returns filter status message. You can overload this method to 97 97 return a custom message. Message is shown in comment details and in 98 98 comments list. 99 99 100 100 @param status <b>string</b> Filter status. 101 101 @param comment_id <b>record</b> Comment record … … 106 106 return sprintf(__('Filtered by %1$s (%2$s)'),$this->guiLink(),$status); 107 107 } 108 108 109 109 /** 110 110 This method is called when you enter filter configuration. Your class should 111 111 have $has_gui property set to "true" to enable GUI. 112 112 113 113 In this method you should put everything related to filter configuration. 114 114 $url variable is the URL of GUI <i>unescaped</i>. 115 115 116 116 @param url <b>string</b> GUI URL. 117 117 */ … … 119 119 { 120 120 } 121 121 122 122 public function hasGUI() 123 123 { … … 125 125 return false; 126 126 } 127 127 128 128 if (!$this->has_gui) { 129 129 return false; 130 130 } 131 131 132 132 return true; 133 133 } 134 134 135 135 public function guiURL() 136 136 { … … 138 138 return false; 139 139 } 140 140 141 141 return $this->gui_url; 142 142 } 143 143 144 144 /** 145 145 Returns a link to filter GUI if exists or only filter name if has_gui 146 146 property is false. 147 147 148 148 @return <b>string</b> 149 149 */ … … 156 156 $link = '%1$s'; 157 157 } 158 158 159 159 return sprintf($link,$this->name,$url); 160 160 } … … 164 164 } 165 165 } 166 ?>
Note: See TracChangeset
for help on using the changeset viewer.