Changeset 10027 for extensions/Piwigodonate
- Timestamp:
- Apr 3, 2011, 10:52:28 PM (14 years ago)
- Location:
- extensions/Piwigodonate
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Piwigodonate/main.inc.php
r7755 r10027 9 9 */ 10 10 11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 12 13 global $prefixeTable, $conf; 11 if (!defined('PHPWG_ROOT_PATH')) 12 { 13 die('Hacking attempt!'); 14 } 14 15 15 16 define('PIDO_DIR' , basename(dirname(__FILE__))); 16 17 define('PIDO_PATH' , PHPWG_PLUGINS_PATH . PIDO_DIR . '/'); 17 18 18 add_event_handler('loc_begin_page_tail', 'Piwigodonate',5); 19 add_event_handler('loc_begin_page_tail', 'PiwigodonateC'); 19 add_event_handler('loc_end_page_tail', 'Piwigodonate'); 20 20 21 21 function Piwigodonate() 22 { 23 global $template; 24 $template->set_prefilter('tail', 'PiwigodonateT'); 25 } 22 { 23 if (script_basename() != 'admin') 24 { 25 global $template; 26 load_language('plugin.lang', PIDO_PATH); 27 $template->set_filename('donate', realpath(PIDO_PATH.'donate.tpl')); 28 $template->append('footer_elements', $template->parse('donate', true)); 26 29 27 function 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 36 function PiwigodonateC() 37 { 38 load_language('plugin.lang', PIDO_PATH); 39 global $template; 40 $template->assign( 30 $template->assign( 41 31 'DONATE', PHPWG_URL.'/donate' 42 32 ); 43 44 } 33 34 35 } 36 } 45 37 46 38
Note: See TracChangeset
for help on using the changeset viewer.