Changeset 1056


Ignore:
Timestamp:
Feb 24, 2006, 2:16:30 AM (18 years ago)
Author:
rvelices
Message:

fix: remove all php warnings and notices

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/rating.php

    r1042 r1056  
    224224                get_query_string_diff(array('del'));
    225225   
    226     $del_param = 'e='.$image[id].
     226    $del_param = 'e='.$image['id'].
    227227                 '&u='.$row['user_id'].
    228228                 '&a='.$row['anonymous_id'];
  • trunk/category.php

    r1051 r1056  
    8686  {
    8787    $nav_url .= 'cat='.$page['cat'].'&';
    88   }
    89 
    90   switch ($page['cat'])
    91   {
    92     case 'search':
     88
     89    switch ($page['cat'])
    9390    {
    94       $nav_url.= 'search='.$_GET['search'].'&';
    95       break;
     91      case 'search':
     92      {
     93        $nav_url.= 'search='.$_GET['search'].'&';
     94        break;
     95      }
     96      case 'list':
     97      {
     98        $nav_url.= 'list='.$_GET['list'].'&';
     99        break;
     100      }
    96101    }
    97     case 'list':
    98     {
    99       $nav_url.= 'list='.$_GET['list'].'&';
    100       break;
    101     }
    102   }
     102  }
     103
    103104  if ( isset($_GET['calendar']) )
    104105  {
     
    402403}
    403404
    404 if ($page['cat_nb_images']>0 and
     405if ( ( isset($page['cat_nb_images']) and $page['cat_nb_images']>0 )
     406     and
    405407    ( !isset($page['cat'])
    406408      or ($page['cat'] != 'most_visited' and $page['cat'] != 'best_rated') )
  • trunk/identification.php

    r1052 r1056  
    4545if (isset($_POST['login']))
    4646{
    47   $redirect_to = $_POST['redirect'];
     47  $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
    4848  $username = mysql_escape_string($_POST['username']);
    4949  // retrieving the encrypted password of the login submitted
  • trunk/include/calendar_base.class.php

    r1055 r1056  
    163163      $url_base,
    164164      $level_items,
    165       $requested[$level],
     165      isset($requested[$level]) ? $requested[$level] : null,
    166166      'cal',
    167167      true,
  • trunk/include/calendar_monthly.class.php

    r1055 r1056  
    7474      $this->build_nav_bar2($view_type, $requested, 1, 'MONTH', $lang['month']); // month
    7575    if (count($requested)>1)
    76       $this->build_nav_bar2($view_type, $requested, 2, 'DAYOFWEEK' ); // days
     76      $this->build_nav_bar2($view_type, $requested, 2, 'DAYOFMONTH' ); // days
    7777  }
    7878  return false;
     
    152152function build_global_calendar(&$requested)
    153153{
     154  assert( count($requested) == 0 );
    154155  $query='SELECT DISTINCT(DATE_FORMAT('.$this->date_field.',"%Y%m")) as period,
    155156            COUNT(id) as count';
    156157  $query.= $this->inner_sql;
    157   $query.= $this->get_date_where($requested, 0);
     158  $query.= $this->get_date_where($requested);
    158159  $query.= '
    159160  GROUP BY period';
     
    189190
    190191    $url_base .= '-';
    191     $nav_bar .= $this->get_nav_bar_from_items( $url_base, $year_data['children'], $requested[0], 'calCal', false, $lang['month'] );
     192    $nav_bar .= $this->get_nav_bar_from_items( $url_base,
     193            $year_data['children'], null, 'calCal', false, $lang['month'] );
    192194
    193195    $template->assign_block_vars( 'calendar.calbar',
     
    200202function build_year_calendar(&$requested)
    201203{
     204  assert( count($requested) == 1 );
    202205  $query='SELECT DISTINCT(DATE_FORMAT('.$this->date_field.',"%m%d")) as period,
    203206            COUNT(id) as count';
    204207  $query.= $this->inner_sql;
    205   $query.= $this->get_date_where($requested, 1);
     208  $query.= $this->get_date_where($requested);
    206209  $query.= '
    207210  GROUP BY period';
     
    243246    $url_base .= '-';
    244247    $nav_bar .= $this->get_nav_bar_from_items( $url_base,
    245                      $month_data['children'], $requested[1], 'calCal', false );
     248                     $month_data['children'], null, 'calCal', false );
    246249
    247250    $template->assign_block_vars( 'calendar.calbar',
  • trunk/include/category_default.inc.php

    r1053 r1056  
    8686  if (isset($page['cat']))
    8787  {
    88     $url_link.= 'cat='.$page['cat'].'&';
     88    $url_link.= '&cat='.$page['cat'];
    8989
    9090    if ($page['cat'] == 'search')
     
    126126      $name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
    127127    }
    128     if ($page['cat'] == 'best_rated')
     128    if ( isset($page['cat']) )
    129129    {
    130       $name = '('.$row['average_rate'].') '.$name;
    131     }
    132     else
    133     if ($page['cat'] == 'most_visited')
    134     {
    135       $name = '('.$row['hit'].') '.$name;
    136     }
    137    
    138     if ($page['cat'] == 'search')
    139     {
    140       $name = replace_search($name, $_GET['search']);
     130      if ($page['cat'] == 'best_rated')
     131      {
     132        $name = '('.$row['average_rate'].') '.$name;
     133      }
     134      elseif ($page['cat'] == 'most_visited')
     135      {
     136        $name = '('.$row['hit'].') '.$name;
     137      }
     138     
     139      if ($page['cat'] == 'search')
     140      {
     141        $name = replace_search($name, $_GET['search']);
     142      }
    141143    }
    142144 
  • trunk/include/functions_calendar.inc.php

    r1055 r1056  
    7676 
    7777  $cal_styles = array(
    78     // Weekly style
     78    // Monthly style
    7979    array(
    8080      'link'           => 'm',
     
    8484      'view_calendar'  => true,
    8585      ),
    86     // Monthly style
     86    // Weekly style   
    8787    array(
    8888      'link'           => 'w',
     
    9090      'name'           => l10n('Weekly'),
    9191      'include'        => 'calendar_weekly.class.php',
     92      'view_calendar'  => false,
    9293      ),
    9394    );
  • trunk/picture.php

    r1052 r1056  
    380380}
    381381
    382 if ( $page['cat'] == 'search' )
    383 {
    384   $url_up.= '&search='.$_GET['search'];
    385 }
    386 if ( $page['cat'] == 'list' )
    387 {
    388   $url_up.= '&list='.$_GET['list'];
     382if ( isset($page['cat']) )
     383{
     384  if ( $page['cat'] == 'search' )
     385  {
     386    $url_up.= '&search='.$_GET['search'];
     387  }
     388  if ( $page['cat'] == 'list' )
     389  {
     390    $url_up.= '&list='.$_GET['list'];
     391  }
    389392}
    390393
    391394$url_admin =
    392395  PHPWG_ROOT_PATH.'admin.php?page=picture_modify'
    393   .'&cat_id='.$page['cat']
     396  .'&cat_id='. ( isset($page['cat']) ? $page['cat'] : '' )
    394397  .'&image_id='.$_GET['image_id'];
    395398
     
    414417    $result = pwg_query( $query );
    415418  }
    416   if ( !$_GET['add_fav'] and $page['cat'] == 'fav' )
     419  if ( !$_GET['add_fav'] and isset($page['cat']) and 'fav'==$page['cat'] )
    417420  {
    418421    if (!isset($page['previous_item']) and !isset($page['next_item']))
     
    538541
    539542$title_img = $picture['current']['name'];
    540 if (is_numeric( $page['cat'] ))
    541 {
    542   $title_img = replace_space(get_cat_display_name($page['cat_name']));
    543 }
    544 else if ( $page['cat'] == 'search' )
    545 {
    546   $title_img = replace_search( $title_img, $_GET['search'] );
     543if ( isset( $page['cat'] ) )
     544{
     545  if (is_numeric( $page['cat'] ))
     546  {
     547    $title_img = replace_space(get_cat_display_name($page['cat_name']));
     548  }
     549  else if ( $page['cat'] == 'search' )
     550  {
     551    $title_img = replace_search( $title_img, $_GET['search'] );
     552  }
    547553}
    548554$title_nb = ($page['current_rank'] + 1).'/'.$page['cat_nb_images'];
     
    681687}
    682688// button to set the current picture as representative
    683 if ('admin' == $user['status'] and is_numeric($page['cat']))
     689if ('admin' == $user['status'] and
     690    isset($page['cat']) and is_numeric($page['cat']))
    684691{
    685692  $template->assign_block_vars(
Note: See TracChangeset for help on using the changeset viewer.