Changeset 28850


Ignore:
Timestamp:
06/29/14 16:26:30 (5 years ago)
Author:
mistic100
Message:

use new maintain class

Location:
extensions/SocialButtons
Files:
1 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/SocialButtons/admin.php

    r26100 r28850  
    4848    ); 
    4949   
    50   conf_update_param('SocialButtons', serialize($conf['SocialButtons'])); 
     50  conf_update_param('SocialButtons', $conf['SocialButtons']); 
    5151  $page['infos'][] = l10n('Information data registered in database'); 
    5252   
     
    6464$template->set_filename('socialbutt_content', realpath(SOCIALBUTT_PATH . 'template/admin.tpl')); 
    6565$template->assign_var_from_handle('ADMIN_CONTENT', 'socialbutt_content'); 
    66  
    67 ?> 
  • extensions/SocialButtons/main.inc.php

    r26100 r28850  
    1111defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    1212 
    13 // +-----------------------------------------------------------------------+ 
    14 // | Define plugin constants                                               | 
    15 // +-----------------------------------------------------------------------+ 
    16 define('SOCIALBUTT_ID',      basename(dirname(__FILE__))); 
    17 define('SOCIALBUTT_PATH' ,   PHPWG_PLUGINS_PATH . SOCIALBUTT_ID . '/'); 
    18 define('SOCIALBUTT_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . SOCIALBUTT_ID); 
    19 define('SOCIALBUTT_VERSION', 'auto'); 
     13global $conf; 
     14 
     15define('SOCIALBUTT_ID',    basename(dirname(__FILE__))); 
     16define('SOCIALBUTT_PATH' , PHPWG_PLUGINS_PATH . SOCIALBUTT_ID . '/'); 
     17define('SOCIALBUTT_ADMIN', get_root_url() . 'admin.php?page=plugin-' . SOCIALBUTT_ID); 
    2018 
    2119 
    22 // +-----------------------------------------------------------------------+ 
    23 // | Add event handlers                                                    | 
    24 // +-----------------------------------------------------------------------+ 
    25 // init the plugin 
    26 add_event_handler('init', 'socialbutt_init'); 
     20$conf['SocialButtons'] = safe_unserialize($conf['SocialButtons']); 
     21 
    2722 
    2823if (defined('IN_ADMIN')) 
     
    4338  add_event_handler('loc_end_picture', 'socialbutt_add_button'); 
    4439  add_event_handler('loc_end_index', 'socialbutt_add_button'); 
    45 } 
    46  
    47  
    48 /** 
    49  * plugin initialization 
    50  */ 
    51 function socialbutt_init() 
    52 { 
    53   global $conf, $pwg_loaded_plugins; 
    54  
    55   include_once(SOCIALBUTT_PATH . 'maintain.inc.php'); 
    56   $maintain = new SocialButtons_maintain(SOCIALBUTT_ID); 
    57   $maintain->autoUpdate(SOCIALBUTT_VERSION, 'install'); 
    58  
    59   $conf['SocialButtons'] = unserialize($conf['SocialButtons']); 
    6040} 
    6141 
     
    186166  return str_replace($search, $search.$add, $content); 
    187167} 
    188  
    189 ?> 
Note: See TracChangeset for help on using the changeset viewer.