Last change
on this file since 15874 was
12644,
checked in by plg, 13 years ago
|
new plugin (very simple, very specific)
|
File size:
718 bytes
|
Rev | Line | |
---|
[12644] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Hide Title on Browse Path |
---|
| 4 | Version: auto |
---|
| 5 | Description: Hide the photo title on Browse Path |
---|
| 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=589 |
---|
| 7 | Author: plg |
---|
| 8 | Author URI: http://piwigo.wordpress.com |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) |
---|
| 12 | { |
---|
| 13 | die('Hacking attempt!'); |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | add_event_handler('loc_end_picture', 'hide_title_on_browse_path'); |
---|
| 17 | function hide_title_on_browse_path() |
---|
| 18 | { |
---|
| 19 | global $template; |
---|
| 20 | |
---|
| 21 | $template->set_prefilter('picture', 'hide_title_on_browse_path_prefilter'); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | function 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.