source: extensions/hide_title_on_browse_path/main.inc.php @ 15620

Revision 12644, 718 bytes checked in by plg, 8 years ago (diff)

new plugin (very simple, very specific)

Line 
1<?php
2/*
3Plugin Name: Hide Title on Browse Path
4Version: auto
5Description: Hide the photo title on Browse Path
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=589
7Author: plg
8Author URI: http://piwigo.wordpress.com
9*/
10
11if (!defined('PHPWG_ROOT_PATH'))
12{
13  die('Hacking attempt!');
14}
15
16add_event_handler('loc_end_picture', 'hide_title_on_browse_path');
17function hide_title_on_browse_path()
18{
19  global $template;
20     
21  $template->set_prefilter('picture', 'hide_title_on_browse_path_prefilter');
22}
23
24function hide_title_on_browse_path_prefilter($content, &$smarty)
25{
26  $pattern = '#\{\$LEVEL_SEPARATOR\}\{\$current.TITLE\}#ms';
27  $replacement = '';
28  return preg_replace($pattern, $replacement, $content);
29}
30?>
Note: See TracBrowser for help on using the repository browser.