From aa5f1e3358e0123d785755d90d25a5cee340f754 Mon Sep 17 00:00:00 2001 From: vdigital Date: Wed, 3 Jan 2007 20:31:54 +0000 Subject: "Admin Advices !" Standard plugin : May give you sometimes an advice on the administration page. A draft version: With 3 advices in English and only one in French. Maybe we can have more than 50 advices from a starting point. This plugin is mainly for beginners but not only. git-svn-id: http://piwigo.org/svn/trunk@1694 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/admin_advices/admin_advices.tpl | 11 + .../admin_advices/en_UK.iso-8859-1/lang.adv.php | 319 +++++++++++++++++++++ .../admin_advices/fr_FR.iso-8859-1/lang.adv.php | 319 +++++++++++++++++++++ plugins/admin_advices/main.inc.php | 56 ++++ 4 files changed, 705 insertions(+) create mode 100644 plugins/admin_advices/admin_advices.tpl create mode 100644 plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php create mode 100644 plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php create mode 100644 plugins/admin_advices/main.inc.php (limited to 'plugins/admin_advices') diff --git a/plugins/admin_advices/admin_advices.tpl b/plugins/admin_advices/admin_advices.tpl new file mode 100644 index 000000000..0125be5f7 --- /dev/null +++ b/plugins/admin_advices/admin_advices.tpl @@ -0,0 +1,11 @@ + +
+

{lang:About}: {ADVICE_ABOUT}

