fix: remove all php warnings and notices

git-svn-id: http://piwigo.org/svn/trunk@1056 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2006-02-24 01:16:30 +00:00
parent 5fa3664567
commit 3aff4f0bfe
8 changed files with 325 additions and 310 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ SELECT DISTINCT('.$sql_func.'('.$this->date_field.')'.$sql_offset
$nav_bar = $this->get_nav_bar_from_items(
$url_base,
$level_items,
$requested[$level],
isset($requested[$level]) ? $requested[$level] : null,
'cal',
true,
$labels
+8 -5
View File
@@ -73,7 +73,7 @@ function generate_category_content($url_base, $view_type, &$requested)
if (count($requested)>0)
$this->build_nav_bar2($view_type, $requested, 1, 'MONTH', $lang['month']); // month
if (count($requested)>1)
$this->build_nav_bar2($view_type, $requested, 2, 'DAYOFWEEK' ); // days
$this->build_nav_bar2($view_type, $requested, 2, 'DAYOFMONTH' ); // days
}
return false;
}
@@ -151,10 +151,11 @@ function build_nav_bar2($view_type, $requested, $level, $sql_func, $labels=null)
function build_global_calendar(&$requested)
{
assert( count($requested) == 0 );
$query='SELECT DISTINCT(DATE_FORMAT('.$this->date_field.',"%Y%m")) as period,
COUNT(id) as count';
$query.= $this->inner_sql;
$query.= $this->get_date_where($requested, 0);
$query.= $this->get_date_where($requested);
$query.= '
GROUP BY period';
@@ -188,7 +189,8 @@ function build_global_calendar(&$requested)
$nav_bar .= '</span><br>';
$url_base .= '-';
$nav_bar .= $this->get_nav_bar_from_items( $url_base, $year_data['children'], $requested[0], 'calCal', false, $lang['month'] );
$nav_bar .= $this->get_nav_bar_from_items( $url_base,
$year_data['children'], null, 'calCal', false, $lang['month'] );
$template->assign_block_vars( 'calendar.calbar',
array( 'BAR' => $nav_bar)
@@ -199,10 +201,11 @@ function build_global_calendar(&$requested)
function build_year_calendar(&$requested)
{
assert( count($requested) == 1 );
$query='SELECT DISTINCT(DATE_FORMAT('.$this->date_field.',"%m%d")) as period,
COUNT(id) as count';
$query.= $this->inner_sql;
$query.= $this->get_date_where($requested, 1);
$query.= $this->get_date_where($requested);
$query.= '
GROUP BY period';
@@ -242,7 +245,7 @@ function build_year_calendar(&$requested)
$url_base .= '-';
$nav_bar .= $this->get_nav_bar_from_items( $url_base,
$month_data['children'], $requested[1], 'calCal', false );
$month_data['children'], null, 'calCal', false );
$template->assign_block_vars( 'calendar.calbar',
array( 'BAR' => $nav_bar)
+15 -13
View File
@@ -85,7 +85,7 @@ foreach ($pictures as $row)
if (isset($page['cat']))
{
$url_link.= 'cat='.$page['cat'].'&amp;';
$url_link.= '&amp;cat='.$page['cat'];
if ($page['cat'] == 'search')
{
@@ -125,19 +125,21 @@ foreach ($pictures as $row)
{
$name = str_replace('_', ' ', get_filename_wo_extension($row['file']));
}
if ($page['cat'] == 'best_rated')
if ( isset($page['cat']) )
{
$name = '('.$row['average_rate'].') '.$name;
}
else
if ($page['cat'] == 'most_visited')
{
$name = '('.$row['hit'].') '.$name;
}
if ($page['cat'] == 'search')
{
$name = replace_search($name, $_GET['search']);
if ($page['cat'] == 'best_rated')
{
$name = '('.$row['average_rate'].') '.$name;
}
elseif ($page['cat'] == 'most_visited')
{
$name = '('.$row['hit'].') '.$name;
}
if ($page['cat'] == 'search')
{
$name = replace_search($name, $_GET['search']);
}
}
$template->assign_block_vars(
+3 -2
View File
@@ -75,7 +75,7 @@ WHERE id IN (' . implode(',',$page['items']) .')';
pwg_debug('start initialize_calendar');
$cal_styles = array(
// Weekly style
// Monthly style
array(
'link' => 'm',
'default_link' => '',
@@ -83,12 +83,13 @@ WHERE id IN (' . implode(',',$page['items']) .')';
'include' => 'calendar_monthly.class.php',
'view_calendar' => true,
),
// Monthly style
// Weekly style
array(
'link' => 'w',
'default_link' => 'w-',
'name' => l10n('Weekly'),
'include' => 'calendar_weekly.class.php',
'view_calendar' => false,
),
);