aboutsummaryrefslogtreecommitdiffstats
path: root/admin/picture_modify.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-01-21 23:33:56 +0000
committerz0rglub <z0rglub@piwigo.org>2004-01-21 23:33:56 +0000
commit40a11658a9f54d04f94d3febc204d09a86622e3e (patch)
tree96fd59aed7a124f73faa74d25a0f76d6d8233da4 /admin/picture_modify.php
parent5c5c69f9a03eb956399d1394decfb4092c4959da (diff)
Php warnings correction
git-svn-id: http://piwigo.org/svn/branches/release-1_3@311 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/picture_modify.php')
-rw-r--r--admin/picture_modify.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index beb295291..c167cf425 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -95,7 +95,8 @@ if ( isset( $_POST['submit'] ) )
}
// if the user ask this picture to be not any more the representative,
// we have to set the representative_picture_id of this category to NULL
- else if ( $row['representative_picture_id'] == $_GET['image_id'] )
+ else if ( isset( $row['representative_picture_id'] )
+ and $row['representative_picture_id'] == $_GET['image_id'] )
{
$query = 'UPDATE '.PREFIX_TABLE.'categories';
$query.= ' SET representative_picture_id = NULL';
@@ -186,12 +187,19 @@ if ( count( $errors ) != 0 )
$action = './admin.php?'.$_SERVER['QUERY_STRING'];
$vtp->setVar( $sub, 'form_action', $action );
// retrieving direct information about picture
-$query = 'SELECT file,date_available,date_creation,tn_ext,name,filesize';
-$query.= ',width,height,author,comment,keywords,storage_category_id';
+$infos = array( 'file','date_available','date_creation','tn_ext','name'
+ ,'filesize','width','height','author','comment','keywords'
+ ,'storage_category_id' );
+$query = 'SELECT '. implode( ',', $infos );
$query.= ' FROM '.PREFIX_TABLE.'images';
$query.= ' WHERE id = '.$_GET['image_id'];
$query.= ';';
$row = mysql_fetch_array( mysql_query( $query ) );
+
+foreach ( $infos as $info ) {
+ if ( !isset( $row[$info] ) ) $row[$info] = '';
+}
+
// picture title
if ( $row['name'] == '' )
{
@@ -314,7 +322,8 @@ while ( $row = mysql_fetch_array( $result ) )
$vtp->setVar( $sub, 'linked_category.invisible', $invisible_string );
}
- if ( $row['representative_picture_id'] == $_GET['image_id'] )
+ if ( isset( $row['representative_picture_id'] )
+ and $row['representative_picture_id'] == $_GET['image_id'] )
{
$vtp->setVar( $sub, 'linked_category.representative_checked',
' checked="checked"' );