Changeset 6614 for branches/2.1/picture.php
- Timestamp:
- Jun 28, 2010, 9:42:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/picture.php
r6592 r6614 313 313 { 314 314 check_pwg_token(); 315 315 316 316 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 317 317 … … 319 319 320 320 $author_id = get_comment_author_id($_GET['comment_to_edit']); 321 321 322 322 if (can_manage_comment('edit', $author_id)) 323 323 { … … 332 332 $_POST['key'] 333 333 ); 334 334 335 335 redirect($url_self); 336 336 } … … 345 345 { 346 346 check_pwg_token(); 347 347 348 348 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 349 349 350 350 check_input_parameter('comment_to_delete', $_GET, false, PATTERN_ID); 351 351 352 352 $author_id = get_comment_author_id($_GET['comment_to_delete']); 353 353 354 354 if (can_manage_comment('delete', $author_id)) 355 355 { 356 356 delete_user_comment($_GET['comment_to_delete']); 357 357 } 358 358 359 359 redirect($url_self); 360 360 } … … 362 362 { 363 363 check_pwg_token(); 364 364 365 365 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 366 366 367 367 check_input_parameter('comment_to_validate', $_GET, false, PATTERN_ID); 368 368 369 369 $author_id = get_comment_author_id($_GET['comment_to_validate']); 370 370 371 371 if (can_manage_comment('validate', $author_id)) 372 372 { 373 373 validate_user_comment($_GET['comment_to_validate']); 374 374 } 375 375 376 376 redirect($url_self); 377 377 } … … 797 797 AND user_id = '.$user['id'].' 798 798 ;'; 799 $result = pwg_query($query); 800 $row = pwg_db_fetch_assoc($result); 801 802 if ($row['nb_fav'] == 0) 803 { 804 $template->assign( 805 'favorite', 806 array( 807 'FAVORITE_IMG' => 808 get_root_url().get_themeconf('icon_dir').'/favorite.png', 809 'FAVORITE_HINT' => l10n('add this image to your favorites'), 810 'U_FAVORITE' => add_url_params( 811 $url_self, 812 array('action'=>'add_to_favorites') 813 ), 814 ) 815 ); 816 } 817 else 818 { 819 $template->assign( 820 'favorite', 821 array( 822 'FAVORITE_IMG' => 823 get_root_url().get_themeconf('icon_dir').'/del_favorite.png', 824 'FAVORITE_HINT' => l10n('delete this image from your favorites'), 825 'U_FAVORITE' => add_url_params( 826 $url_self, 827 array('action'=>'remove_from_favorites') 828 ), 829 ) 830 ); 831 } 799 $row = pwg_db_fetch_assoc( pwg_query($query) ); 800 $is_favorite = $row['nb_fav'] != 0; 801 802 $template->assign( 803 'favorite', 804 array( 805 'IS_FAVORITE' => $is_favorite, 806 'FAVORITE_IMG' => 807 get_root_url().get_themeconf('icon_dir').(!$is_favorite ? '/favorite.png' : '/del_favorite.png' ), 808 'FAVORITE_HINT' => l10n( !$is_favorite ? 'add this image to your favorites' : 'delete this image from your favorites'), 809 'U_FAVORITE' => add_url_params( 810 $url_self, 811 array('action'=> !$is_favorite ? 'add_to_favorites' : 'remove_from_favorites' ) 812 ), 813 ) 814 ); 832 815 } 833 816
Note: See TracChangeset
for help on using the changeset viewer.