Changeset 276


Ignore:
Timestamp:
Jan 13, 2004, 12:41:53 AM (20 years ago)
Author:
gweltas
Message:

Minor corrections of PHP warnings

Location:
branches/release-1_3
Files:
9 edited

Legend:

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

    r180 r276  
    165165$vtp->setGlobalVar( $sub, 'user_template', $user['template'] );
    166166//--------------------------------------------------- number of days to display
    167 if ( isset( $_GET['last_days'] ) ) define( MAX_DAYS, $_GET['last_days'] );
    168 else                               define( MAX_DAYS, 0 );
     167if ( isset( $_GET['last_days'] ) ) define( 'MAX_DAYS', $_GET['last_days'] );
     168else                               define( 'MAX_DAYS', 0 );
    169169//----------------------------------------- non specific section initialization
    170170$array_cat_directories = array();
  • branches/release-1_3/admin/include/functions.php

    r270 r276  
    870870  else
    871871    $query.= 'NULL';
    872   $queries .= ' WHERE id = '.$row['id'];
     872  $query .= ' WHERE id = $user_id';
    873873  $query.= ';';
    874874  mysql_query( $query );
  • branches/release-1_3/admin/update.php

    r272 r276  
    2525 
    2626  $uppercats = '';
    27                
     27  $output = '';
    2828  // 0. retrieving informations on the category to display
    2929  $cat_directory = '../galleries';
     
    293293  // inserting the pictures found in the directory
    294294  foreach ( $pictures as $picture ) {
     295        $name = '';
     296        $author = '';
     297        $comment = '';
     298        if (isset ($picture['name'])) $name = $picture['name'];
     299        if (isset ($picture['author'])) $author = $picture['author'];
     300        if (isset ($picture['comment'])) $comment = $picture['comment'];
     301 
    295302    $query = 'INSERT INTO '.PREFIX_TABLE.'images';
    296303    $query.= ' (file,storage_category_id,date_available,tn_ext';
     
    301308    $query.= ",'".$picture['date']."','".$picture['tn_ext']."'";
    302309    $query.= ",'".$picture['filesize']."','".$picture['width']."'";
    303     $query.= ",'".$picture['height']."','".$picture['name']."'";
    304     $query.= ",'".$picture['author']."','".$picture['comment']."'";
    305     if ( $picture['date_creation'] != '' )
     310    $query.= ",'".$picture['height']."','$name', '$author', '$comment'";
     311    if ( isset ($picture['date_creation']))
    306312    {
    307313      $query.= ",'".$picture['date_creation']."'";
     
    588594//-------------------------------------------- introduction : choices of update
    589595// Display choice if "update" var is not specified
    590 check_cat_id( $_GET['update'] );
    591 if ( !isset( $_GET['update'] )
    592      and !( isset( $page['cat'] )
    593             or $_GET['update'] == 'cats'
    594             or $_GET['update'] == 'all' ) )
     596if (!isset( $_GET['update'] ))
    595597{
    596598  $vtp->addSession( $sub, 'introduction' );
     
    606608else
    607609{
     610  check_cat_id( $_GET['update'] );
    608611  $start = get_moment();
    609612  $count_new = 0;
  • branches/release-1_3/category.php

    r274 r276  
    3535}
    3636//-------------------------------------------------- access authorization check
    37 if ( isset( $_GET['act'] ))
     37if ( isset( $_GET['cat'] ))
    3838        check_cat_id( $_GET['cat'] );
    3939check_login_authorization();
     
    270270  {
    271271    // retrieving the storage dir of the picture
    272     if ( $array_cat_directories[$row['storage_category_id']] == '' )
     272    if ( !isset($array_cat_directories[$row['storage_category_id']]))
    273273    {
    274274      $array_cat_directories[$row['storage_category_id']] =
  • branches/release-1_3/include/functions_category.inc.php

    r271 r276  
    110110    $category = array();
    111111    foreach ( $infos as $info ) {
    112       $category[$info] = $row[$info];
    113       if ( $info == 'date_last' )
    114       {
    115         list($year,$month,$day) = explode( '-', $row[$info] );
    116         $category[$info] = mktime(0,0,0,$month,$day,$year);
    117       }
     112      if ( $info == 'uc.date_last' )
     113      {
     114        list($year,$month,$day) = explode( '-', $row['date_last'] );
     115        $category['date_last'] = mktime(0,0,0,$month,$day,$year);
     116      }
     117          else
     118          {
     119                $category[$info] = $row[$info];
     120          }
    118121    }
    119122    $plain_structure[$row['id']] = $category;
     
    412415    $page['nb_image_page'] = $user['nb_image_page'];
    413416    // $url is used to create the navigation bar
    414     $url = './category.php?cat='.$page['cat'].'&expand='.$page['expand'];
     417    $url = './category.php?cat='.$page['cat'];
     418        if ( isset($page['expand']) )
     419    {
     420      $url.= '&expand='.$page['expand'];
     421        }
    415422    // simple category
    416423    if ( is_numeric( $page['cat'] ) )
  • branches/release-1_3/include/functions_user.inc.php

    r245 r276  
    208208  global $user,$lang,$conf,$page;
    209209
    210   if ( $user['is_the_guest']
    211        and ( $conf['access'] == 'restricted' or $page['cat'] == 'fav' ) )
     210  if ( $user['is_the_guest'])
     211  {
     212  if ( $conf['access'] == 'restricted' || (isset($page['cat']) && $page['cat'] == 'fav' ) )
    212213  {
    213214    echo '<div style="text-align:center;">'.$lang['only_members'].'<br />';
     
    215216    exit();
    216217  }
     218  }
    217219}
    218220?>
  • branches/release-1_3/profile.php

    r263 r276  
    2828  exit();
    2929}
    30 //-------------------------------------------------------------- initialization
    31 check_cat_id( $_GET['cat'] );
    3230//------------------------------------------------------ update & customization
    3331$infos = array( 'nb_image_line', 'nb_line_page', 'language',
  • branches/release-1_3/search.php

    r57 r276  
    8282$vtp->setVar( $handle, 'text.size', '40' );
    8383$vtp->setVar( $handle, 'text.name', 'search' );
     84if (isset($_POST['search']))
    8485$vtp->setVar( $handle, 'text.value', $_POST['search'] );
    8586$vtp->closeSession( $handle, 'text' );
     
    9394$vtp->setVar( $handle, 'radio.value', 'OR' );
    9495$vtp->setVar( $handle, 'radio.option', $lang['search_mode_or'] );
    95 if ( $_POST['mode'] == 'OR' or $_POST['mode'] == '' )
     96if (isset($_POST['mode']) && ($_POST['mode'] == 'OR' or $_POST['mode'] == '' ))
    9697{
    9798  $vtp->setVar( $handle, 'radio.checked', ' checked="checked"' );
     
    103104$vtp->setVar( $handle, 'radio.value', 'AND' );
    104105$vtp->setVar( $handle, 'radio.option', $lang['search_mode_and'] );
    105 if ( $_POST['mode'] == 'AND' )
     106if ( isset($_POST['mode']) && $_POST['mode'] == 'AND' )
    106107{
    107108  $vtp->setVar( $handle, 'radio.checked', ' checked="checked"' );
  • branches/release-1_3/template/default/htmlfunctions.inc.php

    r246 r276  
    189189  {
    190190    $vtp->addSession( $handle, 'bullet_w_link' );
    191     $url = './category.php?cat='.$page['cat'];
     191    $url = './category.php';
     192        if (isset($page['cat']))
     193        {
     194        $url .='?cat='.$page['cat'];
    192195    $url.= '&amp;expand='.$category['expand_string'];
    193196    if ( $page['cat'] == 'search' )
     
    195198      $url.= '&amp;search='.$_GET['search'].'&amp;mode='.$_GET['mode'];
    196199    }
     200        }
    197201    $vtp->setVar( $handle, 'bullet_w_link.bullet_link', add_session_id($url) );
    198202    if ( $category['expanded'] )
Note: See TracChangeset for help on using the changeset viewer.