🌍
English
This shows you the differences between two versions of the page.
dev:compilation_of_personal_plugins [2012/06/27 11:46] mistic100 created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Compilation of personal plugins ====== | ||
- | Here is a list of very simple plugins you can use with [[http://piwigo.org/ext/extension_view.php?eid=144|LocalFilesEditor]]. | ||
- | |||
- | ==== Add a top navigation bar ==== | ||
- | On thumbnails list, if you have severals items, you may want to display the navigation bar on the top in addition to the bottom one. | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | /* | ||
- | Plugin Name: Navbar on top | ||
- | Version: 1.0 | ||
- | Author: Mistic | ||
- | Author URI: http://www.strangeplanet.fr | ||
- | */ | ||
- | |||
- | add_event_handler('loc_end_index', 'top_navbar'); | ||
- | |||
- | function top_navbar() | ||
- | { | ||
- | global $template; | ||
- | $template->set_prefilter('index', 'top_navbar_prefilter'); | ||
- | } | ||
- | |||
- | function top_navbar_prefilter($content, &$smarty) | ||
- | { | ||
- | $search = '{if !empty($CATEGORIES)}{$CATEGORIES}{/if}'; | ||
- | $add = '{if !empty($navbar)}{include file=\'navigation_bar.tpl\'|@get_extent:\'navbar\'}{/if}'; | ||
- | return str_replace($search, $add.$search, $content); | ||
- | } | ||
- | |||
- | ?> | ||
- | </code> | ||
- | |||
- | More to come... |