- Timestamp:
- Jan 16, 2014, 7:30:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Subscribe_to_comments/include/functions.inc.php
r26144 r26816 152 152 * @return: bool 153 153 */ 154 function subscribe_to_comments($email, $type, $element_id= 'NULL')154 function subscribe_to_comments($email, $type, $element_id=null, $spam_check=true) 155 155 { 156 156 if (empty($type)) … … 160 160 } 161 161 162 if (!in_array($type, array('all-images','all-albums')) and $element_id == 'NULL')162 if (!in_array($type, array('all-images','all-albums')) and !isset($element_id)) 163 163 { 164 164 trigger_error('subscribe_to_comment: missing element_id', E_USER_WARNING); … … 182 182 { 183 183 $email = $user['email']; 184 } 185 186 // spam check 187 if ($spam_check) 188 { 189 if (!trigger_change('loc_before_subscribe_to_comments', true, $email, $type, $element_id)) 190 { 191 return false; 192 } 184 193 } 185 194 … … 190 199 WHERE 191 200 type = "'.$type.'" 192 AND element_id = '. $element_id.'201 AND element_id = '. (isset($element_id) ? $element_id : 'NULL') .' 193 202 AND email = "'.pwg_db_real_escape_string($email).'" 194 203 ;'; … … 211 220 VALUES( 212 221 "'.$type.'", 213 '. $element_id.',222 '. (isset($element_id) ? $element_id : 'NULL') .', 214 223 "'.$user['language'].'", 215 224 "'.pwg_db_real_escape_string($email).'",
Note: See TracChangeset
for help on using the changeset viewer.