aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-01-24 22:57:36 +0000
committerz0rglub <z0rglub@piwigo.org>2004-01-24 22:57:36 +0000
commite39dc7c0ab3aef034bd5b8720b2b7ea1a21f96a7 (patch)
treee76950d656d2d9ce47c96bcd9ca726297b6baebc
parentc882b2691591950624a6553811fdeda91aa50b04 (diff)
Php Warnings correction
git-svn-id: http://piwigo.org/svn/branches/release-1_3@319 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/cat_modify.php3
-rw-r--r--admin/include/functions.php5
-rw-r--r--admin/thumbnail.php6
-rw-r--r--admin/waiting.php2
-rw-r--r--include/functions_category.inc.php2
5 files changed, 13 insertions, 5 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index 4cf301cb5..76e952ab9 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -118,7 +118,7 @@ $result = get_cat_info( $row['id'] );
$cat_name = get_cat_display_name( $result['name'], ' - ', '' );
$vtp->setVar( $sub, 'cat:name', $cat_name );
// cat dir
-if ( $row['dir'] != '' )
+if ( isset( $row['dir'] ) and $row['dir'] != '' )
{
$vtp->addSession( $sub, 'storage' );
$vtp->setVar( $sub, 'storage.dir', $row['dir'] );
@@ -137,6 +137,7 @@ if ( $row['site_id'] != 1 )
$vtp->closeSession( $sub, 'server' );
}
$vtp->setVar( $sub, 'name', $row['name'] );
+if ( !isset( $row['comment'] ) ) $row['comment'] = '';
$vtp->setVar( $sub, 'comment', $row['comment'] );
// status : public, private...
$options = get_enums( PREFIX_TABLE.'categories', 'status' );
diff --git a/admin/include/functions.php b/admin/include/functions.php
index b761c36fe..84c7a93e7 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -320,7 +320,10 @@ function check_favorites( $user_id )
$row = mysql_fetch_array( mysql_query( $query ) );
$status = $row['status'];
// retrieving all the restricted categories for this user
- $restricted_cat = explode( ',', $row['forbidden_categories'] );
+ if ( isset( $row['forbidden_categories'] ) )
+ $restricted_cat = explode( ',', $row['forbidden_categories'] );
+ else
+ $restricted_cat = array();
// retrieving all the favorites for this user and comparing their
// categories to the restricted categories
$query = 'SELECT image_id';
diff --git a/admin/thumbnail.php b/admin/thumbnail.php
index e3ab3e9a5..75ecc60eb 100644
--- a/admin/thumbnail.php
+++ b/admin/thumbnail.php
@@ -358,7 +358,7 @@ if ( isset( $_GET['dir'] ) )
$url = './admin.php?page=thumbnail&amp;dir='.$_GET['dir'];
$vtp->setVar( $sub, 'params.action', add_session_id( $url ) );
// GD version selected...
- if ( $_POST['gd'] == 1 )
+ if ( isset( $_POST['gd'] ) and $_POST['gd'] == 1 )
{
$vtp->setVar( $sub, 'params.gd1_checked', ' checked="checked"' );
}
@@ -386,10 +386,12 @@ if ( isset( $_GET['dir'] ) )
}
// options for the number of picture to miniaturize : "n"
$options = array( 5,10,20,40 );
+ if ( isset( $_POST['n'] ) ) $n = $_POST['n'];
+ else $n = 5;
foreach ( $options as $option ) {
$vtp->addSession( $sub, 'n_option' );
$vtp->setVar( $sub, 'n_option.option', $option );
- if ( $option == $_POST['n'] )
+ if ( $option == $n )
{
$vtp->setVar( $sub, 'n_option.selected', ' selected="selected"' );
}
diff --git a/admin/waiting.php b/admin/waiting.php
index 9a5e79481..6abf119de 100644
--- a/admin/waiting.php
+++ b/admin/waiting.php
@@ -116,7 +116,7 @@ while ( $row = mysql_fetch_array( $result ) )
// file name
$vtp->setVar( $sub, 'picture.file', $row['file'] );
// is there an existing associated thumnail ?
- if ( $row['tn_ext'] != '' )
+ if ( isset( $row['tn_ext'] ) and $row['tn_ext'] != '' )
{
$vtp->addSession( $sub, 'thumbnail' );
$thumbnail = $conf['prefix_thumbnail'];
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index 5dc9c6018..beacda9e1 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -237,6 +237,8 @@ function count_user_total_images()
$row = mysql_fetch_array( mysql_query( $query ) );
+ if ( !isset( $row['total'] ) ) $row['total'] = 0;
+
return $row['total'];
}