aboutsummaryrefslogtreecommitdiffstats
path: root/admin/configuration.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-01-19 22:33:26 +0000
committerz0rglub <z0rglub@piwigo.org>2004-01-19 22:33:26 +0000
commite8f465a67a13ab6e8b662302c3910e94306d2b5f (patch)
tree915ec2e826c1e41203670acf32bf2ee040a45b04 /admin/configuration.php
parentff1fbe962e5b47f24eadc249cef1380235773375 (diff)
Php warnings corrections
git-svn-id: http://piwigo.org/svn/branches/release-1_3@304 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/configuration.php')
-rw-r--r--admin/configuration.php24
1 files changed, 8 insertions, 16 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index c84ace657..676ce79c7 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -240,30 +240,22 @@ if ( isset( $_POST['submit'] ) )
else
{
//--------------------------------------------------------- data initialization
- $query = 'SELECT';
- foreach ( $conf_infos as $i => $conf_info ) {
- if ( $i > 0 ) $query.= ',';
- else $query.= ' ';
- $query.= $conf_info;
- }
+ $query = 'SELECT '.implode( ',', $conf_infos );
$query .= ' FROM '.PREFIX_TABLE.'config;';
$row = mysql_fetch_array( mysql_query( $query ) );
- foreach ( $conf_infos as $conf_info ) {
- $$conf_info = $row[$conf_info];
+ foreach ( $conf_infos as $info ) {
+ if ( isset( $row[$info] ) ) $$info = $row[$info];
+ else $$info = '';
}
- $query = 'SELECT';
- foreach ( $default_user_infos as $i => $default_user_info ) {
- if ( $i > 0 ) $query.= ',';
- else $query.= ' ';
- $query.= $default_user_info;
- }
+ $query = 'SELECT '.implode( ',', $default_user_infos );
$query.= ' FROM '.PREFIX_TABLE.'users';
$query.= " WHERE username = 'guest'";
$query.= ';';
$row = mysql_fetch_array( mysql_query( $query ) );
- foreach ( $default_user_infos as $default_user_info ) {
- $$default_user_info = $row[$default_user_info];
+ foreach ( $default_user_infos as $info ) {
+ if ( isset( $row[$info] ) ) $$info = $row[$info];
+ else $$info = '';
}
}
//----------------------------------------------------- template initialization