aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-03-28 19:57:00 +0000
committerrub <rub@piwigo.org>2007-03-28 19:57:00 +0000
commit7c43a3c62d28162ee70e960f51e048727725cb31 (patch)
tree1b967195f4edf6db91bf25a6facda55ad08a8935
parentb86d4ac0b89e167bedbd03805e7c7024da5cef03 (diff)
Issue 578
User guest must be real user Step 1: guest is a real user On next commit, I finish installation and use of guest of user list and group git-svn-id: http://piwigo.org/svn/trunk@1926 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/configuration.php130
-rw-r--r--admin/include/functions.php31
-rw-r--r--admin/profile.php4
-rw-r--r--admin/user_list.php31
-rw-r--r--include/config_default.inc.php5
-rw-r--r--include/constants.php1
-rw-r--r--include/functions.inc.php2
-rw-r--r--include/functions_mail.inc.php18
-rw-r--r--include/functions_user.inc.php230
-rw-r--r--install/config.sql10
-rw-r--r--install/db/59-database.php8
-rw-r--r--install/db/60-database.php89
-rw-r--r--language/en_UK.iso-8859-1/admin.lang.php9
-rw-r--r--language/fr_FR.iso-8859-1/admin.lang.php9
-rw-r--r--plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php195
-rw-r--r--plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php263
-rw-r--r--plugins/admin_advices/main.inc.php2
-rw-r--r--profile.php62
-rw-r--r--template/yoga/admin/configuration.tpl81
-rw-r--r--template/yoga/profile_content.tpl2
20 files changed, 581 insertions, 601 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 4a7a39d66..26be50b8a 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -73,6 +73,7 @@ $comments_checkboxes = array(
if (isset($_POST['submit']) and !is_adviser())
{
$int_pattern = '/^\d+$/';
+
switch ($page['section'])
{
case 'main' :
@@ -113,28 +114,7 @@ if (isset($_POST['submit']) and !is_adviser())
}
case 'default' :
{
- // periods must be integer values, they represents number of days
- if (!preg_match($int_pattern, $_POST['recent_period'])
- or $_POST['recent_period'] <= 0)
- {
- array_push($page['errors'], $lang['periods_error']);
- }
- // maxwidth
- if (isset($_POST['default_maxwidth'])
- and !empty($_POST['default_maxwidth'])
- and (!preg_match($int_pattern, $_POST['default_maxwidth'])
- or $_POST['default_maxwidth'] < 50))
- {
- array_push($page['errors'], $lang['maxwidth_error']);
- }
- // maxheight
- if (isset($_POST['default_maxheight'])
- and !empty($_POST['default_maxheight'])
- and (!preg_match($int_pattern, $_POST['default_maxheight'])
- or $_POST['default_maxheight'] < 50))
- {
- array_push($page['errors'], $lang['maxheight_error']);
- }
+ // Never go here
break;
}
}
@@ -160,8 +140,8 @@ if (isset($_POST['submit']) and !is_adviser())
$query = '
UPDATE '.CONFIG_TABLE.'
- SET value = \''. str_replace("\'", "''", $value).'\'
- WHERE param = \''.$row['param'].'\'
+SET value = \''. str_replace("\'", "''", $value).'\'
+WHERE param = \''.$row['param'].'\'
;';
pwg_query($query);
}
@@ -223,6 +203,8 @@ $template->assign_vars(
$html_check='checked="checked"';
+$include_submit_buttons = true;
+
switch ($page['section'])
{
case 'main' :
@@ -288,91 +270,37 @@ switch ($page['section'])
}
case 'default' :
{
- $show_yes = ($conf['show_nb_comments']==true)?'checked="checked"':'';
- $show_no = ($conf['show_nb_comments']==false)?'checked="checked"':'';
- $hits_yes = ($conf['show_nb_hits']==true)?'checked="checked"':'';
- $hits_no = ($conf['show_nb_hits']==false)?'checked="checked"':'';
- $expand_yes = ($conf['auto_expand']==true)?'checked="checked"':'';
- $expand_no = ($conf['auto_expand']==false)?'checked="checked"':'';
+ $edit_user = build_user($conf['default_user_id'], false);
+ include_once(PHPWG_ROOT_PATH.'profile.php');
- $template->assign_block_vars(
- 'default',
- array(
- 'NB_IMAGE_LINE'=>$conf['nb_image_line'],
- 'NB_ROW_PAGE'=>$conf['nb_line_page'],
- 'CONF_RECENT'=>$conf['recent_period'],
- 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
- 'MAXWIDTH'=>$conf['default_maxwidth'],
- 'MAXHEIGHT'=>$conf['default_maxheight'],
- 'EXPAND_YES'=>$expand_yes,
- 'EXPAND_NO'=>$expand_no,
- 'SHOW_COMMENTS_YES'=>$show_yes,
- 'SHOW_COMMENTS_NO'=>$show_no,
- 'SHOW_HITS_YES'=>$hits_yes,
- 'SHOW_HITS_NO'=>$hits_no,
- ));
-
- $blockname = 'default.language_option';
-
- foreach (get_languages() as $language_code => $language_name)
+ $errors = array();
+ if ( !is_adviser() )
{
- if (isset($_POST['submit']))
+ if (save_profile_from_post($edit_user, $errors))
{
- $selected =
- $_POST['default_language'] == $language_code
- ? 'selected="selected"' : '';
+ // Reload user
+ $edit_user = build_user($conf['default_user_id'], false);
+ array_push($page['infos'], $lang['conf_confirmation']);
}
- else if ($conf['default_language'] == $language_code)
- {
- $selected = 'selected="selected"';
- }
- else
- {
- $selected = '';
- }
-
- $template->assign_block_vars(
- $blockname,
- array(
- 'VALUE'=> $language_code,
- 'CONTENT' => $language_name,
- 'SELECTED' => $selected
- ));
}
-
- $blockname = 'default.template_option';
-
- foreach (get_pwg_themes() as $pwg_template)
- {
- if (isset($_POST['submit']))
- {
- $selected =
- $_POST['default_template'] == $pwg_template
- ? 'selected="selected"' : '';
- }
- else if ($conf['default_template'] == $pwg_template)
- {
- $selected = 'selected="selected"';
- }
- else
- {
- $selected = '';
- }
-
- $template->assign_block_vars(
- $blockname,
- array(
- 'VALUE'=> $pwg_template,
- 'CONTENT' => $pwg_template,
- 'SELECTED' => $selected
- )
- );
- }
-
-
+ $page['errors'] = array_merge($page['errors'], $errors);
+
+ load_profile_in_template(
+ $action,
+ '',
+ $edit_user
+ );
+ $template->assign_block_vars('default', array());
+ $include_submit_buttons = false;
break;
}
}
+
+if ($include_submit_buttons)
+{
+ $template->assign_block_vars('include_submit_buttons', array());
+}
+
//----------------------------------------------------------- sending html code
$template->assign_var_from_handle('ADMIN_CONTENT', 'config');
?>
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 1395282ad..ac99539d6 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -4,7 +4,6 @@
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
@@ -1142,35 +1141,7 @@ SELECT user_id
if (count($to_create) > 0)
{
- $inserts = array();
-
- list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
-
- foreach ($to_create as $user_id)
- {
- $insert = array();
- $insert['user_id'] = $user_id;
- $insert['status'] = 'normal';
- $insert['template'] = $conf['default_template'];
- $insert['nb_image_line'] = $conf['nb_image_line'];
- $insert['nb_line_page'] = $conf['nb_line_page'];
- $insert['language'] = $conf['default_language'];
- $insert['recent_period'] = $conf['recent_period'];
- $insert['expand'] = boolean_to_string($conf['auto_expand']);
- $insert['show_nb_comments'] =
- boolean_to_string($conf['show_nb_comments']);
- $insert['show_nb_hits'] =
- boolean_to_string($conf['show_nb_hits']);
- $insert['maxwidth'] = $conf['default_maxwidth'];
- $insert['maxheight'] = $conf['default_maxheight'];
- $insert['registration_date'] = $dbnow;
-
- array_push($inserts, $insert);
- }
-
- mass_inserts(USER_INFOS_TABLE,
- array_keys($inserts[0]),
- $inserts);
+ create_user_infos($to_create);
}
// users present in user related tables must be present in the base user
diff --git a/admin/profile.php b/admin/profile.php
index 2263a6fff..9643aaf79 100644
--- a/admin/profile.php
+++ b/admin/profile.php
@@ -35,7 +35,7 @@ include_once(PHPWG_ROOT_PATH.'profile.php');
$errors = array();
if ( !is_adviser() )
{
- save_profile_from_post( $edit_user, $errors);
+ save_profile_from_post($edit_user, $errors);
}
load_profile_in_template(
@@ -43,7 +43,7 @@ load_profile_in_template(
get_root_url().'admin.php?page=user_list',
$edit_user
);
-$page['errors'] = array_merge($page['errors'], $errors );
+$page['errors'] = array_merge($page['errors'], $errors);
$template->set_filename('profile', 'admin/profile.tpl');
$template->assign_var_from_handle('ADMIN_CONTENT', 'profile');
diff --git a/admin/user_list.php b/admin/user_list.php
index 3f663509b..15b009290 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -4,8 +4,7 @@
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
-// | file : $RCSfile$
+// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
// | revision : $Revision$
@@ -547,19 +546,6 @@ foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
));
}
-// ---
-// $user['template'] = $conf['default_template'];
-// $user['nb_image_line'] = $conf['nb_image_line'];
-// $user['nb_line_page'] = $conf['nb_line_page'];
-// $user['language'] = $conf['default_language'];
-// $user['maxwidth'] = $conf['default_maxwidth'];
-// $user['maxheight'] = $conf['default_maxheight'];
-// $user['recent_period'] = $conf['recent_period'];
-// $user['expand'] = $conf['auto_expand'];
-// $user['show_nb_comments'] = $conf['show_nb_comments'];
-// $user['show_nb_hits'] = $conf['show_nb_hits'];
-// ---
-
if (isset($_POST['pref_submit']))
{
// echo '<pre>'; print_r($_POST); echo '</pre>';
@@ -588,13 +574,14 @@ if (isset($_POST['pref_submit']))
}
else
{
+ $default_user = get_default_user_info(true);
$template->assign_vars(
array(
- 'NB_IMAGE_LINE' => $conf['nb_image_line'],
- 'NB_LINE_PAGE' => $conf['nb_line_page'],
- 'MAXWIDTH' => @$conf['default_maxwidth'],
- 'MAXHEIGHT' => @$conf['default_maxheight'],
- 'RECENT_PERIOD' => $conf['recent_period'],
+ 'NB_IMAGE_LINE' => $default_user['nb_image_line'],
+ 'NB_LINE_PAGE' => $default_user['nb_line_page'],
+ 'MAXWIDTH' => $default_user['maxwidth'],
+ 'MAXHEIGHT' => $default_user['maxheight'],
+ 'RECENT_PERIOD' => $default_user['recent_period'],
));
}
@@ -606,7 +593,7 @@ foreach (get_pwg_themes() as $pwg_template)
{
$selected = $_POST['template']==$pwg_template ? 'selected="selected"' : '';
}
- else if ($conf['default_template'] == $pwg_template)
+ else if (get_default_template() == $pwg_template)
{
$selected = 'selected="selected"';
}
@@ -632,7 +619,7 @@ foreach (get_languages() as $language_code => $language_name)
{
$selected = $_POST['language']==$language_code ? 'selected="selected"':'';
}
- else if ($conf['default_language'] == $language_code)
+ else if (get_default_language() == $language_code)
{
$selected = 'selected="selected"';
}
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index 88eb54856..cc949f7b2 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -136,9 +136,6 @@ $conf['newcat_default_visible'] = true;
// automatically create private.
$conf['newcat_default_status'] = 'public';
-// newuser_default_enabled_high : at creation, must a user with enabled_high or not
-$conf['newuser_default_enabled_high'] = true;
-
// level_separator : character string used for separating a category level
// to the sub level. Suggestions : ' / ', ' &raquo; ', ' &rarr; ', ' - ',
// ' &gt;'
@@ -463,6 +460,8 @@ $conf['pass_convert'] = create_function('$s', 'return md5($s);');
// guest_id : id of the anonymous user
$conf['guest_id'] = 2;
+// default_user_id : id of user used for default value
+$conf['default_user_id'] = $conf['guest_id'];
// webmaster_id : webmaster'id.
$conf['webmaster_id'] = 1;
diff --git a/include/constants.php b/include/constants.php
index f442bac99..b7a0d9929 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -29,6 +29,7 @@ define('PHPWG_VERSION', 'Alligator');
define('PHPWG_DOMAIN', 'phpwebgallery.net');
define('PHPWG_URL', 'http://www.'.PHPWG_DOMAIN);
define('PHPWG_DEFAULT_LANGUAGE', 'en_UK.iso-8859-1');
+define('PHPWG_DEFAULT_TEMPLATE', 'yoga/clear');
// Error codes
define('GENERAL_MESSAGE', 200);
diff --git a/include/functions.inc.php b/include/functions.inc.php
index b69c88a71..69174ea4d 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -644,7 +644,7 @@ function redirect_html( $url , $msg = '', $refresh_time = 0)
include_once(get_language_filepath('common.lang.php'));
trigger_action('loading_lang');
@include_once(get_language_filepath('local.lang.php'));
- list($tmpl, $thm) = explode('/', $conf['default_template']);
+ list($tmpl, $thm) = explode('/', get_default_template());
$template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm);
}
else
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index 5f10d2f0a..d7314fb82 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -93,12 +93,12 @@ function format_email($name, $email)
/**
* Returns an completed array template/theme
- * completed with $conf['default_template']
+ * completed with get_default_template()
*
* @params:
* - args: incompleted array of template/theme
- * o template: template to use [default $conf['default_template']]
- * o theme: template to use [default $conf['default_template']]
+ * o template: template to use [default get_default_template()]
+ * o theme: template to use [default get_default_template()]
*/
function get_array_template_theme($args = array())
{
@@ -108,7 +108,7 @@ function get_array_template_theme($args = array())
if (empty($args['template']) or empty($args['theme']))
{
- list($res['template'], $res['theme']) = explode('/', $conf['default_template']);
+ list($res['template'], $res['theme']) = explode('/', get_default_template());
}
if (!empty($args['template']))
@@ -130,8 +130,8 @@ function get_array_template_theme($args = array())
* @params:
* - email_format: mail format
* - args: function params of mail function:
- * o template: template to use [default $conf['default_template']]
- * o theme: template to use [default $conf['default_template']]
+ * o template: template to use [default get_default_template()]
+ * o theme: template to use [default get_default_template()]
*/
function get_mail_template($email_format, $args = array())
{
@@ -298,7 +298,7 @@ order by
get_l10n_args('Browser: %s', $_SERVER['HTTP_USER_AGENT'])
);
- switch_lang_to($conf['default_language']);
+ switch_lang_to(get_default_language());
$return = pwg_mail
(
@@ -451,8 +451,8 @@ WHERE
* o content: content of mail [default value '']
* o content_format: format of mail content [default value 'text/plain']
* o email_format: global mail format [default value $conf_mail['default_email_format']]
- * o template: template to use [default $conf['default_template']]
- * o theme: template to use [default $conf['default_template']]
+ * o template: template to use [default get_default_template()]
+ * o theme: template to use [default get_default_template()]
*
* @return boolean (Ok or not)
*/
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index c3608eee3..635055f1a 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -147,25 +147,9 @@ function build_user( $user_id, $use_cache )
global $conf;
$user['id'] = $user_id;
$user = array_merge( $user, getuserdata($user_id, $use_cache) );
- if ( $user['id'] == $conf['guest_id'])
- {
- $user['is_the_guest']=true;
- $user['template'] = $conf['default_template'];
- $user['nb_image_line'] = $conf['nb_image_line'];
- $user['nb_line_page'] = $conf['nb_line_page'];
- $user['language'] = $conf['default_language'];
- $user['maxwidth'] = $conf['default_maxwidth'];
- $user['maxheight'] = $conf['default_maxheight'];
- $user['recent_period'] = $conf['recent_period'];
- $user['expand'] = $conf['auto_expand'];
- $user['show_nb_comments'] = $conf['show_nb_comments'];
- $user['show_nb_hits'] = $conf['show_nb_hits'];
- $user['enabled_high'] = $conf['newuser_default_enabled_high'];
- }
- else
- {
- $user['is_the_guest']=false;
- }
+ $user['is_the_guest'] = ($user['id'] == $conf['guest_id']);
+ $user['is_the_default'] = ($user['id'] == $conf['default_user_id']);
+
// calculation of the number of picture to display per page
$user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page'];
@@ -726,51 +710,150 @@ SELECT COUNT(*)
}
}
+/*
+ * Returns a array with default user value
+ *
+ * @param convert_str allows to convert string value if necessary
+ */
+function get_default_user_info($convert_str = true)
+{
+ global $page, $conf;
+
+ if (!isset($page['cache_default_user']))
+ {
+ $query = 'select * from '.USER_INFOS_TABLE.
+ ' where user_id = '.$conf['default_user_id'].';';
+
+ $result = pwg_query($query);
+ $page['cache_default_user'] = mysql_fetch_assoc($result);
+ }
+
+ if (is_array($page['cache_default_user']) and $convert_str)
+ {
+ $default_user = array();
+ foreach ($page['cache_default_user'] as $name => $value)
+ {
+ // If the field is true or false, the variable is transformed into a
+ // boolean value.
+ if ($value == 'true' or $value == 'false')
+ {
+ $default_user[$name] = get_boolean($value);
+ }
+ else
+ {
+ $default_user[$name] = $value;
+ }
+ }
+ return $default_user;
+ }
+ else
+ {
+ return $page['cache_default_user'];
+ }
+}
+
+/*
+ * Returns a default user value
+ *
+ * @param value_name: name of value
+ * @param sos_value: value used if don't exist value
+ */
+function get_default_user_value($value_name, $sos_value)
+{
+ $default_user = get_default_user_info(true);
+ if ($default_user === false or !isset($default_user[$value_name]))
+ {
+ return $sos_value;
+ }
+ else
+ {
+ return $default_user[$value_name];
+ }
+}
+
+/*
+ * Returns the default template value
+ *
+ */
+function get_default_template()
+{
+ return get_default_user_value('template', PHPWG_DEFAULT_TEMPLATE);
+}
+
+/*
+ * Returns the default language value
+ *
+ */
+function get_default_language()
+{
+ return get_default_user_value('language', PHPWG_DEFAULT_LANGUAGE);
+}
+
/**
* add user informations based on default values
*
- * @param int user_id
+ * @param int user_id / array of user_if
*/
-function create_user_infos($user_id)
+function create_user_infos($arg_id)
{
global $conf;
- list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
-
- if ($user_id == $conf['webmaster_id'])
+ if (is_array($arg_id))
{
- $status = 'webmaster';
+ $user_ids = $arg_id;
}
- else if ($user_id == $conf['guest_id'])
+ else
{
- $status = 'guest';
+ $user_ids = array();
+ if (is_integer($arg_id))
+ {
+ $user_ids[] = $arg_id;
+ }
}
- else
+
+ if (!empty($user_ids))
{
- $status = 'normal';
- }
-
- $insert =
- array(
- 'user_id' => $user_id,
- 'status' => $status,
- 'template' => $conf['default_template'],
- 'nb_image_line' => $conf['nb_image_line'],
- 'nb_line_page' => $conf['nb_line_page'],
- 'language' => $conf['default_language'],
- 'recent_period' => $conf['recent_period'],
- 'expand' => boolean_to_string($conf['auto_expand']),
- 'show_nb_comments' => boolean_to_string($conf['show_nb_comments']),
- 'show_nb_hits' => boolean_to_string($conf['show_nb_hits']),
- 'maxwidth' => $conf['default_maxwidth'],
- 'maxheight' => $conf['default_maxheight'],
- 'registration_date' => $dbnow,
- 'enabled_high' =>
- boolean_to_string($conf['newuser_default_enabled_high']),
- );
+ $inserts = array();
+ list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
- include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
- mass_inserts(USER_INFOS_TABLE, array_keys($insert), array($insert));
+ $default_user = get_default_user_info(false);
+ if ($default_user === false)
+ {
+ // Default on structure are used
+ $default_user = array();
+ }
+
+
+ foreach ($user_ids as $user_id)
+ {
+ if ($user_id == $conf['webmaster_id'])
+ {
+ $status = 'webmaster';
+ }
+ else if (($user_id == $conf['guest_id']) or
+ ($user_id == $conf['default_user_id']))
+ {
+ $status = 'guest';
+ }
+ else
+ {
+ $status = 'normal';
+ }
+
+ $insert =
+ array(
+ 'user_id' => $user_id,
+ 'status' => $status,
+ 'registration_date' => $dbnow
+ );
+
+ array_push($inserts, $insert);
+ }
+
+ include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+ mass_inserts(USER_INFOS_TABLE, array_keys($inserts[0]), $inserts);
+
+ }
}
/**
@@ -823,20 +906,47 @@ function get_language_filepath($filename, $dirname = '', $language = '')
}
$dirname .= 'language'.'/';
- $directories = array();
- if ( !empty($language) )
- {
- $directories[] = $dirname.$language;
- }
+ $dir_methods = array();
+ if (!empty($language))
{
- $directories[] = $dirname.$user['language'];
+ $dir_methods[] = 1;
}
- $directories[] = $dirname.$conf['default_language'];
- $directories[] = $dirname.PHPWG_DEFAULT_LANGUAGE;
- foreach ($directories as $directory)
+ $dir_methods[] = 2;
+ $dir_methods[] = 3;
+ $dir_methods[] = 4;
+
+ foreach ($dir_methods as $dir_method)
{
+ switch ($dir_method)
+ {
+ case '1':
+ {
+ $directory = $dirname.$language;
+ break;
+ }
+ case '2':
+ {
+ $directory = $dirname.$user['language'];
+ break;
+ }
+ case '3':
+ {
+ $directory = $dirname.get_default_language();
+ break;
+ }
+ case '4':
+ default:
+ {
+ $directory = $dirname.PHPWG_DEFAULT_LANGUAGE;
+ break;
+ }
+ {
+ $directory = '.';
+ }
+ }
+
$filepath = $directory.'/'.$filename;
if (file_exists($filepath))
diff --git a/install/config.sql b/install/config.sql
index 1669502bb..eea554e22 100644
--- a/install/config.sql
+++ b/install/config.sql
@@ -1,19 +1,9 @@
-- initial configuration for PhpWebGallery
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_language','en_UK.iso-8859-1','Default gallery language');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_template','yoga/clear','Default gallery style');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_maxwidth','','maximum width authorized for displaying images');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_maxheight','','maximum height authorized for the displaying images');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_comment_page','10','number of comments to display on each page');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('log','false','keep an history of visits on your website');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('comments_validation','false','administrators validate users comments before becoming visible');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('comments_forall','false','even guest not registered can post comments');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_image_line','5','Number of images displayed per row');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_line_page','3','Number of rows displayed per page');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('recent_period','7','Period within which pictures are displayed as new (in days)');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('auto_expand','false','Auto expand of the category tree');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_nb_comments','false','Show the number of comments under the thumbnails');
-INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_nb_hits', 'false', 'Show hits count under thumbnails');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_locked','false','Lock your gallery temporary for non admin users');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_title','PhpWebGallery demonstration site','Title at top of each page and for RSS feed');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('gallery_url','http://demo.phpwebgallery.net','URL given in RSS feed');
diff --git a/install/db/59-database.php b/install/db/59-database.php
index a7db0fb28..7f46712f0 100644
--- a/install/db/59-database.php
+++ b/install/db/59-database.php
@@ -4,10 +4,10 @@
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | file : $Id: 58-database.php 1912 2007-03-16 06:30:07Z rub $
-// | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
-// | last modifier : $Author: rub $
-// | revision : $Revision: 1912 $
+// | file : $Id$
+// | last update : $Date$
+// | last modifier : $Author$
+// | revision : $Revision$
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
diff --git a/install/db/60-database.php b/install/db/60-database.php
new file mode 100644
index 000000000..cf3dd9d40
--- /dev/null
+++ b/install/db/60-database.php
@@ -0,0 +1,89 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file : $Id$
+// | last update : $Date$
+// | last modifier : $Author$
+// | revision : $Revision$
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+$upgrade_description = 'Change default value on #user_infos for guest';
+
+include_once(PHPWG_ROOT_PATH.'include/constants.php');
+include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
+@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
+
+// +-----------------------------------------------------------------------+
+// | Upgrade content |
+// +-----------------------------------------------------------------------+
+
+load_conf_from_db();
+
+$query = "
+update ".USER_INFOS_TABLE."
+set
+ template = '".$conf['default_template']."',
+ nb_image_line = ".$conf['nb_image_line'].",
+ nb_line_page = ".$conf['nb_line_page'].",
+ language = '".$conf['default_language']."',
+ maxwidth = ".(empty($conf['default_maxwidth']) ? "null" : $conf['default_maxwidth']).",
+ maxheight = ".(empty($conf['default_maxheight']) ? "null" : $conf['default_maxheight']).",
+ recent_period = ".$conf['recent_period'].",
+ expand = '".boolean_to_string($conf['auto_expand'])."',
+ show_nb_comments = '".boolean_to_string($conf['show_nb_comments'])."',
+ show_nb_hits = '".boolean_to_string($conf['show_nb_hits'])."',
+ enabled_high = '".boolean_to_string(
+ (isset($conf['newuser_default_enabled_high']) ?
+ $conf['newuser_default_enabled_high'] : true))."'
+where
+ user_id = ".$conf['default_user_id'].";";
+pwg_query($query);
+
+
+$query = "
+delete from ".CONFIG_TABLE."
+where
+ param in
+(
+ 'default_template',
+ 'nb_image_line',
+ 'nb_line_page',
+ 'default_language',
+ 'default_maxwidth',
+ 'default_maxheight',
+ 'recent_period',
+ 'auto_expand',
+ 'show_nb_comments',
+ 'show_nb_hits'
+);";
+pwg_query($query);
+
+echo
+"\n"
+.'"'.$upgrade_description.'"'.' ended'
+."\n"
+;
+
+?>
diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php
index 89c3148fa..08437ad60 100644
--- a/language/en_UK.iso-8859-1/admin.lang.php
+++ b/language/en_UK.iso-8859-1/admin.lang.php
@@ -88,7 +88,6 @@ $lang['Email administrators when a comment requires validation'] = 'Email admins
$lang['Email administrators when a picture is uploaded'] = 'Email admins when a picture is uploaded';
$lang['Empty caddie'] = 'Empty caddie';
$lang['Environment'] = 'Environment';
-$lang['Expand all categories'] = 'Expand all categories';
$lang['Form'] = 'Form';
$lang['Gallery URL'] = 'Gallery URL';
$lang['Gallery description'] = 'Gallery description';
@@ -101,8 +100,6 @@ $lang['Guests'] = 'Guests';
$lang['History'] = 'History';
$lang['Informations'] = 'Informations';
$lang['Install'] = 'Install';
-$lang['Interface theme'] = 'Interface theme';
-$lang['Language'] = 'Language';
$lang['Link all category elements to a new category'] = 'Link all category elements to a new category';
$lang['Link all category elements to some existing categories'] = 'Link all category elements to some existing categories';
$lang['Linked categories'] = 'Linked categories';
@@ -112,8 +109,6 @@ $lang['Manage permissions for a category'] = 'Manage permissions for a category'
$lang['Manage permissions for group "%s"'] = 'Manage permissions for group "%s"';
$lang['Manage permissions for user "%s"'] = 'Manage permissions for user "%s"';
$lang['Manage tags'] = 'Manage tags';
-$lang['Maximum height of the pictures'] = 'Maximum height of the pictures';
-$lang['Maximum width of the pictures'] = 'Maximum width of the pictures';
$lang['Members'] = 'Members';
$lang['Metadata synchronized from file'] = 'Metadata synchronized from file';
$lang['Move categories'] = 'Move categories';
@@ -125,9 +120,7 @@ $lang['New tag'] = 'New tag';
$lang['No tag defined. Use Administration>Pictures>Tags'] = 'No tag defined. Use Administration>Pictures>Tags';
$lang['No'] = 'No';
$lang['Number of comments per page'] = 'Number of comments per page';
-$lang['Number of images per row'] = 'Number of images per row';
$lang['Number of rates'] = 'Number of rates';
-$lang['Number of rows per page'] = 'Number of rows per page';
$lang['Number of thumbnails to create'] = 'Number of thumbnails to create';
$lang['Only private categories are listed'] = 'Only private categories are listed';
$lang['Operating system'] = 'Operating system';
@@ -158,7 +151,6 @@ $lang['Random picture'] = 'Random picture';
$lang['Rate date'] = 'Rate date';
$lang['Rating by guests'] = 'Rating by guests';
$lang['Rating'] = 'Rating';
-$lang['Recent period'] = 'Recent period';
$lang['Reject All'] = 'Reject All';
$lang['Reject'] = 'Reject';
$lang['Representant'] = 'Representant';
@@ -171,7 +163,6 @@ $lang['Select at least one category'] = 'Select at least one category';
$lang['Select at least one picture'] = 'Select at least one picture';
$lang['Select at least one user'] = 'Select at least one user';
$lang['Show info'] = 'Show info';
-$lang['Show number of comments'] = 'Show number of comments';
$lang['Site manager'] = 'Site manager';
$lang['Status'] = 'Status';
$lang['Statistics'] = 'Statistics';
diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php
index ec7b037ea..75a24fa55 100644
--- a/language/fr_FR.iso-8859-1/admin.lang.php
+++ b/language/fr_FR.iso-8859-1/admin.lang.php
@@ -88,7 +88,6 @@ $lang['Email administrators when a comment requires validation'] = 'Notifier les
$lang['Email administrators when a picture is uploaded'] = 'Notifier les administrateurs quand une image est téléchargée';
$lang['Empty caddie'] = 'Vider le panier';
$lang['Environment'] = 'Environnement';
-$lang['Expand all categories'] = 'Développer toutes les catégories';
$lang['Form'] = 'Formulaire';
$lang['Gallery URL'] = 'URL de la galerie';
$lang['Gallery description'] = 'Description de la galerie';
@@ -101,8 +100,6 @@ $lang['Guests'] = 'Invités';
$lang['History'] = 'Historique';
$lang['Informations'] = 'Informations';
$lang['Install'] = 'Installer';
-$lang['Interface theme'] = 'Theme de l\'interface';
-$lang['Language'] = 'Langue';
$lang['Link all category elements to a new category'] = 'Associer tous les éléments de la catégorie à une nouvelle catégorie';
$lang['Link all category elements to some existing categories'] = 'Associer tous les éléments de la catégorie à des catégories existantes';
$lang['Linked categories'] = 'Catégories associées';
@@ -112,8 +109,6 @@ $lang['Manage permissions for a category'] = 'Gérer les permissions pour une cat
$lang['Manage permissions for group "%s"'] = 'Gérer les permissions pour le groupe "%s"';
$lang['Manage permissions for user "%s"'] = 'Gérer les permissions pour l\'utilisateur "%s"';
$lang['Manage tags'] = 'Gérer les tags';
-$lang['Maximum height of the pictures'] = 'Hauteur maximum des images';
-$lang['Maximum width of the pictures'] = 'Largeur maximum des images';
$lang['Members'] = 'Membres';
$lang['Metadata synchronized from file'] = 'Meta-données synchronisées à partir du fichier';
$lang['Move categories'] = 'Déplacer les catégories';
@@ -125,9 +120,7 @@ $lang['New tag'] = 'Nouveau tag';
$lang['No tag defined. Use Administration>Pictures>Tags'] = 'Aucun tag défini. Utiliser l\'écran Adminstration>Images>Tags';
$lang['No'] = 'Non';
$lang['Number of comments per page'] = 'Nombre de commentaires par page';
-$lang['Number of images per row'] = 'Nombre de miniatures par ligne';
$lang['Number of rates'] = 'Nombre de notes';
-$lang['Number of rows per page'] = 'Nombre de lignes par page';
$lang['Number of thumbnails to create'] = 'Nombre de miniatures à créer';
$lang['Only private categories are listed'] = 'Seules les catégories privées sont listées';
$lang['Operating system'] = 'System d\'exploitation';
@@ -158,7 +151,6 @@ $lang['Random picture'] = 'Au hasard';
$lang['Rate date'] = 'Date de notation';
$lang['Rating by guests'] = 'Notation par les visiteurs';
$lang['Rating'] = 'Notation';
-$lang['Recent period'] = 'Période récente';
$lang['Reject All'] = 'Tout rejeter';
$lang['Reject'] = 'Rejeter';
$lang['Representant'] = 'Représentant';
@@ -171,7 +163,6 @@ $lang['Select at least one category'] = 'Sélectionner au moins une catégorie';
$lang['Select at least one picture'] = 'Sélectionner au moins une image';
$lang['Select at least one user'] = 'Sélectionner au moins un utilisateur';
$lang['Show info'] = 'Montrer les informations';
-$lang['Show number of comments'] = 'Montrer le nombre de commentaires';
$lang['Site manager'] = 'Gestionnaire des sites';
$lang['Status'] = 'Statut';
$lang['Statistics'] = 'Statistiques';
diff --git a/plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php b/plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php
index 768323c61..c5e0c0850 100644
--- a/plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php
+++ b/plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php
@@ -26,7 +26,7 @@ foreach ($conf as $key => $value)
//
// Don't forget to update range for new advices
//
-$cases = range(1,35);
+$cases = range(1,34);
srand ((double) microtime() * 10000000);
shuffle($cases);
@@ -97,7 +97,7 @@ foreach ($cases as $id_adv)
Case 7 :
$adv[] = 'Current value: ' . (string) $conf['anti-flood_time'] . '.';
$adv[] = 'For normal flow processing, your value is probably too high. ' .
- 'Reasonable value is 60 (default).' ;
+ 'Reasonable value is 60 (default).' ;
$cond = ( $conf['anti-flood_time'] > 100 ) ? true : false;
$confk = 'anti-flood_time';
break;
@@ -105,7 +105,7 @@ foreach ($cases as $id_adv)
Case 8 :
$adv[] = 'Current value: ' . (string) $conf['calendar_datefield'] . '.';
$adv[] = 'Authorized values are ' .
- "'date_creation' or 'date_available'" .
+ "'date_creation' or 'date_available'" .
', otherwise you can get unpredictable results.' ;
$cond = ( !in_array($conf['calendar_datefield'],
array('date_creation','date_available')) );
@@ -116,7 +116,7 @@ foreach ($cases as $id_adv)
// If (iptc or exif) are used and date_creation is updated
// Then it's Ok, you can use date_creation by default for calendar
// else ... Advice
- $adv[] = 'Current value: ' . (string) $conf['calendar_datefield'] . '.';
+ $adv[] = 'Current value: ' . (string) $conf['calendar_datefield'] . '.';
$adv[] = "'date_creation'" . ' is NOT filled by ' .
'any activated use metadata mapping fields.';
$adv[] = 'So activate metadata usage <strong>or</strong> change to ' .
@@ -132,11 +132,11 @@ foreach ($cases as $id_adv)
'=> \'DateTimeOriginal\', ...<br />' .
'3 - Finally, a new task is up to you: Metadata synchronization.' ;
$cond2 = ( $conf['use_exif'] and
- isset($conf['use_exif_mapping']['date_creation']) );
+ isset($conf['use_exif_mapping']['date_creation']) );
$cond3 = ( $conf['use_iptc'] and
- isset($conf['use_iptc_mapping']['date_creation']) );
+ isset($conf['use_iptc_mapping']['date_creation']) );
$cond = ( $conf['calendar_datefield'] == 'date_creation' );
- $cond = ( ($cond2 or $cond3) and $cond ) ? false : true;
+ $cond = ( ($cond2 or $cond3) and $cond ) ? false : true;
$confk = 'calendar_datefield';
break;
@@ -149,69 +149,60 @@ foreach ($cases as $id_adv)
break;
Case 11 :
- $adv[] = 'Current value: true.';
- $adv[] = 'Any new subscriber has access to High Resolution pictures. ' .
- 'Is it what you want? No, so try ' .
- '$conf[\'newuser_default_enabled_high\'] = false;' ;
- $cond = $conf['newuser_default_enabled_high'];
- $confk = 'newuser_default_enabled_high';
- break;
-
- Case 12 :
$adv[] = 'Current value: ' . (string) $conf['level_separator'] . '.';
$adv[] = 'Try something else like $conf[\'level_separator\'] = \'+ \';';
$cond = ( $conf['level_separator'] == ' / ' );
$confk = 'level_separator';
break;
- Case 13 :
+ Case 12 :
$adv[] = 'Current value: ' . (string) $conf['paginate_pages_around'] . '.';
$adv[] = 'Usual range is between 2 and 5. To be light, choose ' .
'$conf[\'paginate_pages_around\'] = 2; <br />' .
'To offer large jump, choose $conf[\'paginate_pages_around\'] = 7;';
$cond = (($conf['paginate_pages_around'] < 2)
- or ($conf['paginate_pages_around'] > 12));
+ or ($conf['paginate_pages_around'] > 12));
$confk = 'paginate_pages_around';
break;
- Case 14 :
+ Case 13 :
$adv[] = 'Current value: ' . (string) $conf['tn_width'] . '.';
$adv[] = 'Should be a close value to your thumbnail width.' .
$adv[] = 'Usual range is between 96 and 150, ' .
- 'about $conf[\'tn_width\'] = 128;';
+ 'about $conf[\'tn_width\'] = 128;';
$cond = (($conf['tn_width'] < 66)
- or ($conf['tn_width'] > 180));
+ or ($conf['tn_width'] > 180));
$confk = 'tn_width';
break;
- Case 15 :
+ Case 14 :
$adv[] = 'Current value: ' . (string) $conf['tn_height'] . '.';
$adv[] = 'Should be a close value to your thumbnail height.' .
$adv[] = 'Usual range is between 96 and 150, ' .
- 'about $conf[\'tn_height\'] = 128;';
+ 'about $conf[\'tn_height\'] = 128;';
$cond = (($conf['tn_height'] < 66)
- or ($conf['tn_height'] > 180));
+ or ($conf['tn_height'] > 180));
$confk = 'tn_height';
break;
- Case 16 :
+ Case 15 :
$adv[] = 'Thumbnail height and width have to be equal.';
$adv[] = 'Choose $conf[\'tn_height\'] = ' . (string) $conf['tn_width'] .
- ';<br />' .
- 'or $conf[\'tn_width\'] = ' . (string) $conf['tn_height'] . ';';
+ ';<br />' .
+ 'or $conf[\'tn_width\'] = ' . (string) $conf['tn_height'] . ';';
$cond = ( $conf['tn_height'] !== $conf['tn_width'] );
$confk = 'tn_height';
break;
- Case 17 :
+ Case 16 :
$adv[] = 'Current value: true.';
$adv[] = 'For security reason, please set ' .
- '$conf[\'show_version\'] = false;';
+ '$conf[\'show_version\'] = false;';
$cond = $conf['show_version'];
$confk = 'show_version';
break;
- Case 18 :
+ Case 17 :
$adv[] = 'Current value: true.';
$adv[] = 'For a lighter gallery just have a look to ' .
'$conf[\'show_thumbnail_caption\'] = false;';
@@ -219,7 +210,7 @@ foreach ($cases as $id_adv)
$confk = 'show_thumbnail_caption';
break;
- Case 19 :
+ Case 18 :
$adv[] = 'Current value: true.';
$adv[] = 'For a lighter gallery just have a look to ' .
'$conf[\'show_picture_name_on_title\'] = false;';
@@ -227,7 +218,7 @@ foreach ($cases as $id_adv)
$confk = 'show_picture_name_on_title';
break;
- Case 20 :
+ Case 19 :
$adv[] = 'Current value: true.';
$adv[] = 'If you do NOT have any category descriptions just have ' .
'a look to $conf[\'subcatify\'] = false;';
@@ -235,7 +226,7 @@ foreach ($cases as $id_adv)
$confk = 'subcatify';
break;
- Case 21 :
+ Case 20 :
$adv[] = 'Current value: true.';
$adv[] = 'Leave $conf[\'allow_random_representative\'] = true; <br />' .
'but analyze if you can avoid for performance reasons.' ;
@@ -243,44 +234,44 @@ foreach ($cases as $id_adv)
$confk = 'allow_random_representative';
break;
- Case 22 :
+ Case 21 :
$adv[] = 'Current value: ' . (string) $conf['prefix_thumbnail'] . '.';
$adv[] = 'Be careful your $conf[\'prefix_thumbnail\'] is NOT standard.';
$adv[] = 'Do NOT change it except if your thumbnails are NOT visible.';
$adv[] = 'Distant site may use a different prefix but ' .
- 'create_listing_file.php must be modified.<br />' .
- 'You will get a warning message during synchronization in ' .
- 'that case.';
+ 'create_listing_file.php must be modified.<br />' .
+ 'You will get a warning message during synchronization in ' .
+ 'that case.';
$adv[] = 'Try to keep the same prefix thru all your sites either ' .
- 'local or distants.';
+ 'local or distants.';
$adv[] = 'Keep this parameter in your ./include/config_'.
- '<strong>local.inc.php</strong>. <br />'.
- 'See our wiki configuration page for more information about ' .
- './include/config_<strong>local.inc.php</strong>.';
+ '<strong>local.inc.php</strong>. <br />'.
+ 'See our wiki configuration page for more information about ' .
+ './include/config_<strong>local.inc.php</strong>.';
$cond = ( $conf['prefix_thumbnail'] !== 'TN-' );
$confk = 'prefix_thumbnail';
break;
- Case 23 :
+ Case 22 :
$adv[] = 'Current value: ' . (string) $conf['users_page'] . '.';
$adv[] = 'Unless you have a low band connection, you can draw up ' .
'$conf[\'users_page\'] to a higher value ' .
- 'if you have more than 20 members.';
+ 'if you have more than 20 members.';
$cond = ( $conf['users_page'] < 21 );
$confk = 'users_page';
break;
- Case 24 :
+ Case 23 :
$adv[] = 'Current value: true.';
$adv[] = 'Should be false, only few webmasters have to set ' .
'$conf[\'mail_options\'] = true; <br />' .
- 'A specific advice you can get from an advanced ' .
- 'user on our forum in some mailing issues.' ;
+ 'A specific advice you can get from an advanced ' .
+ 'user on our forum in some mailing issues.' ;
$cond = $conf['mail_options'];
$confk = 'mail_options';
break;
- Case 25 :
+ Case 24 :
$adv[] = 'Current value: true.';
$adv[] = 'Should be false, only PWG dev Team have to set ' .
'$conf[\'check_upgrade_feed\'] = true; for test purpose.' ;
@@ -288,7 +279,7 @@ foreach ($cases as $id_adv)
$confk = 'check_upgrade_feed';
break;
- Case 26 :
+ Case 25 :
$adv[] = '$conf[\'rate_items\'] has ' . count($conf['rate_items'])
. 'items.';
$adv[] = 'Your $conf[\'rate_items\'] would have 4 or 5 items not less.';
@@ -296,144 +287,144 @@ foreach ($cases as $id_adv)
$confk = 'rate_items';
break;
- Case 27 :
+ Case 26 :
$adv[] = '$conf[\'rate_items\'] has ' . count($conf['rate_items'])
. 'items.';
$adv[] = 'Your $conf[\'rate_items\'] would have 5 or 6 items not more.';
$adv[] = 'Check your best rated pictures prior to remove some values.' .
- '<br />Reduce excessive rating and change your ' .
+ '<br />Reduce excessive rating and change your ' .
'$conf[\'rate_items\'].';
$cond = ( count($conf['rate_items']) > 6 );
$confk = 'rate_items';
break;
-
- Case 28 :
+
+ Case 27 :
$adv[] = 'Current value: true.';
$adv[] = 'Could be true, think about $conf[\'show_iptc\'] = false;'
- . '<br />Some Professional photographers choose false ' .
- 'their reasons are not really professional.' ;
- $adv[] = 'Do NOT confuse between <strong>show</strong>_iptc and ' .
+ . '<br />Some Professional photographers choose false ' .
+ 'their reasons are not really professional.' ;
+ $adv[] = 'Do NOT confuse between <strong>show</strong>_iptc and ' .
'<strong>use</strong>_iptc (have a look on metadata page ' .
- 'on our wiki).';
+ 'on our wiki).';
$cond = $conf['show_iptc'];
$confk = 'show_iptc';
break;
-
- Case 29 :
+
+ Case 28 :
$adv[] = 'Current value: true.';
$adv[] = 'Documentalists and professionnal photographers would ' .
- 'set it true, but beginners should leave it ' .
- 'as $conf[\'use_iptc\'] = false;';
+ 'set it true, but beginners should leave it ' .
+ 'as $conf[\'use_iptc\'] = false;';
$adv[] = 'Take care of mentionned fields in metadata synchronization.' .
'<br />Mentionned fields would be rewrited with IPTC values ' .
- ' even those ones are NOT empty.';
- $adv[] = 'Do NOT confuse between <strong>show</strong>_iptc and ' .
+ ' even those ones are NOT empty.';
+ $adv[] = 'Do NOT confuse between <strong>show</strong>_iptc and ' .
'<strong>use</strong>_iptc (have a look on metadata page ' .
- 'on our wiki).';
+ 'on our wiki).';
$cond = $conf['use_iptc'];
$confk = 'use_iptc';
break;
-
- Case 30 :
+
+ Case 29 :
$adv[] = 'How to deal with IPTC:';
$adv[] = '1 - Copy one of your jpg pictures (a public one) in ./tools/' .
'<br />2 - Rename it as sample.jpg.' .
'<br />3 - Run ./tools/metadata.php' .
'<br />4 - Analyse results to determine which IPTC fields ' .
- 'could be used to override database fields.';
+ 'could be used to override database fields.';
$adv[] = 'Beginners would prefer to keep $conf[\'use_iptc\'] = false;';
$adv[] = 'Advanced users make documentation efforts prior ' .
- 'to upload their pictures.<br />' .
- 'IPTC fields have to be described in ' .
- '$conf[\'use_iptc_mapping\']';
- $adv[] = 'In any case, <strong>show</strong>_iptc_mapping and ' .
+ 'to upload their pictures.<br />' .
+ 'IPTC fields have to be described in ' .
+ '$conf[\'use_iptc_mapping\']';
+ $adv[] = 'In any case, <strong>show</strong>_iptc_mapping and ' .
'<strong>use</strong>_iptc_mapping must be totally different.';
$cond = true;
$confk = 'use_iptc';
break;
-
- Case 31 :
+
+ Case 30 :
$adv[] = 'How to deal with IPTC:';
$adv[] = '1 - Copy one of your jpg pictures (a public one) in ./tools/' .
'<br />2 - Rename it as sample.jpg.' .
'<br />3 - Run ./tools/metadata.php' .
'<br />4 - Analyse results to determine which IPTC fields ' .
- 'could be used to override database fields.';
+ 'could be used to override database fields.';
$adv[] = 'Beginners would prefer to keep $conf[\'use_iptc\'] = false;';
$adv[] = 'Advanced users make documentation efforts prior ' .
- 'to upload their pictures.';
+ 'to upload their pictures.';
$adv[] = 'Take care of mentionned fields in metadata synchronization.' .
'<br />Mentionned fields would be rewrited with IPTC values ' .
- ' even those ones are NOT empty.';
- $adv[] = 'In any case, <strong>show</strong>_iptc_mapping and ' .
+ ' even those ones are NOT empty.';
+ $adv[] = 'In any case, <strong>show</strong>_iptc_mapping and ' .
'<strong>use</strong>_iptc_mapping must be totally different.';
$cond = true;
$confk = 'use_iptc_mapping';
break;
-
- Case 32 :
+
+ Case 31 :
$adv[] = 'Current value: ' . ( ( $conf['show_exif'] ) ? 'true':'false' )
. '.';
$adv[] = 'Should be true, some information from your camera ' .
- 'can be displayed.';
+ 'can be displayed.';
$adv[] = 'Think about EXIF information could be different depending ' .
- 'on camera models.<br />' .
+ 'on camera models.<br />' .
'If you change your camera these fields could be ' .
- 'partly different.';
- $adv[] = 'Many professional photographers choose false, ' .
- 'their reasons are to protect their knowledge.' ;
- $adv[] = 'Do NOT confuse between <strong>show</strong>_exif and ' .
+ 'partly different.';
+ $adv[] = 'Many professional photographers choose false, ' .
+ 'their reasons are to protect their knowledge.' ;
+ $adv[] = 'Do NOT confuse between <strong>show</strong>_exif and ' .
'<strong>use</strong>_exif (have a look on metadata page ' .
- 'on our wiki).';
+ 'on our wiki).';
$cond = true;
$confk = 'show_exif';
break;
-
- Case 33 :
+
+ Case 32 :
$adv[] = 'How to deal with EXIF:';
$adv[] = '1 - Copy one of your jpg pictures (a public one) in ./tools/' .
'<br />2 - Rename it as sample.jpg.' .
'<br />3 - Run ./tools/metadata.php' .
'<br />4 - Analyse results to determine which EXIF fields ' .
- 'could be used to override database fields.';
+ 'could be used to override database fields.';
$adv[] = 'Beginners would prefer to let default values.';
$adv[] = 'Advanced users would take care of $lang values and ' .
- 'impacts on templates.';
- $adv[] = 'In any case, <strong>show</strong>_exif_fields and ' .
+ 'impacts on templates.';
+ $adv[] = 'In any case, <strong>show</strong>_exif_fields and ' .
'<strong>use</strong>_exif_mapping must be totally different.';
$cond = true;
$confk = 'show_exif_fields';
break;
-
- Case 34 :
+
+ Case 33 :
$adv[] = 'Current value: ' . ( ( $conf['use_exif'] ) ? 'true':'false' )
. '.';
$adv[] = 'Documentalists and professionnal photographers would ' .
- 'set it true, but beginners should leave the default value.';
+ 'set it true, but beginners should leave the default value.';
$adv[] = 'Take care of mentionned fields in metadata synchronization.' .
'<br />Mentionned fields would be rewrited with EXIF values ' .
- ' even those ones are NOT empty.';
- $adv[] = 'Do NOT confuse between <strong>show</strong>_exif and ' .
+ ' even those ones are NOT empty.';
+ $adv[] = 'Do NOT confuse between <strong>show</strong>_exif and ' .
'<strong>use</strong>_exif (have a look on metadata page ' .
- 'on our wiki).';
+ 'on our wiki).';
$cond = true;
$confk = 'use_exif';
break;
-
- Case 35 :
+
+ Case 34 :
$adv[] = 'How to deal with EXIF:';
$adv[] = '1 - Copy one of your jpg pictures (a public one) in ./tools/' .
'<br />2 - Rename it as sample.jpg.' .
'<br />3 - Run ./tools/metadata.php' .
'<br />4 - Analyse results to determine which EXIF fields ' .
- 'could be used to override database fields.';
+ 'could be used to override database fields.';
$adv[] = 'Beginners would prefer to let default values.';
$adv[] = 'Advanced users would carefully chose overrided fields ' .
- 'prior to synchronize.';
+ 'prior to synchronize.';
$adv[] = 'Take care of mentionned fields in metadata synchronization.' .
'<br />Mentionned fields would be rewrited with EXIF values ' .
- ' even those ones are NOT empty.';
- $adv[] = 'In any case, <strong>show</strong>_exif_fields and ' .
+ ' even those ones are NOT empty.';
+ $adv[] = 'In any case, <strong>show</strong>_exif_fields and ' .
'<strong>use</strong>_exif_mapping must be totally different.';
$cond = true;
$confk = 'use_exif_mapping';
diff --git a/plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php b/plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php
index d7399333c..5c44a53ae 100644
--- a/plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php
+++ b/plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php
@@ -26,7 +26,7 @@ foreach ($conf as $key => $value)
//
// Don't forget to update range for new advices
//
-$cases = range(1,35);
+$cases = range(1,34);
srand ((double) microtime() * 10000000);
shuffle($cases);
@@ -42,7 +42,7 @@ foreach ($cases as $id_adv)
$adv[] = 'Vous aurez plus de temps pour décrire et contrôler vos images. '
. 'Du temps pour vous décider entre un statut privé ou public.';
$adv[] = 'Si vous choisissez de rester privé, vous passerez directement '
- . 'à l\'attribution des autorisations. <br />'
+ . 'à l\'attribution des autorisations. <br />'
. 'Vos nouvelles catégories seront préparées plus facilement.';
$cond = ($conf['newcat_default_status'] !== 'public');
$confk = 'newcat_default_status';
@@ -51,7 +51,7 @@ foreach ($cases as $id_adv)
Case 2 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['slideshow_period'] . '.';
$adv[] = 'Ce délai pourrait être trop petit pour les connexions '
- . 'en bas débit.';
+ . 'en bas débit.';
$adv[] = 'Pensez à une valeur supérieure comme 4.';
$cond = ( $conf['slideshow_period'] < 4 );
$confk = 'slideshow_period';
@@ -83,7 +83,7 @@ foreach ($cases as $id_adv)
$adv[] = 'Valeur actuelle : ' . (string) $conf['top_number'] . '.';
$adv[] = 'Cette valeur pourrait être trop grande pour des connexions '
. 'bas débit.<br /> Pensez à une valeur située entre 25-50 '
- . 'en fonction de la taille de vos minitures.';
+ . 'en fonction de la taille de vos minitures.';
$cond = ( $conf['top_number'] > 50 );
$confk = 'top_number';
break;
@@ -99,7 +99,7 @@ foreach ($cases as $id_adv)
Case 7 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['anti-flood_time'] . '.';
$adv[] = 'Pour un traitement fluide, votre valeur est sans doute trop '
- . 'grande. Une valeur raisonnable serait 60 (valeur par défaut).' ;
+ . 'grande. Une valeur raisonnable serait 60 (valeur par défaut).' ;
$cond = ( $conf['anti-flood_time'] > 100 ) ? true : false;
$confk = 'anti-flood_time';
break;
@@ -107,7 +107,7 @@ foreach ($cases as $id_adv)
Case 8 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['calendar_datefield'] .'.';
$adv[] = 'Les valeurs admises sont '
- . "'date_creation' ou 'date_available'" . ', toute autre valeur'
+ . "'date_creation' ou 'date_available'" . ', toute autre valeur'
. 'peut aboutir à des résultats imprévisibles.' ;
$cond = ( !in_array($conf['calendar_datefield'],
array('date_creation','date_available')) );
@@ -118,11 +118,11 @@ foreach ($cases as $id_adv)
// If (iptc or exif) are used and date_creation is updated
// Then it's Ok, you can use date_creation by default for calendar
// else ... Advise
- $adv[] = 'Valeur actuelle : ' . (string) $conf['calendar_datefield'] .'.';
+ $adv[] = 'Valeur actuelle : ' . (string) $conf['calendar_datefield'] .'.';
$adv[] = "La 'date_creation'" . ' n\'est pas renseignée. Aucun champ '
. 'des méta-données (use_) n\'actualise la base.';
$adv[] = 'Soit vous activez l\'usage des méta-données <strong>ou'
- . '</strong> changez pour '
+ . '</strong> changez pour '
. '$conf[\'calendar_datefield\'] = \'date_available\'';
$adv[] = 'Activez l\'usage des méta-données simplement par: <br />'
. '1 - $conf[\'use_iptc\'] = true; ou $conf[\'use_exif\'] = true; '
@@ -134,13 +134,13 @@ foreach ($cases as $id_adv)
. '$conf[\'use_exif_mapping\'] = array(\'date_creation\' '
. '=> \'DateTimeOriginal\', ...<br />'
. '3 - Enfin une nouvelle tache vous est destinée: '
- . 'la synchronisation des méta-données.' ;
+ . 'la synchronisation des méta-données.' ;
$cond2 = ( $conf['use_exif'] and
- isset($conf['use_exif_mapping']['date_creation']) );
+ isset($conf['use_exif_mapping']['date_creation']) );
$cond3 = ( $conf['use_iptc'] and
- isset($conf['use_iptc_mapping']['date_creation']) );
+ isset($conf['use_iptc_mapping']['date_creation']) );
$cond = ( $conf['calendar_datefield'] == 'date_creation' );
- $cond = ( ($cond2 or $cond3) and $cond ) ? false : true;
+ $cond = ( ($cond2 or $cond3) and $cond ) ? false : true;
$confk = 'calendar_datefield';
break;
@@ -153,78 +153,67 @@ foreach ($cases as $id_adv)
break;
Case 11 :
- $adv[] = 'Valeur actuelle : true.';
- $adv[] = 'Il suffit de s\'inscrire pour avoir accès aux images en Haute '
- . 'résolution. Même les visiteurs occasionnels ont cet accès. '
- . '<br />C\'est bien ce que vous voulez, n\'est-ce pas? '
- . 'Non? Alors essayez ceci:<br />' .
- '$conf[\'newuser_default_enabled_high\'] = false;' ;
- $cond = $conf['newuser_default_enabled_high'];
- $confk = 'newuser_default_enabled_high';
- break;
-
- Case 12 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['level_separator'] . '.';
$adv[] = 'Vous pouvez toujours essayer un autre séparateur commme :'
- . '<br />$conf[\'level_separator\'] = \'+ \';';
+ . '<br />$conf[\'level_separator\'] = \'+ \';';
$cond = ( $conf['level_separator'] == ' / ' );
$confk = 'level_separator';
break;
- Case 13 :
+ Case 12 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['paginate_pages_around']
- . '.';
+ . '.';
$adv[] = 'Les valeurs habituelles se situent entre 2 et 5.'
- . 'Pour un site avec une interface légère, on choisira : <br />'
- . '$conf[\'paginate_pages_around\'] = 2; <br />'
- . 'Afin de proposer plus d\'accès directs, on choisira : <br />'
- . '$conf[\'paginate_pages_around\'] = 7;';
+ . 'Pour un site avec une interface légère, on choisira : <br />'
+ . '$conf[\'paginate_pages_around\'] = 2; <br />'
+ . 'Afin de proposer plus d\'accès directs, on choisira : <br />'
+ . '$conf[\'paginate_pages_around\'] = 7;';
$cond = (($conf['paginate_pages_around'] < 2)
- or ($conf['paginate_pages_around'] > 12));
+ or ($conf['paginate_pages_around'] > 12));
$confk = 'paginate_pages_around';
break;
- Case 14 :
+ Case 13 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['tn_width'] . '.';
$adv[] = 'Doit être une valeur proche de la largeur de vos miniatures.';
$adv[] = 'Les valeurs habituelles se situent entre 96 et 150, '
- . 'comme $conf[\'tn_width\'] = 128;';
+ . 'comme $conf[\'tn_width\'] = 128;';
$cond = (($conf['tn_width'] < 66)
- or ($conf['tn_width'] > 180));
+ or ($conf['tn_width'] > 180));
$confk = 'tn_width';
break;
- Case 15 :
+ Case 14 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['tn_height'] . '.';
$adv[] = 'Doit être une valeur proche de la hauteur de vos miniatures.';
$adv[] = 'Les valeurs habituelles se situent entre 96 et 150, '
- . 'comme $conf[\'tn_height\'] = 128;';
+ . 'comme $conf[\'tn_height\'] = 128;';
$cond = (($conf['tn_height'] < 66)
- or ($conf['tn_height'] > 180));
+ or ($conf['tn_height'] > 180));
$confk = 'tn_height';
break;
- Case 16 :
+ Case 15 :
$adv[] = 'Il n\'y a aucune raison pour que la largeur maximale soit '
- . 'différente de la hauteur maximale. Pourquoi les ajouts en '
- . 'portrait afficheraient des miniatures dans une résolution '
- . 'différente de celle des miniatures en paysage?';
+ . 'différente de la hauteur maximale. Pourquoi les ajouts en '
+ . 'portrait afficheraient des miniatures dans une résolution '
+ . 'différente de celle des miniatures en paysage?';
$adv[] = 'Essayez $conf[\'tn_height\'] = ' . (string) $conf['tn_width']
- . ';<br />'
- . 'ou $conf[\'tn_width\'] = ' . (string) $conf['tn_height'] . ';';
+ . ';<br />'
+ . 'ou $conf[\'tn_width\'] = ' . (string) $conf['tn_height'] . ';';
$cond = ( $conf['tn_height'] !== $conf['tn_width'] );
$confk = 'tn_height';
break;
- Case 17 :
+ Case 16 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Pour des raisons de sécurité de votre galerie, préférez '
- . '$conf[\'show_version\'] = false;';
+ . '$conf[\'show_version\'] = false;';
$cond = $conf['show_version'];
$confk = 'show_version';
break;
- Case 18 :
+ Case 17 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Pour une galerie moins chargée, faites le test de '
. '$conf[\'show_thumbnail_caption\'] = false;';
@@ -232,7 +221,7 @@ foreach ($cases as $id_adv)
$confk = 'show_thumbnail_caption';
break;
- Case 19 :
+ Case 18 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Pour une galerie moins chargée, faites le test de '
. '$conf[\'show_picture_name_on_title\'] = false;';
@@ -240,7 +229,7 @@ foreach ($cases as $id_adv)
$confk = 'show_picture_name_on_title';
break;
- Case 20 :
+ Case 19 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Aucune de vos catégories ne possède de descriptions alors '
. 'essayez $conf[\'subcatify\'] = false;';
@@ -248,56 +237,56 @@ foreach ($cases as $id_adv)
$confk = 'subcatify';
break;
- Case 21 :
+ Case 20 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Laissez $conf[\'allow_random_representative\'] = true; <br />'
. 'mais étudiez comment vous pouvez l\'éviter pour des raisons '
- . 'de performance.' ;
+ . 'de performance.' ;
$cond = $conf['allow_random_representative'];
$confk = 'allow_random_representative';
break;
- Case 22 :
+ Case 21 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['prefix_thumbnail'] . '.';
$adv[] = 'Attention, votre $conf[\'prefix_thumbnail\'] n\'est pas '
- . 'standard.';
+ . 'standard.';
$adv[] = 'Ne pas changer votre préfixe sauf si vos miniatures ont un '
- . 'problème d\'affichage.';
+ . 'problème d\'affichage.';
$adv[] = 'Un site distant peut avoir un préfixe différent, le '
- . 'create_listing_file.php devra être modifié.<br />'
- . 'Vous devriez avoir un message d\'avertissement pendant la '
- . 'synchronisation dans ce cas.';
+ . 'create_listing_file.php devra être modifié.<br />'
+ . 'Vous devriez avoir un message d\'avertissement pendant la '
+ . 'synchronisation dans ce cas.';
$adv[] = 'Try to keep the same prefix thru all your sites either '
- . 'local or distants.';
+ . 'local or distants.';
$adv[] = 'Conservez ce paramètre dans votre ./include/config_'
- . '<strong>local.inc.php</strong>. <br />'
- . 'Voir la page sur la configuration dans le Wiki pour plus '
- . 'd\'informations à propos de '
- . './include/config_<strong>local.inc.php</strong>.';
+ . '<strong>local.inc.php</strong>. <br />'
+ . 'Voir la page sur la configuration dans le Wiki pour plus '
+ . 'd\'informations à propos de '
+ . './include/config_<strong>local.inc.php</strong>.';
$cond = ( $conf['prefix_thumbnail'] !== 'TN-' );
$confk = 'prefix_thumbnail';
break;
- Case 23 :
+ Case 22 :
$adv[] = 'Valeur actuelle : ' . (string) $conf['users_page'] . '.';
$adv[] = 'A moins d\'avoir une connexion bas débit, vous pouvez '
. 'augmenter largement $conf[\'users_page\'] '
- . 'surtout si vous avez plus de 20 membres.';
+ . 'surtout si vous avez plus de 20 membres.';
$cond = ( $conf['users_page'] < 21 );
$confk = 'users_page';
break;
- Case 24 :
+ Case 23 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Devrait être à false, seulement quelques webmasters devront '
. 'indiquer $conf[\'mail_options\'] = true; <br />'
- . 'Un utilisateur avancé de notre forum les aura conseillé '
- . 'dans un seul cas de problème d\'email.' ;
+ . 'Un utilisateur avancé de notre forum les aura conseillé '
+ . 'dans un seul cas de problème d\'email.' ;
$cond = $conf['mail_options'];
$confk = 'mail_options';
break;
- Case 25 :
+ Case 24 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Devrait être à false, seuls les membres de l\'équipe PWG '
. 'codent $conf[\'check_upgrade_feed\'] = true; pour leurs tests.';
@@ -305,58 +294,58 @@ foreach ($cases as $id_adv)
$confk = 'check_upgrade_feed';
break;
- Case 26 :
+ Case 25 :
$adv[] = '$conf[\'rate_items\'] dispose de ' . count($conf['rate_items'])
. 'éléments.';
$adv[] = 'Votre $conf[\'rate_items\'] devrait avoir 4 ou 5 éléments '
- . 'mais pas moins.';
+ . 'mais pas moins.';
$cond = ( count($conf['rate_items']) < 4 );
$confk = 'rate_items';
break;
- Case 27 :
+ Case 26 :
$adv[] = '$conf[\'rate_items\'] has ' . count($conf['rate_items'])
. 'items.';
$adv[] = 'Votre $conf[\'rate_items\'] devrait avoir 4 ou 5 éléments '
- . 'mais pas plus.';
+ . 'mais pas plus.';
$adv[] = 'Contrôlez vos images les mieux notées avant de retirer '
- . ' certaines valeurs.'
- . '<br />Réduire les valeurs excessives et modifiez votre '
+ . ' certaines valeurs.'
+ . '<br />Réduire les valeurs excessives et modifiez votre '
. '$conf[\'rate_items\'].';
$cond = ( count($conf['rate_items']) > 6 );
$confk = 'rate_items';
break;
-
- Case 28 :
+
+ Case 27 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Peut être effectivement à true, éventuellement choisissez '
- . '$conf[\'show_iptc\'] = false;'
- . '<br />Comme quelques photographes professionnels choisissez '
- . 'false bien que leurs raisons ne soient guère professionnelles.';
- $adv[] = 'Ne confondez pas <strong>show</strong>_iptc et '
+ . '$conf[\'show_iptc\'] = false;'
+ . '<br />Comme quelques photographes professionnels choisissez '
+ . 'false bien que leurs raisons ne soient guère professionnelles.';
+ $adv[] = 'Ne confondez pas <strong>show</strong>_iptc et '
. '<strong>use</strong>_iptc (consultez la pages de métadonnées '
- . 'sur notre wiki).';
+ . 'sur notre wiki).';
$cond = $conf['show_iptc'];
$confk = 'show_iptc';
break;
-
- Case 29 :
+
+ Case 28 :
$adv[] = 'Valeur actuelle : true.';
$adv[] = 'Les documentalistes et photographes professionnels choisiront '
- . 'cette valeur true, mais les débutants devraient laisser '
- . '$conf[\'use_iptc\'] = false;';
+ . 'cette valeur true, mais les débutants devraient laisser '
+ . '$conf[\'use_iptc\'] = false;';
$adv[] = 'Faire attention aux champs mentionnés dans la synchronisation '
. 'des métadonnées.<br />Les champs indiqués pourront être '
- . 'écrasés par des valeurs de champs IPTC quand bien même ces '
- . 'champs ne seraient pas vides.';
- $adv[] = 'Ne confondez pas <strong>show</strong>_iptc et '
+ . 'écrasés par des valeurs de champs IPTC quand bien même ces '
+ . 'champs ne seraient pas vides.';
+ $adv[] = 'Ne confondez pas <strong>show</strong>_iptc et '
. '<strong>use</strong>_iptc (consultez la pages de métadonnées '
- . 'sur notre wiki).';
+ . 'sur notre wiki).';
$cond = $conf['use_iptc'];
$confk = 'use_iptc';
break;
-
- Case 30 :
+
+ Case 29 :
$adv[] = 'Comment gérer les IPTC:';
$adv[] = ' 1 - Copiez une image jpg (publique) dans ./tools/<br />'
. ' 2 - Renommez celle-ci en sample.jpg.<br />'
@@ -365,17 +354,17 @@ foreach ($cases as $id_adv)
. 'IPTC pourraient intéresser vos visiteurs.';
$adv[] = 'Les débutants laisseront $conf[\'use_iptc\'] = false;';
$adv[] = 'Les utilisateurs avancés feront des efforts de documentation '
- . 'avant de transférer leurs images.<br />'
- . 'Les champs IPTC doivent être décrits par '
- . '$conf[\'use_iptc_mapping\']';
- $adv[] = 'Dans tous les cas, <strong>show</strong>_iptc_mapping et '
- . '<strong>use</strong>_iptc_mapping seront '
- . 'totalement différents.';
+ . 'avant de transférer leurs images.<br />'
+ . 'Les champs IPTC doivent être décrits par '
+ . '$conf[\'use_iptc_mapping\']';
+ $adv[] = 'Dans tous les cas, <strong>show</strong>_iptc_mapping et '
+ . '<strong>use</strong>_iptc_mapping seront '
+ . 'totalement différents.';
$cond = true;
$confk = 'use_iptc';
break;
-
- Case 31 :
+
+ Case 30 :
$adv[] = 'Comment gérer les IPTC:';
$adv[] = ' 1 - Copiez une image jpg (publique) dans ./tools/<br />'
. ' 2 - Renommez celle-ci en sample.jpg.<br />'
@@ -384,39 +373,39 @@ foreach ($cases as $id_adv)
. 'IPTC pourraient intéresser vos visiteurs.';
$adv[] = 'Les débutants laisseront $conf[\'use_iptc\'] = false;';
$adv[] = 'Les utilisateurs avancés feront des efforts de documentation '
- . 'avant de transférer leurs images.<br />'
- . 'Les champs IPTC doivent être décrits par '
- . '$conf[\'use_iptc_mapping\']';
+ . 'avant de transférer leurs images.<br />'
+ . 'Les champs IPTC doivent être décrits par '
+ . '$conf[\'use_iptc_mapping\']';
$adv[] = 'Faire attention aux champs mentionnés dans la synchronisation '
. 'des métadonnées.<br />Les champs indiqués pourront être '
- . 'écrasés par des valeurs de champs IPTC quand bien même ces '
- . 'champs ne seraient pas vides.';
- $adv[] = 'Dans tous les cas, <strong>show</strong>_iptc_mapping et '
- . '<strong>use</strong>_iptc_mapping seront '
- . 'totalement différents.';
+ . 'écrasés par des valeurs de champs IPTC quand bien même ces '
+ . 'champs ne seraient pas vides.';
+ $adv[] = 'Dans tous les cas, <strong>show</strong>_iptc_mapping et '
+ . '<strong>use</strong>_iptc_mapping seront '
+ . 'totalement différents.';
$cond = true;
$confk = 'use_iptc_mapping';
break;
-
- Case 32 :
+
+ Case 31 :
$adv[] = 'Valeur actuelle : '
- . ( ( $conf['show_exif'] ) ? 'true':'false' ) . '.';
+ . ( ( $conf['show_exif'] ) ? 'true':'false' ) . '.';
$adv[] = 'Devrait être à true, certaines informations propres à votre '
- . 'appareil pourront être affichées.';
+ . 'appareil pourront être affichées.';
$adv[] = 'Pensez au fait que les informations EXIF peuvent être '
- . 'différentes suivant les modèles d\'appareil.<br />'
+ . 'différentes suivant les modèles d\'appareil.<br />'
. 'Si vous changez votre appareil ces champs pourraient en '
- . 'partie differents.';
- $adv[] = 'Beaucoup de photographes professionnels choissent false, '
- . 'ceci afin de protéger leur savoir-faire.' ;
- $adv[] = 'Ne confondez pas <strong>show</strong>_exif et '
+ . 'partie differents.';
+ $adv[] = 'Beaucoup de photographes professionnels choissent false, '
+ . 'ceci afin de protéger leur savoir-faire.' ;
+ $adv[] = 'Ne confondez pas <strong>show</strong>_exif et '
. '<strong>use</strong>_exif (consultez la pages de métadonnées '
- . 'sur notre wiki).';
+ . 'sur notre wiki).';
$cond = true;
$confk = 'show_exif';
break;
-
- Case 33 :
+
+ Case 32 :
$adv[] = 'Comment gérer les EXIF:';
$adv[] = ' 1 - Copiez une image jpg (publique) dans ./tools/<br />'
. ' 2 - Renommez celle-ci en sample.jpg.<br />'
@@ -426,31 +415,31 @@ foreach ($cases as $id_adv)
$adv[] = 'Les débutants laisseront la valeur par défaut.';
$adv[] = 'Les utilisateurs avancés penseront aux valeurs du tableau '
. '$lang; voire même à l\'impact possible sur les templates.';
- $adv[] = 'Dans tous les cas, <strong>show</strong>_exif_fields et '
- . '<strong>use</strong>_exif_mapping seront '
- . 'totalement différents.';
+ $adv[] = 'Dans tous les cas, <strong>show</strong>_exif_fields et '
+ . '<strong>use</strong>_exif_mapping seront '
+ . 'totalement différents.';
$cond = true;
$confk = 'show_exif_fields';
break;
-
- Case 34 :
+
+ Case 33 :
$adv[] = 'Valeur actuelle : ' . ( ( $conf['use_exif'] ) ? 'true':'false' )
. '.';
$adv[] = 'Les documentalistes et photographes professionnels choisiront '
- . 'cette valeur true, mais les débutants devraient laisser '
- . 'la valeur par défaut.';
+ . 'cette valeur true, mais les débutants devraient laisser '
+ . 'la valeur par défaut.';
$adv[] = 'Faire attention aux champs mentionnés dans la synchronisation '
. 'des métadonnées.<br />Les champs indiqués pourront être '
- . 'écrasés par des valeurs de champs EXIF quand bien même ces '
- . 'champs ne seraient pas vides.';
- $adv[] = 'Ne confondez pas <strong>show</strong>_exif et '
+ . 'écrasés par des valeurs de champs EXIF quand bien même ces '
+ . 'champs ne seraient pas vides.';
+ $adv[] = 'Ne confondez pas <strong>show</strong>_exif et '
. '<strong>use</strong>_exif (consultez la pages de métadonnées '
- . 'sur notre wiki).';
+ . 'sur notre wiki).';
$cond = true;
$confk = 'use_exif';
break;
-
- Case 35 :
+
+ Case 34 :
$adv[] = 'Comment gérer les EXIF:';
$adv[] = ' 1 - Copiez une image jpg (publique) dans ./tools/<br />'
. ' 2 - Renommez celle-ci en sample.jpg.<br />'
@@ -462,14 +451,14 @@ foreach ($cases as $id_adv)
. '$lang; voire même à l\'impact possible sur les templates.';
$adv[] = 'Les débutants laisseront $conf[\'use_exif\'] = false;';
$adv[] = 'Les utilisateurs avancés feront très attention aux champs '
- . 'sélectionnés et modifiés par la synchronisation.';
+ . 'sélectionnés et modifiés par la synchronisation.';
$adv[] = 'Faire attention aux champs mentionnés dans la synchronisation '
. 'des métadonnées.<br />Ces champs pourront être '
- . 'écrasés par des valeurs de champs EXIF quand bien même ces '
- . 'champs ne seraient pas vides.';
- $adv[] = 'Dans tous les cas, <strong>show</strong>_exif_fields et '
- . '<strong>use</strong>_exif_mapping seront '
- . 'totalement différents.';
+ . 'écrasés par des valeurs de champs EXIF quand bien même ces '
+ . 'champs ne seraient pas vides.';
+ $adv[] = 'Dans tous les cas, <strong>show</strong>_exif_fields et '
+ . '<strong>use</strong>_exif_mapping seront '
+ . 'totalement différents.';
$cond = true;
$confk = 'use_exif_mapping';
break;
diff --git a/plugins/admin_advices/main.inc.php b/plugins/admin_advices/main.inc.php
index 18600e4b1..5df961ef0 100644
--- a/plugins/admin_advices/main.inc.php
+++ b/plugins/admin_advices/main.inc.php
@@ -35,7 +35,7 @@ function set_admin_advice()
// Setup Advice Language (Maybe there is already a variable)
$advlang = ( isset($user['language']) ) ?
- $user['language'] : $conf['default_language']; // en_UK.iso-8859-1
+ $user['language'] : get_default_language(); // en_UK.iso-8859-1
$my_path = dirname(__FILE__).'/';
$adv = array();
if ( !@file_exists($my_path."$advlang/lang.adv.php") )
diff --git a/profile.php b/profile.php
index e83eac010..d612038d0 100644
--- a/profile.php
+++ b/profile.php
@@ -79,7 +79,7 @@ function save_profile_from_post(&$userdata, &$errors)
if (!isset($_POST['validate']))
{
- return;
+ return false;
}
$int_pattern = '/^\d+$/';
@@ -114,10 +114,13 @@ function save_profile_from_post(&$userdata, &$errors)
$errors[] = l10n('periods_error') ;
}
- $mail_error = validate_mail_address($_POST['mail_address']);
- if (!empty($mail_error))
+ if (isset($_POST['mail_address']))
{
- $errors[] = $mail_error;
+ $mail_error = validate_mail_address($_POST['mail_address']);
+ if (!empty($mail_error))
+ {
+ $errors[] = $mail_error;
+ }
}
if (!empty($_POST['use_new_pwd']))
@@ -149,25 +152,28 @@ function save_profile_from_post(&$userdata, &$errors)
// mass_updates function
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
- // update common user informations
- $fields = array($conf['user_fields']['email']);
+ if (isset($_POST['mail_address']))
+ {
+ // update common user informations
+ $fields = array($conf['user_fields']['email']);
- $data = array();
- $data{$conf['user_fields']['id']} = $_POST['userid'];
- $data{$conf['user_fields']['email']} = $_POST['mail_address'];
+ $data = array();
+ $data{$conf['user_fields']['id']} = $_POST['userid'];
+ $data{$conf['user_fields']['email']} = $_POST['mail_address'];
- // password is updated only if filled
- if (!empty($_POST['use_new_pwd']))
- {
- array_push($fields, $conf['user_fields']['password']);
- // password is encrpyted with function $conf['pass_convert']
- $data{$conf['user_fields']['password']} =
- $conf['pass_convert']($_POST['use_new_pwd']);
+ // password is updated only if filled
+ if (!empty($_POST['use_new_pwd']))
+ {
+ array_push($fields, $conf['user_fields']['password']);
+ // password is encrpyted with function $conf['pass_convert']
+ $data{$conf['user_fields']['password']} =
+ $conf['pass_convert']($_POST['use_new_pwd']);
+ }
+ mass_updates(USERS_TABLE,
+ array('primary' => array($conf['user_fields']['id']),
+ 'update' => $fields),
+ array($data));
}
- mass_updates(USERS_TABLE,
- array('primary' => array($conf['user_fields']['id']),
- 'update' => $fields),
- array($data));
// update user "additional" informations (specific to PhpWebGallery)
$fields = array(
@@ -190,8 +196,12 @@ function save_profile_from_post(&$userdata, &$errors)
array($data));
// redirection
- redirect($_POST['redirect']);
+ if (!empty($_POST['redirect']))
+ {
+ redirect($_POST['redirect']);
+ }
}
+ return true;
}
@@ -283,10 +293,16 @@ function load_profile_in_template($url_action, $url_redirect, $userdata)
'SELECTED' => $selected
));
}
- if ( !defined('IN_ADMIN') )
+
+ if (!($userdata['is_the_guest'] or $userdata['is_the_default']))
{
- $template->assign_block_vars( 'not_admin', array() );
+ $template->assign_block_vars('not_special_user', array());
+ if ( !defined('IN_ADMIN') )
+ {
+ $template->assign_block_vars( 'not_special_user.not_admin', array() );
+ }
}
+
$template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content');
}
?>
diff --git a/template/yoga/admin/configuration.tpl b/template/yoga/admin/configuration.tpl
index 4a950ea34..2df05e936 100644
--- a/template/yoga/admin/configuration.tpl
+++ b/template/yoga/admin/configuration.tpl
@@ -140,88 +140,13 @@
<!-- END comments -->
<!-- BEGIN default -->
-<fieldset id="defaultConf">
- <ul>
- <li>
- <span class="property">
- <label for="default_language">{lang:Language}</label>
- </span>
- <select name="default_language" id="default_language">
- <!-- BEGIN language_option -->
- <option value="{default.language_option.VALUE}" {default.language_option.SELECTED}>{default.language_option.CONTENT}</option>
- <!-- END language_option -->
- </select>
- </li>
-
- <li>
- <span class="property">
- <label for="nb_image_line">{lang:Number of images per row}</label>
- </span>
- <input type="text" size="3" maxlength="2" id="nb_image_line" name="nb_image_line" value="{default.NB_IMAGE_LINE}" />
- </li>
-
- <li>
- <span class="property">
- <label for="nb_line_page">{lang:Number of rows per page}</label>
- </span>
- <input type="text" size="3" maxlength="2" id="nb_line_page" name="nb_line_page" value="{default.NB_ROW_PAGE}" />
- </li>
-
- <li>
- <span class="property">
- <label for="default_template">{lang:Interface theme}</label>
- </span>
- <select name="default_template" id="default_template">
- <!-- BEGIN template_option -->
- <option value="{default.template_option.VALUE}" {default.template_option.SELECTED}>{default.template_option.CONTENT}</option>
- <!-- END template_option -->
- </select>
- </li>
-
- <li>
- <span class="property">
- <label for="recent_period">{lang:Recent period}</label>
- </span>
- <input type="text" size="3" maxlength="2" name="recent_period" id="recent_period" value="{default.CONF_RECENT}" />
- </li>
-
- <li>
- <span class="property">{lang:Expand all categories}</span>
- <label><input type="radio" class="radio" name="auto_expand" value="true" {default.EXPAND_YES} />{lang:Yes}</label>
- <label><input type="radio" class="radio" name="auto_expand" value="false" {default.EXPAND_NO} />{lang:No}</label>
- </li>
-
- <li>
- <span class="property">{lang:Show number of comments}</span>
- <label><input type="radio" class="radio" name="show_nb_comments" value="true" {default.SHOW_COMMENTS_YES} />{lang:Yes}</label>
- <label><input type="radio" class="radio" name="show_nb_comments" value="false" {default.SHOW_COMMENTS_NO} />{lang:No}</label>
- </li>
-
- <li>
- <span class="property">{lang:show_nb_hits}</span>
- <label><input type="radio" class="radio" name="show_nb_hits" value="true" {default.SHOW_HITS_YES} />{lang:Yes}</label>
- <label><input type="radio" class="radio" name="show_nb_hits" value="false" {default.SHOW_HITS_NO} />{lang:No}</label>
- </li>
-
- <li>
- <span class="property">
- <label for="default_maxwidth">{lang:Maximum width of the pictures}</label>
- </span>
- <input type="text" size="4" maxlength="4" id="default_maxwidth" name="default_maxwidth" value="{default.MAXWIDTH}" />
- </li>
-
- <li>
- <span class="property">
- <label for="default_maxheight">{lang:Maximum height of the pictures}</label>
- </span>
- <input type="text" size="4" maxlength="4" id="default_maxheight" name="default_maxheight" value="{default.MAXHEIGHT}" />
- </li>
- </ul>
-</fieldset>
+{PROFILE_CONTENT}
<!-- END default -->
+<!-- BEGIN include_submit_buttons -->
<p>
<input class="submit" type="submit" name="submit" value="{lang:Submit}" {TAG_INPUT_ENABLED}>
<input class="submit" type="reset" name="reset" value="{lang:Reset}">
</p>
+<!-- END include_submit_buttons -->
</form>
diff --git a/template/yoga/profile_content.tpl b/template/yoga/profile_content.tpl
index bebddcb12..70645b282 100644
--- a/template/yoga/profile_content.tpl
+++ b/template/yoga/profile_content.tpl
@@ -9,6 +9,7 @@
<span class="property">{lang:Username}</span>
{USERNAME}
</li>
+<!-- BEGIN not_special_user -->
<li>
<span class="property">
<label for="mail_address">{lang:Email address}</label>
@@ -36,6 +37,7 @@
<input type="password" name="passwordConf" id="passwordConf" value="">
</li>
</ul>
+<!-- END not_special_user -->
</fieldset>
<fieldset>