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

Last change on this file since 16962 was 16623, checked in by plg, 12 years ago

compatibility with Piwigo 2.4

File size: 768 bytes
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 = '#<span class="browsePathSeparator">\{\$LEVEL_SEPARATOR\}</span><h2>\{\$current.TITLE\}</h2>#ms';
27  $replacement = '';
28  return preg_replace($pattern, $replacement, $content);
29}
30?>
Note: See TracBrowser for help on using the repository browser.