source: extensions/Piwigodonate/main.inc.php @ 7755

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
Line 
1<?php
2/*
3Plugin Name: Piwigo Donate
4Version: auto
5Description: You like Piwigo you want to support us financially you can add a link to donate on your site in the footer
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=463
7Author: ddtddt
8Author URI: http://piwigo.org/
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13global $prefixeTable, $conf;
14
15define('PIDO_DIR' , basename(dirname(__FILE__)));
16define('PIDO_PATH' , PHPWG_PLUGINS_PATH . PIDO_DIR . '/');
17
18add_event_handler('loc_begin_page_tail', 'Piwigodonate',5);
19add_event_handler('loc_begin_page_tail', 'PiwigodonateC');
20
21function Piwigodonate()
22 {
23        global $template;
24        $template->set_prefilter('tail', 'PiwigodonateT');
25 }
26
27function PiwigodonateT($content, &$smarty)
28 {
29  $search = '#<span class="Piwigo">.*?</span></a>#';
30 
31  $replacement = '<span class="Piwigo">Piwigo</span></a> - <a href="{$DONATE}" target="_bank" class="Piwigo">{\'Donate_to_Piwigo\'|@translate}</a>';
32
33  return preg_replace($search, $replacement, $content);
34 }
35
36function 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.