Last change
on this file since 7755 was
7755,
checked in by ddtddt, 13 years ago
|
[extensions] - Piwigo Donate - open other windows / compatible with sobre
|
-
Property svn:eol-style set to
LF
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.1 KB
|
Rev | Line | |
---|
[7750] | 1 | <?php |
---|
| 2 | /* |
---|
[7751] | 3 | Plugin Name: Piwigo Donate |
---|
[7750] | 4 | Version: auto |
---|
[7751] | 5 | Description: You like Piwigo you want to support us financially you can add a link to donate on your site in the footer |
---|
| 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=463 |
---|
[7750] | 7 | Author: ddtddt |
---|
| 8 | Author URI: http://piwigo.org/ |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
| 13 | global $prefixeTable, $conf; |
---|
| 14 | |
---|
| 15 | define('PIDO_DIR' , basename(dirname(__FILE__))); |
---|
| 16 | define('PIDO_PATH' , PHPWG_PLUGINS_PATH . PIDO_DIR . '/'); |
---|
| 17 | |
---|
| 18 | add_event_handler('loc_begin_page_tail', 'Piwigodonate',5); |
---|
| 19 | add_event_handler('loc_begin_page_tail', 'PiwigodonateC'); |
---|
| 20 | |
---|
| 21 | function Piwigodonate() |
---|
| 22 | { |
---|
| 23 | global $template; |
---|
| 24 | $template->set_prefilter('tail', 'PiwigodonateT'); |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | function PiwigodonateT($content, &$smarty) |
---|
| 28 | { |
---|
[7755] | 29 | $search = '#<span class="Piwigo">.*?</span></a>#'; |
---|
[7750] | 30 | |
---|
[7755] | 31 | $replacement = '<span class="Piwigo">Piwigo</span></a> - <a href="{$DONATE}" target="_bank" class="Piwigo">{\'Donate_to_Piwigo\'|@translate}</a>'; |
---|
[7750] | 32 | |
---|
| 33 | return preg_replace($search, $replacement, $content); |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | function PiwigodonateC() |
---|
| 37 | { |
---|
| 38 | load_language('plugin.lang', PIDO_PATH); |
---|
| 39 | global $template; |
---|
| 40 | $template->assign( |
---|
| 41 | 'DONATE', PHPWG_URL.'/donate' |
---|
| 42 | ); |
---|
| 43 | |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.