Line | |
---|
1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Personal Favicon |
---|
4 | Version: auto |
---|
5 | Description: Replace Piwigo fivicon by the favicon in local directory |
---|
6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=462 |
---|
7 | Author: ddtddt |
---|
8 | Author URI: http://piwigo.org/ |
---|
9 | */ |
---|
10 | |
---|
11 | add_event_handler('loc_begin_page_header', 'Change_Favicon', 55 ); |
---|
12 | |
---|
13 | |
---|
14 | function Change_Favicon() |
---|
15 | { |
---|
16 | global $template; |
---|
17 | $template->set_prefilter('header', 'Favicon'); |
---|
18 | } |
---|
19 | |
---|
20 | function Favicon($content, &$smarty) |
---|
21 | { |
---|
22 | $search = '#<link rel="shortcut icon".*?favicon.ico">#'; |
---|
23 | |
---|
24 | $replacement = '<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}local/favicon.ico">'; |
---|
25 | |
---|
26 | return preg_replace($search, $replacement, $content); |
---|
27 | } |
---|
28 | |
---|
29 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.