Changeset 286


Ignore:
Timestamp:
Jan 17, 2004, 11:38:04 PM (21 years ago)
Author:
z0rglub
Message:
  • reformating gweltas coding style :-) (so easy to do with emacs)
  • due to a too much restrictive (preventing warning) test, when no category was selected, it didn't show random pictures from sub-categories
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/category.php

    r279 r286  
    2424include_once( './include/init.inc.php' );
    2525//---------------------------------------------------------------------- logout
    26 if ( isset( $_GET['act'] ) && $_GET['act'] == 'logout' && isset( $_COOKIE['id'] ) )
     26if ( isset( $_GET['act'] )
     27     and $_GET['act'] == 'logout'
     28     and isset( $_COOKIE['id'] ) )
    2729{
    2830  // cookie deletion if exists
     
    3537}
    3638//-------------------------------------------------- access authorization check
    37 if ( isset( $_GET['cat'] ))
    38         check_cat_id( $_GET['cat'] );
     39if ( isset( $_GET['cat'] ) ) check_cat_id( $_GET['cat'] );
    3940check_login_authorization();
    40 if ( isset( $page['cat'] ) && is_numeric( $page['cat'] ) )
     41if ( isset( $page['cat'] ) and is_numeric( $page['cat'] ) )
    4142{
    4243  check_restrictions( $page['cat'] );
     
    7879// The $page['expand'] equals 'all' and
    7980// $page['tab_expand'] contains all the authorized cat ids
    80 if ( $user['expand'] || (isset($_GET['expand']) && $_GET['expand'] == 'all' ))
     81if ( $user['expand']
     82     or ( isset( $_GET['expand'] ) and $_GET['expand'] == 'all' ) )
    8183{
    8284  $page['tab_expand'] = array();
     
    8789// We have to find the right $page['start'] that show the num picture
    8890// in this category
    89 if ( isset($_GET['num']) && is_numeric( $_GET['num'] ) && $_GET['num'] >= 0 )
     91if ( isset( $_GET['num'] )
     92     and is_numeric( $_GET['num'] )
     93     and $_GET['num'] >= 0 )
    9094{
    9195  $page['start'] = floor( $_GET['num'] / $user['nb_image_page'] );
     
    358362
    359363  $subcats=array();
    360   if (isset ($page['cat'] ))
    361         $subcats = get_non_empty_subcat_ids( $page['cat'] );
     364  if (isset($page['cat'])) $subcats = get_non_empty_subcat_ids( $page['cat'] );
     365  else                     $subcats = get_non_empty_subcat_ids( '' );
    362366  $cell_number = 1;
    363367  $i = 0;
     
    463467                  get_cat_display_name( $page['cat_name'], ' - ',
    464468                                        'font-style:italic;' ) );
    465         // upload a picture in the category
    466         if ( $page['cat_site_id'] == 1
    467        and $conf['upload_available']
    468        and $page['cat_uploadable'] )
    469         {
    470         $vtp->addSession( $handle, 'upload' );
    471             $url = './upload.php?cat='.$page['cat'].'&expand='.$page['expand'];
    472         $vtp->setVar( $handle, 'upload.url', add_session_id( $url ) );
    473             $vtp->closeSession( $handle, 'upload' );
    474         }
     469    // upload a picture in the category
     470    if ( $page['cat_site_id'] == 1
     471         and $conf['upload_available']
     472         and $page['cat_uploadable'] )
     473    {
     474      $vtp->addSession( $handle, 'upload' );
     475      $url = './upload.php?cat='.$page['cat'].'&expand='.$page['expand'];
     476      $vtp->setVar( $handle, 'upload.url', add_session_id( $url ) );
     477      $vtp->closeSession( $handle, 'upload' );
     478    }
    475479  }
    476480  else
Note: See TracChangeset for help on using the changeset viewer.