Changeset 2325 for trunk/include/functions_category.inc.php
- Timestamp:
- May 2, 2008, 11:56:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r2299 r2325 453 453 } 454 454 455 /** 456 * returns the link of upload menu 457 * 458 * @param null 459 * @return string or null 460 */ 461 function get_upload_menu_link() 462 { 463 global $conf, $page, $user; 464 465 $show_link = false; 466 $arg_link = null; 467 468 if (is_autorize_status($conf['upload_user_access'])) 469 { 470 if (isset($page['category']) and $page['category']['uploadable'] ) 471 { 472 // upload a picture in the category 473 $show_link = true; 474 $arg_link = 'cat='.$page['category']['id']; 475 } 476 else 477 if ($conf['upload_link_everytime']) 478 { 479 // upload a picture in the category 480 $query = ' 481 SELECT 482 1 483 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' 484 ON id = cat_id and user_id = '.$user['id'].' 485 WHERE 486 uploadable = \'true\' 487 '.get_sql_condition_FandF 488 ( 489 array 490 ( 491 'visible_categories' => 'id', 492 ), 493 'AND' 494 ).' 495 LIMIT 1'; 496 497 $show_link = mysql_num_rows(pwg_query($query)) <> 0; 498 } 499 } 500 if ($show_link) 501 { 502 return get_root_url().'upload.php'.(empty($arg_link) ? '' : '?'.$arg_link); 503 } 504 else 505 { 506 return; 507 } 508 } 509 455 510 ?>
Note: See TracChangeset
for help on using the changeset viewer.