Changeset 3450 for trunk/comments.php
- Timestamp:
- Jun 23, 2009, 11:18:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/comments.php
r3445 r3450 101 101 if (isset($_GET['author']) and !empty($_GET['author'])) 102 102 { 103 $page['where_clauses'][] = 'com.author = \''.$_GET['author'].'\''; 103 $page['where_clauses'][] = 104 'u.username = \''.addslashes($_GET['author']).'\' 105 OR author = \''.addslashes($_GET['author']).'\''; 104 106 } 105 107 … … 262 264 263 265 $query = ' 264 SELECT COUNT(DISTINCT( id))266 SELECT COUNT(DISTINCT(com.id)) 265 267 FROM '.IMAGE_CATEGORY_TABLE.' AS ic 266 268 INNER JOIN '.COMMENTS_TABLE.' AS com 267 269 ON ic.image_id = com.image_id 270 LEFT JOIN '.USERS_TABLE.' As u 271 ON u.id = com.author_id 268 272 WHERE '.implode(' 269 273 AND ', $page['where_clauses']).' … … 296 300 , ic.category_id 297 301 , com.author 302 , com.author_id 303 , username 298 304 , com.date 299 305 , com.content 300 306 , com.validated 301 307 FROM '.IMAGE_CATEGORY_TABLE.' AS ic 302 INNER JOIN '.COMMENTS_TABLE.' AS com 308 INNER JOIN '.COMMENTS_TABLE.' AS com 303 309 ON ic.image_id = com.image_id 310 LEFT JOIN '.USERS_TABLE.' AS u 311 ON u.id = com.author_id 304 312 WHERE '.implode(' 305 313 AND ', $page['where_clauses']).' … … 367 375 ); 368 376 369 $author = $comment['author']; 370 if (empty($comment['author'])) 371 { 372 $author = l10n('guest'); 377 if (!empty($comment['author'])) 378 { 379 $author = $comment['author']; 380 if ($author == 'guest') 381 { 382 $author = l10n('guest'); 383 } 384 } 385 else 386 { 387 $author = $comment['username']; 373 388 } 374 389 … … 383 398 ); 384 399 385 if (can_manage_comment('delete', $comment['author ']))400 if (can_manage_comment('delete', $comment['author_id'])) 386 401 { 387 402 $url = get_root_url().'comments.php' … … 392 407 ); 393 408 } 394 if (can_manage_comment('edit', $comment['author ']))409 if (can_manage_comment('edit', $comment['author_id'])) 395 410 { 396 411 $url = get_root_url().'comments.php'
Note: See TracChangeset
for help on using the changeset viewer.