aboutsummaryrefslogtreecommitdiffstats
path: root/admin/configuration.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-08-21 12:52:43 +0000
committerz0rglub <z0rglub@piwigo.org>2004-08-21 12:52:43 +0000
commitd4519a348fb8d4dd4af9704b8b6494b5f2b6260a (patch)
treea820044d89ad5698b617c78b18b6f5f06846ade5 /admin/configuration.php
parent5b35869ada1e42e980f753fb7711b4fa51b0502e (diff)
- add files metadata support : use info for database fields
- distinction between directories synchronization and metadata synchronization git-svn-id: http://piwigo.org/svn/trunk@486 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/configuration.php47
1 files changed, 35 insertions, 12 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 871784758..1d8356444 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -166,24 +166,38 @@ if ( isset( $_POST['submit'] ) )
array_push( $error, $lang['err_maxheight'] );
}*/
// updating configuraiton if no error found
- if ( count( $error ) == 0 )
+ if (count($error) == 0)
{
- $result = mysql_query( "SELECT * FROM ".CONFIG_TABLE );
- while ( $row = mysql_fetch_array( $result ) )
- {
- $config_name = $row['param'];
- $conf[$config_name] = ( isset($_POST[$config_name]) ) ? $_POST[$config_name] : $row['value'];
- if ( isset( $_POST[$config_name] ) )
+ $result = mysql_query('SELECT * FROM '.CONFIG_TABLE);
+ while ($row = mysql_fetch_array($result))
+ {
+ $config_name = $row['param'];
+ if (isset($_POST[$config_name]))
+ {
+ $conf[$config_name] = $_POST[$config_name];
+ }
+ else
{
- $query = 'UPDATE '.CONFIG_TABLE;
- $query.= " SET value = '". str_replace("\'", "''", $conf[$config_name]) ;
- $query.= "' WHERE param = '$config_name'";
- mysql_query( $query );
+ $conf[$config_name] = $row['value'];
+ }
+
+ if (isset($_POST[$config_name]))
+ {
+ $query = '
+UPDATE '.CONFIG_TABLE.'
+ SET value = \''. str_replace("\'", "''", $conf[$config_name]).'\'
+ WHERE param = \''.$config_name.'\'
+;';
+ mysql_query($query);
}
}
}
}
+// echo '<pre>';
+// print_r($conf);
+// echo '</pre>';
+
$access = ($conf['access']=='free')?'ACCESS_FREE':'ACCESS_RESTRICTED';
$log = ($conf['log']=='true')?'HISTORY_YES':'HISTORY_NO';
$mail_notif = ($conf['mail_notification']=='true')?'MAIL_NOTIFICATION_YES':'MAIL_NOTIFICATION_NO';
@@ -194,6 +208,8 @@ $expand = ($conf['auto_expand']=='true')?'EXPAND_TREE_YES':'EXPAND_TREE_NO';
$nb_comments = ($conf['show_nb_comments']=='true')?'NB_COMMENTS_YES':'NB_COMMENTS_NO';
$upload = ($conf['upload_available']=='true')?'UPLOAD_YES':'UPLOAD_NO';
$cookie = ($conf['authorize_cookies']=='true')?'COOKIE_YES':'COOKIE_NO';
+$use_exif = ($conf['use_exif']=='true')?'USE_EXIF_YES':'USE_EXIF_NO';
+$use_iptc = ($conf['use_iptc']=='true')?'USE_IPTC_YES':'USE_IPTC_NO';
//----------------------------------------------------- template initialization
$template->set_filenames( array('config'=>'admin/configuration.tpl') );
@@ -226,6 +242,8 @@ $template->assign_vars(array(
$nb_comments=>'checked="checked"',
$upload=>'checked="checked"',
$cookie=>'checked="checked"',
+ $use_exif=>'checked="checked"',
+ $use_iptc=>'checked="checked"',
'L_CONFIRM'=>$lang['conf_confirmation'],
'L_CONF_GENERAL'=>$lang['conf_general_title'],
@@ -290,9 +308,14 @@ $template->assign_vars(array(
'L_YES'=>$lang['yes'],
'L_NO'=>$lang['no'],
'L_SUBMIT'=>$lang['submit'],
+ 'L_CONF_METADATA'=>$lang['conf_metadata_title'],
+ 'L_USE_EXIF'=>$lang['conf_use_exif'],
+ 'L_USE_EXIF_INFO'=>$lang['conf_use_exif_info'],
+ 'L_USE_IPTC'=>$lang['conf_use_iptc'],
+ 'L_USE_IPTC_INFO'=>$lang['conf_use_iptc_info'],
'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?page=configuration')
- ));
+ ));
//-------------------------------------------------------------- errors display
if ( sizeof( $error ) != 0 )