Ignore:
Timestamp:
May 14, 2012, 6:42:14 PM (12 years ago)
Author:
ddtddt
Message:

[extensions] - PersoFooter - clean code

File:
1 edited

Legend:

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

    r11216 r14972  
    2323}
    2424
    25   add_event_handler('loc_end_page_tail', 'pft');
    26 
    27 
     25add_event_handler('loc_end_page_tail', 'pft');
    2826function pft()
    2927 {
    3028   if ((script_basename() != 'admin'))
    3129  {
    32         global $template;
    33        
    34         $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
     30        global $template, $conf;
     31$PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
    3532if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
    3633
    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']);
     34$pat=trigger_event('AP_render_content', $conf['persoFooter']);
    4535                 if (!empty($pat))
    4636                        {
     
    5040        $template->set_filename('PERSO_FOOTER', realpath(PFT_PATH.'persofooter.tpl')); 
    5141        $template->append('footer_elements', $template->parse('PERSO_FOOTER', true));
    52                        
    5342        }
    5443 }
Note: See TracChangeset for help on using the changeset viewer.