source: extensions/PersoFavicon/main.inc.php @ 7701

Last change on this file since 7701 was 7701, checked in by ddtddt, 13 years ago

[extensions] -PersoFavicon - news plugin release 1

File size: 671 bytes
Line 
1<?php
2/*
3Plugin Name: Personal Favicon
4Version: auto
5Description: Replace Piwigo fivicon by the favicon in local directory
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=462
7Author: ddtddt
8Author URI: http://piwigo.org/
9*/
10
11add_event_handler('loc_begin_page_header', 'Change_Favicon', 55 );
12
13
14function Change_Favicon()
15 {
16        global $template;
17        $template->set_prefilter('header', 'Favicon');
18 }
19
20function 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.