mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-21 09:03:38 +02:00
Php warnings correction
git-svn-id: http://piwigo.org/svn/branches/release-1_3@311 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ function display_pictures( $mysql_result, $maxtime, $validation_box = false )
|
||||
$subresult = mysql_query( $query );
|
||||
$subrow = mysql_fetch_array( $subresult );
|
||||
|
||||
if ( $array_cat_directories[$subrow['cat_id']] == '' )
|
||||
if ( !isset( $array_cat_directories[$subrow['cat_id']] ) )
|
||||
{
|
||||
$array_cat_directories[$subrow['cat_id']] =
|
||||
get_complete_dir( $subrow['cat_id'] );
|
||||
|
||||
@@ -404,7 +404,7 @@ function update_category( $id = 'all' )
|
||||
$row = mysql_fetch_array( mysql_query( $query ) );
|
||||
// if the category has no representative picture (ie
|
||||
// representative_picture_id == NULL) we don't update anything
|
||||
if ( $row['representative_picture_id'] != '' )
|
||||
if ( isset( $row['representative_picture_id'] ) )
|
||||
{
|
||||
$query = 'SELECT image_id';
|
||||
$query.= ' FROM '.PREFIX_TABLE.'image_category';
|
||||
@@ -691,7 +691,7 @@ function update_uppercats( $category_id )
|
||||
array_push( $uppercats, $category_id );
|
||||
$uppercat = $page['plain_structure'][$category_id]['id_uppercat'];
|
||||
|
||||
while ( $uppercat != '' )
|
||||
while ( $uppercat != 'NULL' )
|
||||
{
|
||||
array_push( $uppercats, $uppercat );
|
||||
$category_id = $page['plain_structure'][$category_id]['id_uppercat'];
|
||||
|
||||
@@ -179,7 +179,9 @@ if ( isset( $page['cat'] ) )
|
||||
$result = mysql_query( $query );
|
||||
while ( $row = mysql_fetch_array( $result ) )
|
||||
{
|
||||
$specific_keywords = explode( ',', $row['keywords'] );
|
||||
if ( !isset( $row['keywords'] ) ) $specific_keywords = array();
|
||||
else $specific_keywords = explode( ',', $row['keywords'] );
|
||||
|
||||
$common_keywords = get_keywords( $_POST['keywords_cat'] );
|
||||
// first possiblity : adding the given keywords to all the pictures
|
||||
if ( $_POST['common_keywords'] == 'add' )
|
||||
|
||||
@@ -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"' );
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ if ( isset ( $_GET['delete'] ) and is_numeric( $_GET['delete'] ) )
|
||||
$query.= ';';
|
||||
$row = mysql_fetch_array( mysql_query( $query ) );
|
||||
// confirm user deletion ?
|
||||
if ( $_GET['confirm'] != 1 )
|
||||
if ( !isset( $_GET['confirm'] ) )
|
||||
{
|
||||
$vtp->addSession( $sub, 'deletion' );
|
||||
$vtp->setVar( $sub, 'deletion.login', $row['username'] );
|
||||
|
||||
+2
-2
@@ -285,8 +285,8 @@ if ( isset( $page['cat'] ) and $page['cat_nb_images'] != 0 )
|
||||
|
||||
$file = get_filename_wo_extension( $row['file'] );
|
||||
// name of the picture
|
||||
if ( $row['name'] != '' ) $name = $row['name'];
|
||||
else $name = str_replace( '_', ' ', $file );
|
||||
if ( isset( $row['name'] ) and $row['name'] != '' ) $name = $row['name'];
|
||||
else $name = str_replace( '_', ' ', $file );
|
||||
|
||||
if ( $page['cat'] == 'search' )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user