+ +
+
{ADVICE_TEXT}
+ +
{More.ADVICE}
+ +
+
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 new file mode 100644 index 000000000..8c7688225 --- /dev/null +++ b/plugins/admin_advices/en_UK.iso-8859-1/lang.adv.php @@ -0,0 +1,319 @@ +' . + ' 2 - Rename it as sample.jpg.
' . + ' 3 - Run ./tools/metadata.php
' . + ' 4 - Analyse results to determine which ITPC fields could be' . + ' useful for your visitors.'; + $adv[] = 'Beginners would prefer to keep $conf[\'show_iptc\'] = false;'; + $adv[] = 'Advanced users would take care of $lang values and impacts' . + ' on templates.'; + $cond = true; + $confk = 'show_iptc_mapping'; + break 2; + + + default : + $nomore = true; + $adv[] = ''; + $cond = false; + } +} +/* +A Ajouter si besoin: +sprintf($adv[0/1], $conf[$confk]); + +Conseils à intégrer: +( $conf['top_number'] > 50 ) + 'top_number', + 'Your current value (%u) is maybe too high for low ' . + 'connexions, think about 25-50 depending on your thumbnail sizes.' + + +( $conf['top_number'] < 2 ) + 'top_number', + 'Your current value (%u) may be too low for some people,' . + ' might be about 5-10 depending on your thumbnail sizes.' + +( $conf['anti-flood_time'] > 100 ) + 'anti-flood_time', + 'Your current value (%u) could be too high,' . + ' should be arround 60 for flow reasons only.' + + +( !in_array($conf['calendar_datefield'], +array('date_creation','date_available') ) + 'calendar_datefield', + 'Current value: %s. Authorized values are ' . + '\'date_creation\' or \'date_available\', otherwise you can get ' . + 'unpredictable results.' + + // If (iptc & exif) are used and date_creation is updated + // Then it's Ok + // else Using Calendar by date_creation is quite stupid + // Take care! condition has been reversed by first ! (so then is else) + if ( ! ( ($conf['use_iptc'] == true) or ($conf['use_exif'] == true) ) and + ( (isset($conf['use_iptc']['date_creation'])) or + (isset($conf['use_exif']['date_creation'])) ) ) + { +( $conf['calendar_datefield'] == 'date_creation' ) + 'calendar_datefield', + 'Current value: %s. ' . + ' \'date_creation\' is NOT filled by any activated use metadata ' . + 'mapping fields.' , + 'So activate metadata usage or change to $conf[\'calendar_datefield\'] ' . + '= \'date_available\'' , + '1 - Activate metadata usage as you want: ', + '$conf[\'use_iptc\'] = true; or $conf[\'use_exif\'] = true; each way ' . + 'may be correct.' , + '2 - And respectively map:' , + '$conf[\'use_iptc_mapping\'] = array( ..., \'date_creation\' ' . + '=> \'2#055\', ...' , + 'or/and:' , + '$conf[\'use_exif_mapping\'] = array(\'date_creation\' ' . + '=> \'DateTimeOriginal\', ...' , + '3 - Finally, a new task is up to you: Metadata synchronization.' + } + + +( $conf['newcat_default_visible'] == false ) + 'newcat_default_visible', + 'Your current value: false.' . + 'Not useful, private status is better, so code ' . + '$conf[\'newcat_default_visible\'] = true;' + +( $conf['newcat_default_status'] == 'public' ) + 'newcat_default_status', 'Your current value: public.' , + 'Try $conf[\'newcat_default_status\'] = \'private\'; could allow ' . + 'you time to prepare.' + +( $conf['newuser_default_enabled_high'] == true ) + 'newuser_default_enabled_high', + 'Your current value: true.' . + ' Any new subscriber has access to High Resolution pictures is what ' . + 'you want, if NOT try $conf[\'newuser_default_enabled_high\'] = false;' + +( $conf['level_separator'] == ' / ' ) + 'level_separator', + 'Current value: \' / \'.' . + 'Try just a comma like this $conf[\'level_separator\'] = \', \';' + +(($conf['paginate_pages_around'] < 2) or ($conf['paginate_pages_around'] > 12)) + 'paginate_pages_around', + 'Current value: %u.' . + 'Usual range is between 2 and 5, be light as ' . + '$conf[\'paginate_pages_around\'] = 2;' . + ' or dynamic for visitors as $conf[\'paginate_pages_around\'] = 7;' + +( ($conf['tn_width'] < 66) or ($conf['tn_width'] > 180) ) + 'tn_width', + 'Current value: %u.' . + 'Should be a closed value to your thumbnail width.' . + ' Usual range is between 96 and 150, about $conf[\'tn_width\'] = 128;' + +( ($conf['tn_height'] < 66) or ($conf['tn_height'] > 180)) + 'tn_height', + 'Current value: %u.' . + 'Should be a closed value to your thumbnail height.' . + ' Usual range is between 96 and 150, about $conf[\'tn_height\'] = 128;' + +( $conf['tn_height'] == $conf['tn_width'] ) + 'tn_height', + 'Try equal values like this $conf[\'tn_height\'] = $conf[\'tn_width\'];' . + 'or $conf[\'tn_width\'] = $conf[\'tn_height\']; ' . + 'depending on the first set value.' + +( $conf['show_version'] == true ) + 'show_version', + 'Current value: true.' . + 'For security reason, please set $conf[\'show_version\'] = false;' + +( $conf['show_thumbnail_caption'] == true ) + 'show_thumbnail_caption', + 'Current value: true.' . + 'For a lighter gallery just have a look to ' . + '$conf[\'show_thumbnail_caption\'] = false;' + +( $conf['show_picture_name_on_title'] == true ) + 'show_picture_name_on_title', + 'Current value: true.' . + 'For a lighter gallery just have a look to ' . + '$conf[\'show_picture_name_on_title\'] = false;' + +( $conf['subcatify'] == true ) + 'subcatify', + 'Current value: true.' . + 'If you do NOT have any category descriptions just have a look to' . + ' $conf[\'subcatify\'] = false;' + +( $conf['allow_random_representative'] == true ) + 'allow_random_representative', + 'Current value: true.' . + 'Leave $conf[\'allow_random_representative\'] = true; but study ' . + 'if you can avoid' + +( $conf['prefix_thumbnail'] !== 'TN-' ) + 'prefix_thumbnail', + 'Current value: \'%s\'.' . + 'Be careful your $conf[\'prefix_thumbnail\'] is NOT standard.', + 'Return to default if your thumbnail are NOT visible.' , + 'Default is $conf[\'prefix_thumbnail\'] = \'TN-\';' . + 'Distant site may use a different prefix but create_listing_file.php ' . + 'must be changed.' + +( $conf['users_page'] < 21 ) + 'users_page', + 'Current value: %u.' . + 'Unless your connexion is low, you can draw up $conf[\'users_page\'] ' . + 'to a higher value.' + +( $conf['mail_options'] == true ) + 'mail_options', + 'Current value: true.' . + 'Should be false, only few webmasters have to set ' . + '$conf[\'mail_options\'] = true; On specific advice.' + +( $conf['check_upgrade_feed'] == true ) + 'check_upgrade_feed', + 'Current value: true.' . + 'Should be false, only PWG Team have to set ' . + '$conf[\'check_upgrade_feed\'] = true; for BSF tests purpose.' + +( count( $conf['rate_items'] ) < 4 ) + 'rate_items', + 'Your $conf[\'rate_items\'] would have 4 or 5 items not less.' + +( count( $conf['rate_items'] ) > 6) + 'rate_items', + 'Your $conf[\'rate_items\'] would have 5 or 6 items not more.' + +( $conf['show_itpc'] == true ) + 'show_itpc', + 'Current value: true.' . + ' Could be true, but usualy $conf[\'show_iptc\'] = false; ' . + 'Only set true if you want to show other IPTC fields.', + 'Or if you want different descriptions between PWG ' . + 'database and IPTC fields.', + 'In any case, show_iptc_mapping and use_iptc_mapping must be ' . + 'totally different.' + +( $conf['use_itpc'] == true ) + 'use_itpc', + 'Current value: true.' . + ' Documentalists and professionnal photographers would set it true,' . + ' but beginners should leave as $conf[\'use_iptc\'] = false;' . + ' Take care of mentionned fields in metadata synchronization.' . + ' Mentionned fields would be rewrited with IPTC values even those ones are empty.' + +( true ) + 'use_iptc_mapping', + ' 1 - Copy one of your jpg pictures (a public one) in ./tools/' . + ' 2 - Rename it as sample.jpg.' . + ' 3 - Run ./tools/metadata.php' . + ' 4 - Analyse results to determine which ITPC fields could be used to override database fields.' . + ' Beginners would prefer to keep $conf[\'use_iptc\'] = false;' . + ' Advanced users make documentation efforts prior to upload their pictures.' + +( true ) + 'show_exif', + 'Current value: ' . (( $conf['show_exif']) ? 'true.':'false.') . + ' Should be true, some information from your camera can be displayed.' . + ' Think about EXIF information could be different depending on camera models.' . + ' If you change your camera these fields could be partly different.' ); + +( true ) + 'show_exif_mapping', + ' Process as for iptc mapping.' . + ' Beginners would prefer to let default values.' . + ' Advanced users would take care of $lang values and impacts on templates.' + +( $conf['use_exif'] == true ) + 'use_exif', + 'Current value: true.' . + ' Documentalists and professionnal photographers would set it true,' . + ' but beginners should leave the default value;' . + ' Take care of mentionned fields in metadata synchronization.' . + ' Mentionned fields would be rewrited with EXIF values even those ones are empty.' + +( true ) + 'use_exif_mapping', + ' Process as for iptc mapping.' . + ' Beginners would prefer to let default values again.' . + ' Advanced users would carefully chose overrided fields prior to synchronize.' + + + */ + +?> 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 new file mode 100644 index 000000000..371733eff --- /dev/null +++ b/plugins/admin_advices/fr_FR.iso-8859-1/lang.adv.php @@ -0,0 +1,319 @@ +' . + ' 2 - Rename it as sample.jpg.
' . + ' 3 - Run ./tools/metadata.php
' . + ' 4 - Analyse results to determine which ITPC fields could be' . + ' useful for your visitors.'; + $adv[] = 'Beginners would prefer to keep $conf[\'show_iptc\'] = false;'; + $adv[] = 'Advanced users would take care of $lang values and impacts' . + ' on templates.'; + $cond = true; + $confk = 'show_iptc_mapping'; + break 2; + + + default : + $nomore = true; + $adv[] = ''; + $cond = false; + } +} +/* +A Ajouter si besoin: +sprintf($adv[0/1], $conf[$confk]); + +Conseils à intégrer: +( $conf['top_number'] > 50 ) + 'top_number', + 'Your current value (%u) is maybe too high for low ' . + 'connexions, think about 25-50 depending on your thumbnail sizes.' + + +( $conf['top_number'] < 2 ) + 'top_number', + 'Your current value (%u) may be too low for some people,' . + ' might be about 5-10 depending on your thumbnail sizes.' + +( $conf['anti-flood_time'] > 100 ) + 'anti-flood_time', + 'Your current value (%u) could be too high,' . + ' should be arround 60 for flow reasons only.' + + +( !in_array($conf['calendar_datefield'], +array('date_creation','date_available') ) + 'calendar_datefield', + 'Current value: %s. Authorized values are ' . + '\'date_creation\' or \'date_available\', otherwise you can get ' . + 'unpredictable results.' + + // If (iptc & exif) are used and date_creation is updated + // Then it's Ok + // else Using Calendar by date_creation is quite stupid + // Take care! condition has been reversed by first ! (so then is else) + if ( ! ( ($conf['use_iptc'] == true) or ($conf['use_exif'] == true) ) and + ( (isset($conf['use_iptc']['date_creation'])) or + (isset($conf['use_exif']['date_creation'])) ) ) + { +( $conf['calendar_datefield'] == 'date_creation' ) + 'calendar_datefield', + 'Current value: %s. ' . + ' \'date_creation\' is NOT filled by any activated use metadata ' . + 'mapping fields.' , + 'So activate metadata usage or change to $conf[\'calendar_datefield\'] ' . + '= \'date_available\'' , + '1 - Activate metadata usage as you want: ', + '$conf[\'use_iptc\'] = true; or $conf[\'use_exif\'] = true; each way ' . + 'may be correct.' , + '2 - And respectively map:' , + '$conf[\'use_iptc_mapping\'] = array( ..., \'date_creation\' ' . + '=> \'2#055\', ...' , + 'or/and:' , + '$conf[\'use_exif_mapping\'] = array(\'date_creation\' ' . + '=> \'DateTimeOriginal\', ...' , + '3 - Finally, a new task is up to you: Metadata synchronization.' + } + + +( $conf['newcat_default_visible'] == false ) + 'newcat_default_visible', + 'Your current value: false.' . + 'Not useful, private status is better, so code ' . + '$conf[\'newcat_default_visible\'] = true;' + +( $conf['newcat_default_status'] == 'public' ) + 'newcat_default_status', 'Your current value: public.' , + 'Try $conf[\'newcat_default_status\'] = \'private\'; could allow ' . + 'you time to prepare.' + +( $conf['newuser_default_enabled_high'] == true ) + 'newuser_default_enabled_high', + 'Your current value: true.' . + ' Any new subscriber has access to High Resolution pictures is what ' . + 'you want, if NOT try $conf[\'newuser_default_enabled_high\'] = false;' + +( $conf['level_separator'] == ' / ' ) + 'level_separator', + 'Current value: \' / \'.' . + 'Try just a comma like this $conf[\'level_separator\'] = \', \';' + +(($conf['paginate_pages_around'] < 2) or ($conf['paginate_pages_around'] > 12)) + 'paginate_pages_around', + 'Current value: %u.' . + 'Usual range is between 2 and 5, be light as ' . + '$conf[\'paginate_pages_around\'] = 2;' . + ' or dynamic for visitors as $conf[\'paginate_pages_around\'] = 7;' + +( ($conf['tn_width'] < 66) or ($conf['tn_width'] > 180) ) + 'tn_width', + 'Current value: %u.' . + 'Should be a closed value to your thumbnail width.' . + ' Usual range is between 96 and 150, about $conf[\'tn_width\'] = 128;' + +( ($conf['tn_height'] < 66) or ($conf['tn_height'] > 180)) + 'tn_height', + 'Current value: %u.' . + 'Should be a closed value to your thumbnail height.' . + ' Usual range is between 96 and 150, about $conf[\'tn_height\'] = 128;' + +( $conf['tn_height'] == $conf['tn_width'] ) + 'tn_height', + 'Try equal values like this $conf[\'tn_height\'] = $conf[\'tn_width\'];' . + 'or $conf[\'tn_width\'] = $conf[\'tn_height\']; ' . + 'depending on the first set value.' + +( $conf['show_version'] == true ) + 'show_version', + 'Current value: true.' . + 'For security reason, please set $conf[\'show_version\'] = false;' + +( $conf['show_thumbnail_caption'] == true ) + 'show_thumbnail_caption', + 'Current value: true.' . + 'For a lighter gallery just have a look to ' . + '$conf[\'show_thumbnail_caption\'] = false;' + +( $conf['show_picture_name_on_title'] == true ) + 'show_picture_name_on_title', + 'Current value: true.' . + 'For a lighter gallery just have a look to ' . + '$conf[\'show_picture_name_on_title\'] = false;' + +( $conf['subcatify'] == true ) + 'subcatify', + 'Current value: true.' . + 'If you do NOT have any category descriptions just have a look to' . + ' $conf[\'subcatify\'] = false;' + +( $conf['allow_random_representative'] == true ) + 'allow_random_representative', + 'Current value: true.' . + 'Leave $conf[\'allow_random_representative\'] = true; but study ' . + 'if you can avoid' + +( $conf['prefix_thumbnail'] !== 'TN-' ) + 'prefix_thumbnail', + 'Current value: \'%s\'.' . + 'Be careful your $conf[\'prefix_thumbnail\'] is NOT standard.', + 'Return to default if your thumbnail are NOT visible.' , + 'Default is $conf[\'prefix_thumbnail\'] = \'TN-\';' . + 'Distant site may use a different prefix but create_listing_file.php ' . + 'must be changed.' + +( $conf['users_page'] < 21 ) + 'users_page', + 'Current value: %u.' . + 'Unless your connexion is low, you can draw up $conf[\'users_page\'] ' . + 'to a higher value.' + +( $conf['mail_options'] == true ) + 'mail_options', + 'Current value: true.' . + 'Should be false, only few webmasters have to set ' . + '$conf[\'mail_options\'] = true; On specific advice.' + +( $conf['check_upgrade_feed'] == true ) + 'check_upgrade_feed', + 'Current value: true.' . + 'Should be false, only PWG Team have to set ' . + '$conf[\'check_upgrade_feed\'] = true; for BSF tests purpose.' + +( count( $conf['rate_items'] ) < 4 ) + 'rate_items', + 'Your $conf[\'rate_items\'] would have 4 or 5 items not less.' + +( count( $conf['rate_items'] ) > 6) + 'rate_items', + 'Your $conf[\'rate_items\'] would have 5 or 6 items not more.' + +( $conf['show_itpc'] == true ) + 'show_itpc', + 'Current value: true.' . + ' Could be true, but usualy $conf[\'show_iptc\'] = false; ' . + 'Only set true if you want to show other IPTC fields.', + 'Or if you want different descriptions between PWG ' . + 'database and IPTC fields.', + 'In any case, show_iptc_mapping and use_iptc_mapping must be ' . + 'totally different.' + +( $conf['use_itpc'] == true ) + 'use_itpc', + 'Current value: true.' . + ' Documentalists and professionnal photographers would set it true,' . + ' but beginners should leave as $conf[\'use_iptc\'] = false;' . + ' Take care of mentionned fields in metadata synchronization.' . + ' Mentionned fields would be rewrited with IPTC values even those ones are empty.' + +( true ) + 'use_iptc_mapping', + ' 1 - Copy one of your jpg pictures (a public one) in ./tools/' . + ' 2 - Rename it as sample.jpg.' . + ' 3 - Run ./tools/metadata.php' . + ' 4 - Analyse results to determine which ITPC fields could be used to override database fields.' . + ' Beginners would prefer to keep $conf[\'use_iptc\'] = false;' . + ' Advanced users make documentation efforts prior to upload their pictures.' + +( true ) + 'show_exif', + 'Current value: ' . (( $conf['show_exif']) ? 'true.':'false.') . + ' Should be true, some information from your camera can be displayed.' . + ' Think about EXIF information could be different depending on camera models.' . + ' If you change your camera these fields could be partly different.' ); + +( true ) + 'show_exif_mapping', + ' Process as for iptc mapping.' . + ' Beginners would prefer to let default values.' . + ' Advanced users would take care of $lang values and impacts on templates.' + +( $conf['use_exif'] == true ) + 'use_exif', + 'Current value: true.' . + ' Documentalists and professionnal photographers would set it true,' . + ' but beginners should leave the default value;' . + ' Take care of mentionned fields in metadata synchronization.' . + ' Mentionned fields would be rewrited with EXIF values even those ones are empty.' + +( true ) + 'use_exif_mapping', + ' Process as for iptc mapping.' . + ' Beginners would prefer to let default values again.' . + ' Advanced users would carefully chose overrided fields prior to synchronize.' + + + */ + +?> diff --git a/plugins/admin_advices/main.inc.php b/plugins/admin_advices/main.inc.php new file mode 100644 index 000000000..c6362a72b --- /dev/null +++ b/plugins/admin_advices/main.inc.php @@ -0,0 +1,56 @@ +set_filenames( array( 'advice' => 'admin_advices.tpl' )); + $template->set_filenames(array( + 'admin_advice' => + PHPWG_ROOT_PATH.'/plugins/admin_advices/admin_advices.tpl') + ); + $advice_text = array_shift($adv); + $template->assign_vars( + array( + 'ADVICE_ABOUT' => '$conf[' . "'$confk'] ", + 'ADVICE_TEXT' => $advice_text, + ) + ); + foreach ($adv as $advice) + { + $template->assign_block_vars( + 'More', + array( + 'ADVICE' => $advice + ) + ); + } + $template->parse('admin_advice'); + } + } +} +?> -- cgit v1.2.3