aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorgweltas <gweltas@piwigo.org>2004-01-12 23:41:53 +0000
committergweltas <gweltas@piwigo.org>2004-01-12 23:41:53 +0000
commit0fa0c8bb07c80884ac8b79560ba4c4119abfcd5c (patch)
tree520a704560749c2e5a981092bae7db99e34cf27b /admin
parent7b8d0b8dd8d3f5fa25dedaadb922525e7c95ee3b (diff)
Minor corrections of PHP warnings
git-svn-id: http://piwigo.org/svn/branches/release-1_3@276 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/comments.php4
-rw-r--r--admin/include/functions.php2
-rw-r--r--admin/update.php21
3 files changed, 15 insertions, 12 deletions
diff --git a/admin/comments.php b/admin/comments.php
index 1706897b8..7036a2fb2 100644
--- a/admin/comments.php
+++ b/admin/comments.php
@@ -164,8 +164,8 @@ $tpl = array( 'stats_last_days','delete','close','submit','open' );
templatize_array( $tpl, 'lang', $sub );
$vtp->setGlobalVar( $sub, 'user_template', $user['template'] );
//--------------------------------------------------- number of days to display
-if ( isset( $_GET['last_days'] ) ) define( MAX_DAYS, $_GET['last_days'] );
-else define( MAX_DAYS, 0 );
+if ( isset( $_GET['last_days'] ) ) define( 'MAX_DAYS', $_GET['last_days'] );
+else define( 'MAX_DAYS', 0 );
//----------------------------------------- non specific section initialization
$array_cat_directories = array();
$array_cat_names = array();
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 2f45ce905..0207bd9b8 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -869,7 +869,7 @@ function update_user_restrictions( $user_id )
$query.= "'".implode( ',', $restrictions )."'";
else
$query.= 'NULL';
- $queries .= ' WHERE id = '.$row['id'];
+ $query .= ' WHERE id = $user_id';
$query.= ';';
mysql_query( $query );
diff --git a/admin/update.php b/admin/update.php
index b4f46b958..ed7cfcbcd 100644
--- a/admin/update.php
+++ b/admin/update.php
@@ -24,7 +24,7 @@ function insert_local_category( $id_uppercat )
global $conf, $page, $user, $lang;
$uppercats = '';
-
+ $output = '';
// 0. retrieving informations on the category to display
$cat_directory = '../galleries';
@@ -292,6 +292,13 @@ function insert_local_image( $rep, $category_id )
}
// inserting the pictures found in the directory
foreach ( $pictures as $picture ) {
+ $name = '';
+ $author = '';
+ $comment = '';
+ if (isset ($picture['name'])) $name = $picture['name'];
+ if (isset ($picture['author'])) $author = $picture['author'];
+ if (isset ($picture['comment'])) $comment = $picture['comment'];
+
$query = 'INSERT INTO '.PREFIX_TABLE.'images';
$query.= ' (file,storage_category_id,date_available,tn_ext';
$query.= ',filesize,width,height';
@@ -300,9 +307,8 @@ function insert_local_image( $rep, $category_id )
$query.= "('".$picture['file']."','".$category_id."'";
$query.= ",'".$picture['date']."','".$picture['tn_ext']."'";
$query.= ",'".$picture['filesize']."','".$picture['width']."'";
- $query.= ",'".$picture['height']."','".$picture['name']."'";
- $query.= ",'".$picture['author']."','".$picture['comment']."'";
- if ( $picture['date_creation'] != '' )
+ $query.= ",'".$picture['height']."','$name', '$author', '$comment'";
+ if ( isset ($picture['date_creation']))
{
$query.= ",'".$picture['date_creation']."'";
}
@@ -587,11 +593,7 @@ templatize_array( $tpl, 'lang', $sub );
$vtp->setGlobalVar( $sub, 'user_template', $user['template'] );
//-------------------------------------------- introduction : choices of update
// Display choice if "update" var is not specified
-check_cat_id( $_GET['update'] );
-if ( !isset( $_GET['update'] )
- and !( isset( $page['cat'] )
- or $_GET['update'] == 'cats'
- or $_GET['update'] == 'all' ) )
+if (!isset( $_GET['update'] ))
{
$vtp->addSession( $sub, 'introduction' );
// only update the categories, not the pictures.
@@ -605,6 +607,7 @@ if ( !isset( $_GET['update'] )
//------------------------------------------------- local update : ../galleries
else
{
+ check_cat_id( $_GET['update'] );
$start = get_moment();
$count_new = 0;
$count_deleted = 0;