This is an old revision of the document!


Compilation of personal plugins

Here is a list of very simple plugins you can use with 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.

<?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);
}
 
?>

More to come…

 
Back to top
dev/compilation_of_personal_plugins.1340797594.txt.gz · Last modified: 2012/06/27 11:46 by mistic100
 
 
github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact