Changeset 3409
- Timestamp:
- Jun 10, 2009, 10:11:28 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/picture_comment.inc.php
r3282 r3409 119 119 if ($row['nb_comments'] > 0) 120 120 { 121 if ( !is_admin() ) 122 { 123 $validated_clause = ' AND validated = \'true\''; 124 } 125 else 126 { 127 $validated_clause = ''; 128 } 129 121 130 $query = ' 122 SELECT id,author,date,image_id,content 131 SELECT id,author,date,image_id,content,validated 123 132 FROM '.COMMENTS_TABLE.' 124 WHERE image_id = '.$page['image_id']. '125 AND validated = \'true\'133 WHERE image_id = '.$page['image_id']. 134 $validated_clause.' 126 135 ORDER BY date ASC 127 136 LIMIT '.$page['start'].', '.$conf['nb_comment_page'].' … … 153 162 ) 154 163 ); 164 if ($row['validated'] != 'true') 165 { 166 $tpl_comment['U_VALIDATE'] = 167 add_url_params($url_self, 168 array('action' => 'validate_comment', 169 'comment_to_validate' => $row['id'] 170 ) 171 ); 172 } 155 173 } 156 174 $template->append('comments', $tpl_comment); -
trunk/picture.php
r3282 r3409 323 323 redirect($url_self); 324 324 } 325 case 'validate_comment' : 326 { 327 if (isset($_GET['comment_to_validate']) 328 and is_numeric($_GET['comment_to_validate']) 329 and is_admin() and !is_adviser() ) 330 { 331 $query = ' 332 UPDATE '.COMMENTS_TABLE.' 333 SET validated = \'true\' 334 , validation_date = NOW() 335 WHERE id='.$_GET['comment_to_validate'].' 336 ;'; 337 pwg_query( $query ); 338 } 339 redirect($url_self); 340 } 341 325 342 } 326 343 }
Note: See TracChangeset
for help on using the changeset viewer.