Changeset 8652


Ignore:
Timestamp:
Jan 13, 2011, 9:51:57 PM (13 years ago)
Author:
rvelices
Message:

feature 2108 finalize upload removal (php warnings)

Location:
trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_category.inc.php

    r6951 r8652  
    496496}
    497497
    498 /**
    499  * returns the link of upload menu
    500  *
    501  * @param null
    502  * @return string or null
    503  */
    504 function get_upload_menu_link()
    505 {
    506   global $conf, $page, $user;
    507 
    508   $show_link = false;
    509   $arg_link = null;
    510 
    511   if (is_autorize_status($conf['upload_user_access']))
    512   {
    513     if (isset($page['category']) and $page['category']['uploadable'] )
    514     {
    515       // upload a picture in the category
    516       $show_link = true;
    517       $arg_link = 'cat='.$page['category']['id'];
    518     }
    519     else
    520     if ($conf['upload_link_everytime'])
    521     {
    522       // upload a picture in the category
    523       $query = '
    524 SELECT
    525   1
    526 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.'
    527   ON id = cat_id and user_id = '.$user['id'].'
    528 WHERE
    529   uploadable = \'true\'
    530   '.get_sql_condition_FandF
    531     (
    532       array
    533         (
    534           'visible_categories' => 'id',
    535         ),
    536       'AND'
    537     ).'
    538 LIMIT 1';
    539 
    540       $show_link = pwg_db_num_rows(pwg_query($query)) <> 0;
    541     }
    542   }
    543   if ($show_link)
    544   {
    545     return get_root_url().'upload.php'.(empty($arg_link) ? '' : '?'.$arg_link);
    546   }
    547   else
    548   {
    549     return;
    550   }
    551 }
    552 
    553498?>
  • trunk/include/menubar.inc.php

    r8223 r8652  
    106106      'MENU_CATEGORIES' => get_categories_menu(),
    107107      'U_CATEGORIES' => make_index_url(array('section' => 'categories')),
    108       'U_UPLOAD' => get_upload_menu_link()
    109108    );
    110109    $block->template = 'menubar_categories.tpl';
Note: See TracChangeset for help on using the changeset viewer.