[11216] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Perso Footer |
---|
| 4 | Version: auto |
---|
| 5 | Description: Add information in the footer |
---|
| 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=554 |
---|
| 7 | Author: ddtddt |
---|
| 8 | Author URI: http://piwigo.org/ |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
| 13 | define('PFT_DIR' , basename(dirname(__FILE__))); |
---|
| 14 | define('PFT_PATH' , PHPWG_PLUGINS_PATH . PFT_DIR . '/'); |
---|
| 15 | |
---|
| 16 | add_event_handler('get_admin_plugin_menu_links', 'PFT_admin_menu'); |
---|
| 17 | function PFT_admin_menu($menu) |
---|
| 18 | { |
---|
| 19 | array_push($menu, array( |
---|
| 20 | 'NAME' => 'Perso Footer', |
---|
| 21 | 'URL' => get_admin_plugin_menu_link(PFT_PATH . 'admin/admin.php'))); |
---|
| 22 | return $menu; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | add_event_handler('loc_end_page_tail', 'pft'); |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | function pft() |
---|
| 29 | { |
---|
| 30 | if ((script_basename() != 'admin')) |
---|
| 31 | { |
---|
| 32 | global $template; |
---|
| 33 | |
---|
| 34 | $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); |
---|
| 35 | if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc'); |
---|
| 36 | |
---|
| 37 | $query = ' |
---|
| 38 | select param,value |
---|
| 39 | FROM ' . CONFIG_TABLE . ' |
---|
| 40 | WHERE param = "persoFooter" |
---|
| 41 | ;'; |
---|
| 42 | $result = pwg_query($query); |
---|
| 43 | $row = mysql_fetch_array($result); |
---|
| 44 | $pat=trigger_event('AP_render_content', $row['value']); |
---|
| 45 | if (!empty($pat)) |
---|
| 46 | { |
---|
| 47 | $template->assign('PERSO_FOOTER2', $pat); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | $template->set_filename('PERSO_FOOTER', realpath(PFT_PATH.'persofooter.tpl')); |
---|
| 51 | $template->append('footer_elements', $template->parse('PERSO_FOOTER', true)); |
---|
| 52 | |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | ?> |
---|