Changeset 26816 for extensions/Subscribe_to_comments
- Timestamp:
- Jan 16, 2014, 7:30:41 PM (10 years ago)
- Location:
- extensions/Subscribe_to_comments/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Subscribe_to_comments/include/events.inc.php
r26144 r26816 53 53 { 54 54 case 'all-images': 55 subscribe_to_comments(@$_POST['email'], 'all-images' );55 subscribe_to_comments(@$_POST['email'], 'all-images', null, false); 56 56 break; 57 57 case 'album-images': 58 58 if (!empty($page['category']['id'])) 59 59 { 60 subscribe_to_comments(@$_POST['email'], 'album-images', $page['category']['id'] );60 subscribe_to_comments(@$_POST['email'], 'album-images', $page['category']['id'], false); 61 61 } 62 62 break; 63 63 case 'image': 64 subscribe_to_comments(@$_POST['email'], 'image', $comm['image_id'] );64 subscribe_to_comments(@$_POST['email'], 'image', $comm['image_id'], false); 65 65 break; 66 66 } … … 71 71 { 72 72 case 'all-albums': 73 subscribe_to_comments(@$_POST['email'], 'all-albums' );73 subscribe_to_comments(@$_POST['email'], 'all-albums', null, false); 74 74 break; 75 75 case 'album': 76 subscribe_to_comments(@$_POST['email'], 'album', $comm['category_id'] );76 subscribe_to_comments(@$_POST['email'], 'album', $comm['category_id'], false); 77 77 break; 78 78 } -
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.