Changeset 9784
- Timestamp:
- Mar 20, 2011, 12:58:38 PM (13 years ago)
- Location:
- extensions/Front2Back
- Files:
-
- 5 added
- 4 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/Front2Back/Front2Back.php
r9782 r9784 5 5 { 6 6 global $template, $conf; 7 8 /* Default values */ 9 if (!isset($conf['Front2Back_dir'])) $conf['Front2Back_dir'] = 'verso/'; 10 if (!isset($conf['Front2Back_parent'])) $conf['Front2Back_parent'] = 'thumbnail/'; 11 if (!isset($conf['Front2Back_hd_parent'])) $conf['Front2Back_hd_parent'] = 'pwg_high/'; 12 if (!isset($conf['Front2Back_path'])) 13 $conf['Front2Back_inside']= true; 14 else 15 $conf['Front2Back_inside']= false; 7 $conf['Front2Back'] = explode(',', $conf['Front2Back']); 8 load_language('plugin.lang', F2B_PATH); 16 9 17 10 /* dirs and files */ 18 if ( $conf['Front2Back_inside']) {19 $verso_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back _parent'] . $conf['Front2Back_dir'];20 $hd_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back _hd_parent'] . $conf['Front2Back_dir'];11 if (empty($conf['Front2Back'][0])) { 12 $verso_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back'][1]; 13 $hd_dir = str_replace($image['file'], null, $image['path']) . $conf['Front2Back'][2]; 21 14 } else { 22 $verso_dir = $conf['Front2Back_path'] . $conf['Front2Back_parent'] . $conf['Front2Back_dir'];23 $hd_dir = $conf['Front2Back_path'] . $conf['Front2Back_hd_parent'] . $conf['Front2Back_dir'];15 $verso_dir = PHPWG_ROOT_PATH . $conf['Front2Back'][0] . $conf['Front2Back'][1]; 16 $hd_dir = PHPWG_ROOT_PATH . $conf['Front2Back'][0] . $conf['Front2Back'][2]; 24 17 } 25 $rotat_file = substr($image['file'],0,-4).'-r'.substr($image['file'],-4); 18 $verso_file = get_filename_wo_extension($image['file']) . $conf['Front2Back'][3] . '.' . get_extension($image['file']); 19 $rotat_file = get_filename_wo_extension($image['file']) . '-r.' . get_extension($image['file']); 26 20 27 $template->set_filenames(array('Front2Back' => dirname(__FILE__) . '/ Front2Back.tpl') );21 $template->set_filenames(array('Front2Back' => dirname(__FILE__) . '/template/Front2Back.tpl') ); 28 22 $template->assign('F2B_PATH', F2B_PATH); 29 23 30 24 /* Is there a verso file ? */ 31 if (is_file($verso_dir.$ image['file']))25 if (is_file($verso_dir.$verso_file)) 32 26 { 33 $template->assign('VERSO_URL', $verso_dir.$ image['file']);27 $template->assign('VERSO_URL', $verso_dir.$verso_file); 34 28 35 if (is_file($hd_dir.$ image['file'])) {36 $template->assign('VERSO_HD', $hd_dir.$ image['file']);29 if (is_file($hd_dir.$verso_file)) { 30 $template->assign('VERSO_HD', $hd_dir.$verso_file); 37 31 } 38 32 } -
extensions/Front2Back/language/en_UK/plugin.lang.php
r9782 r9784 4 4 $lang['Front2Back_front'] = 'See front'; 5 5 6 $lang['f2b_path'] = "Back sides' folder"; 7 $lang['f2b_parent'] = "Web sized pics' sub-folder"; 8 $lang['f2b_hd_parent'] = "HD pics' sub-folder"; 9 $lang['f2b_suffix'] = "Suffix"; 10 11 $lang['f2b_help'] = " 12 <fieldset> 13 <legend>Usage examples</legend> 14 <fieldset> 15 If you put the web sized back side in <i>thumbnail/back/</i> subfolder of your normal image directory and the high-definition back side in the subfolder <i>pwg_high/back/</i>, use the basic configuration:<ul> 16 <li><b>Back sides' folder:</b> <i>empty</i> 17 <li><b>Web sized pics' sub-folder:</b> thumbnail/verso/</li> 18 <li><b>HD pics' sub-folder:</b> pwg_high/verso/</li> 19 </ul> 20 </fieldset> 21 22 <fieldset> 23 If you prefer to put your backs into a different folder, change the value of the first parameter (relative to the root of the site). Keep in mind that in this case the tree of your gallery is not reproduced, and two images with the same name in two different albums will load the same back side. 24 <br>For example you can use this setup to search the web sided backs in <i>[ROOT]/verso/</i> and HD backs in <i>[ROOT]/verso/hd/</i> 25 <ul> 26 <li><b>Back sides' folder:</b> verso/ 27 <li><b>Web sized pics' sub-folder:</b> <i>empty</i></li> 28 <li><b>HD pics' sub-folder:</b> hd/</li> 29 </ul> 30 </fieldset> 31 32 <fieldset> 33 Anyway the back side pic may have the same name as the normal pic, in this case let <b>Suffix</b> empty, or a name with suffix. 34 </fieldset> 35 </fieldset> 36 "; 37 6 38 ?> -
extensions/Front2Back/language/fr_FR/plugin.lang.php
r9782 r9784 4 4 $lang['Front2Back_front'] = 'Voir le devant'; 5 5 6 $lang['f2b_path'] = "Dossier des versos"; 7 $lang['f2b_parent'] = "Sous-dossier des images web"; 8 $lang['f2b_hd_parent'] = "Sous-dossier des images HD"; 9 $lang['f2b_suffix'] = "Suffixe de détection"; 10 11 $lang['f2b_help'] = " 12 <fieldset> 13 <legend>Exemples d'utilisation</legend> 14 <fieldset> 15 Si vous placez le verso taille web dans le sous-dossier <i>thumbnail/verso/</i> du dossier de votre image normale et le verso haute-définition dans le sous-dossier <i>pwg_high/verso/</i>, utilisez la configuration de base : 16 <ul> 17 <li><b>Dossier des versos :</b> <i>vide</i> 18 <li><b>Sous-dossier des images web :</b> thumbnail/verso/</li> 19 <li><b>Sous-dossier des images HD :</b> pwg_high/verso/</li> 20 </ul> 21 </fieldset> 22 23 <fieldset> 24 Si vous préferez placer vos versos dans un tout autre dossier changez la valeur du premier paramètre (relatif à la racine du site). Gardez à l'esprit que dans ce cas l'arborescence de votre galerie n'est pas reproduite, et deux images qui ont le même nom dans deux albums différents chargeront le même verso. 25 <br>Par exemple vous pouvez utiliser cette configuration pour chercher les versos web dans <i>[RACINE]/verso/</i> et les versos HD dans <i>[RACINE]/verso/hd/</i> 26 <ul> 27 <li><b>Dossier des versos :</b> verso/ 28 <li><b>Sous-dossier des images web :</b> <i>vide</i></li> 29 <li><b>Sous-dossier des images HD :</b> hd/</li> 30 </ul> 31 </fieldset> 32 33 <fieldset> 34 Dans tous les cas les versos peuvent avoir le même nom que les images normale, dans ce cas laisser <b>Suffixe de détection</b> vide, ou un nom avec suffixe. 35 </fieldset> 36 </fieldset> 37 "; 38 6 39 ?> -
extensions/Front2Back/main.inc.php
r9782 r9784 2 2 /* 3 3 Plugin Name: Front2Back 4 Version: 2.2. 04 Version: 2.2.a 5 5 Description: Add a link on picture's page to show a alternative version of the pic (for postcards for example) 6 6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=183 … … 13 13 define('F2B_PATH', PHPWG_PLUGINS_PATH . F2B_DIR . '/'); 14 14 15 load_language('plugin.lang', F2B_PATH);16 15 include_once(F2B_PATH . 'Front2Back.php'); 17 16 add_event_handler('render_element_content', 'Front2Back_content', 99, 2); 18 17 18 if (script_basename() == 'admin') 19 { 20 add_event_handler('get_admin_plugin_menu_links', 'Front2Back_admin_menu'); 21 function Front2Back_admin_menu($menu) 22 { 23 array_push($menu, array( 24 'NAME' => 'Front2Back', 25 'URL' => get_root_url().'admin.php?page=plugin-' . F2B_DIR)); 26 return $menu; 27 } 28 } 29 19 30 ?> -
extensions/Front2Back/template/Front2Back.tpl
r9782 r9784 1 1 {combine_script id="jquery"} 2 {combine_css path=$F2B_PATH|@cat:" Front2Back.css"}2 {combine_css path=$F2B_PATH|@cat:"template/Front2Back.css"} 3 3 4 4 {footer_script require="jquery"} … … 19 19 20 20 /* f2b link content */ 21 jQuery(this).html('<img src="{$F2B_PATH} rotate_2.png"/> {'Front2Back_front'|@translate}');21 jQuery(this).html('<img src="{$F2B_PATH}template/rotate_2.png"/> {'Front2Back_front'|@translate}'); 22 22 jQuery(this).attr('name', 'back'); 23 23 … … 34 34 {/if} 35 35 36 jQuery(this).html('<img src="{$F2B_PATH} rotate_1.png"/> {'Front2Back_back'|@translate}');36 jQuery(this).html('<img src="{$F2B_PATH}template/rotate_1.png"/> {'Front2Back_back'|@translate}'); 37 37 jQuery(this).attr('name', 'front'); 38 38 } … … 41 41 42 42 <a class="reverse" name="front"> 43 <img src="{$F2B_PATH} rotate_1.png"/>43 <img src="{$F2B_PATH}template/rotate_1.png"/> 44 44 {'Front2Back_back'|@translate} 45 45 </a>
Note: See TracChangeset
for help on using the changeset viewer.