Changeset 15983
- Timestamp:
- Jun 24, 2012, 3:24:55 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_comment.inc.php
r13800 r15983 127 127 $_POST['cr'][] = 'key'; // rvelices: I use this outside to see how spam robots work 128 128 } 129 130 // anonymous id = ip address 131 $ip_components = explode('.', $comm['ip']); 132 if (count($ip_components) > 3) 133 { 134 array_pop($ip_components); 135 } 136 $comm['anonymous_id'] = implode('.', $ip_components); 129 137 130 138 if ($comment_action!='reject' and $conf['anti-flood_time']>0 and !is_admin()) … … 136 144 WHERE date > '.$reference_date.' 137 145 AND author_id = '.$comm['author_id']; 146 if (!is_classic_user()) 147 { 148 $query.= ' 149 AND anonymous_id = "'.$comm['anonymous_id'].'"'; 150 } 151 $query.= ' 152 ;'; 153 138 154 list($counter) = pwg_db_fetch_row(pwg_query($query)); 139 155 if ( $counter > 0 ) … … 153 169 $query = ' 154 170 INSERT INTO '.COMMENTS_TABLE.' 155 (author, author_id, content, date, validated, validation_date, image_id)171 (author, author_id, anonymous_id, content, date, validated, validation_date, image_id) 156 172 VALUES ( 157 173 \''.$comm['author'].'\', 158 174 '.$comm['author_id'].', 175 \''.$comm['anonymous_id'].'\', 159 176 \''.$comm['content'].'\', 160 177 NOW(), -
trunk/install/piwigo_structure-mysql.sql
r15652 r15983 53 53 `author` varchar(255) default NULL, 54 54 `author_id` smallint(5) DEFAULT NULL, 55 `anonymous_id` varchar(45) NOT NULL, 55 56 `content` longtext, 56 57 `validated` enum('true','false') NOT NULL default 'false',
Note: See TracChangeset
for help on using the changeset viewer.