From bef4b3e3aa8e3d54cbf8b4962b9b5d4a89b55429 Mon Sep 17 00:00:00 2001 From: gweltas Date: Mon, 2 Feb 2004 00:55:18 +0000 Subject: Merge of the 1.3.1 release Creation of an unique include file (common.php) Creation of an unique define file (include/constants.php) Modification of the installation procedure git-svn-id: http://piwigo.org/svn/trunk@345 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/configuration.php | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'admin/configuration.php') diff --git a/admin/configuration.php b/admin/configuration.php index bced7704f..9f4bbca97 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -60,6 +60,7 @@ if ( isset( $_POST['submit'] ) ) mysql_query( $query ); } // deletion of site as asked + $site_deleted = false; $query = 'SELECT id'; $query.= ' FROM '.PREFIX_TABLE.'sites'; $query.= " WHERE galleries_url <> './galleries/';"; @@ -70,12 +71,17 @@ if ( isset( $_POST['submit'] ) ) if ( $_POST[$site] == 1 ) { delete_site( $row['id'] ); - // if any picture of this site were linked to another categories, we - // have to update the informations of those categories. To make it - // simple, we just update all the categories - update_category( 'all' ); + $site_deleted = true; } } + // if any picture of this site were linked to another categories, we have + // to update the informations of those categories. To make it simple, we + // just update all the categories + if ( $site_deleted ) + { + update_category( 'all' ); + synchronize_all_users(); + } // thumbnail prefix must not contain accentuated characters $old_prefix = $_POST['prefix_thumbnail']; $prefix = strtr( $_POST['prefix_thumbnail'], $Caracs ); @@ -234,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 @@ -653,6 +651,7 @@ $vtp->setVar( $sub, 'param_line.name', $lang['customize_theme'] ); $vtp->addSession( $sub, 'select' ); $vtp->setVar( $sub, 'select.name', 'template' ); $option = get_dirs( './template/' ); + for ( $i = 0; $i < sizeof( $option ); $i++ ) { $vtp->addSession( $sub, 'option' ); -- cgit v1.2.3