Corretion of PHP warnings

git-svn-id: http://piwigo.org/svn/branches/release-1_3@279 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
gweltas
2004-01-15 00:11:00 +00:00
parent fb880db771
commit 855398f63e
5 changed files with 21 additions and 27 deletions
+1 -1
View File
@@ -431,7 +431,7 @@ function update_category( $id = 'all' )
function check_date_format( $date )
{
// date arrives at this format : DD/MM/YYYY
list($day,$month,$year) = explode( '/', $date );
@list($day,$month,$year) = explode( '/', $date );
return @checkdate( $month, $day, $year );
}
+2 -2
View File
@@ -85,7 +85,7 @@ if ( isset( $_POST['submit'] ) )
// if the user ask the picture to be the representative picture of its
// category, the category is updated in the database (without wondering
// if this picture was already the representative one)
if ( $_POST['representative-'.$row['category_id']] == 1 )
if ( isset($_POST['representative-'.$row['category_id']]) )
{
$query = 'UPDATE '.PREFIX_TABLE.'categories';
$query.= ' SET representative_picture_id = '.$_GET['image_id'];
@@ -144,7 +144,7 @@ if ( isset( $_POST['submit'] ) )
$result = mysql_query( $query );
while ( $row = mysql_fetch_array( $result ) )
{
if ( $_POST['dissociate-'.$row['category_id']] == 1 )
if ( isset($_POST['dissociate-'.$row['category_id']]) )
{
$query = 'DELETE FROM '.PREFIX_TABLE.'image_category';
$query.= ' WHERE image_id = '.$_GET['image_id'];
+11 -10
View File
@@ -462,21 +462,22 @@ if ( isset ( $page['cat'] ) )
$vtp->setVar( $handle, 'cat_infos.cat_name',
get_cat_display_name( $page['cat_name'], ' - ',
'font-style:italic;' ) );
// upload a picture in the category
if ( $page['cat_site_id'] == 1
and $conf['upload_available']
and $page['cat_uploadable'] )
{
$vtp->addSession( $handle, 'upload' );
$url = './upload.php?cat='.$page['cat'].'&expand='.$page['expand'];
$vtp->setVar( $handle, 'upload.url', add_session_id( $url ) );
$vtp->closeSession( $handle, 'upload' );
}
}
else
{
$vtp->setVar( $handle, 'cat_infos.cat_name', $page['title'] );
}
// upload a picture in the category
if ( $page['cat_site_id'] == 1
and $conf['upload_available']
and $page['cat_uploadable'] )
{
$vtp->addSession( $handle, 'upload' );
$url = './upload.php?cat='.$page['cat'].'&expand='.$page['expand'];
$vtp->setVar( $handle, 'upload.url', add_session_id( $url ) );
$vtp->closeSession( $handle, 'upload' );
}
$vtp->closeSession( $handle, 'cat_infos' );
}
//------------------------------------------------------------ log informations
+5 -4
View File
@@ -234,7 +234,7 @@ if ( $page['num'] >= 1 )
$result = mysql_query( $query );
$row = mysql_fetch_array( $result );
if ( $array_cat_directories[$row['storage_category_id']] == '' )
if ( !isset($array_cat_directories[$row['storage_category_id']]) )
{
$array_cat_directories[$row['storage_category_id']] =
get_complete_dir( $row['storage_category_id'] );
@@ -281,7 +281,7 @@ else
$intitule_cat = $page['title'];
}
if ( $array_cat_directories[$page['storage_category_id']] == '' )
if ( !isset($array_cat_directories[$page['storage_category_id']]) )
{
$array_cat_directories[$page['storage_category_id']] =
get_complete_dir( $page['storage_category_id'] );
@@ -289,7 +289,7 @@ if ( $array_cat_directories[$page['storage_category_id']] == '' )
$cat_directory = $array_cat_directories[$page['storage_category_id']];
$n = $page['num'] + 1;
$intitule_titre = replace_space( $intitule_cat." - " ).$n.'/'.
$intitule_titre = replace_space( $intitule_cat." - " ).$n.'/';
$intitule_titre.= $page['cat_nb_images']."<br />";
if ( $page['name'] != "" )
{
@@ -722,7 +722,8 @@ if ( $conf['show_comments'] )
if ( !$user['is_the_guest'] )
{
$vtp->addSession( $handle, 'author_known' );
$vtp->setVar( $handle, 'author_known.value', $user['pseudo'] );
if (isset($user['pseudo']))
$vtp->setVar( $handle, 'author_known.value', $user['pseudo'] );
$vtp->closeSession( $handle, 'author_known' );
}
else
+2 -10
View File
@@ -115,11 +115,7 @@ if ( isset( $_POST['submit'] ) )
mysql_query( $query );
}
// redirection
$url = 'category.php?cat='.$page['cat'].'&expand='.$_GET['expand'];
if ( $page['cat'] == 'search' )
{
$url.= '&search='.$_GET['search'].'&mode='.$_GET['mode'];
}
$url = 'category.php';
if ( $_POST['create_cookie'] != 1 ) $url = add_session_id( $url, true );
header( 'Request-URI: '.$url );
header( 'Content-Location: '.$url );
@@ -135,11 +131,7 @@ $tpl = array( 'customize_page_title','customize_title','password','new',
'reg_confirm','submit','create_cookie' );
templatize_array( $tpl, 'lang', $handle );
//----------------------------------------------------------------- form action
$url = './profile.php?cat='.$page['cat'].'&amp;expand='.$page['expand'];
if ( $page['cat'] == 'search' )
{
$url.= '&amp;search='.$_GET['search'].'&amp;mode='.$_GET['mode'];
}
$url = './profile.php';
$vtp->setGlobalVar( $handle, 'form_action', add_session_id( $url ) );
//-------------------------------------------------------------- errors display
if ( count( $errors ) != 0 )