Changeset 10027


Ignore:
Timestamp:
04/03/11 22:52:28 (9 years ago)
Author:
ddtddt
Message:

[extensions] - Piwigodonate

Location:
extensions/Piwigodonate
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Piwigodonate/main.inc.php

    r7755 r10027  
    99*/ 
    1010 
    11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
    12  
    13 global $prefixeTable, $conf; 
     11if (!defined('PHPWG_ROOT_PATH')) 
     12{ 
     13  die('Hacking attempt!'); 
     14} 
    1415 
    1516define('PIDO_DIR' , basename(dirname(__FILE__))); 
    1617define('PIDO_PATH' , PHPWG_PLUGINS_PATH . PIDO_DIR . '/'); 
    1718 
    18 add_event_handler('loc_begin_page_tail', 'Piwigodonate',5); 
    19 add_event_handler('loc_begin_page_tail', 'PiwigodonateC'); 
     19add_event_handler('loc_end_page_tail', 'Piwigodonate'); 
    2020 
    2121function Piwigodonate() 
    22  { 
    23         global $template; 
    24         $template->set_prefilter('tail', 'PiwigodonateT'); 
    25  } 
     22{ 
     23  if (script_basename() != 'admin') 
     24  { 
     25global $template; 
     26load_language('plugin.lang', PIDO_PATH); 
     27  $template->set_filename('donate', realpath(PIDO_PATH.'donate.tpl')); 
     28  $template->append('footer_elements', $template->parse('donate', true)); 
    2629 
    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( 
    4131    'DONATE', PHPWG_URL.'/donate' 
    4232    ); 
    43                  
    44  }  
     33 
     34 
     35        } 
     36} 
    4537 
    4638 
Note: See TracChangeset for help on using the changeset viewer.