Ignore:
Timestamp:
Jun 29, 2014, 4:26:30 PM (10 years ago)
Author:
mistic100
Message:

use new maintain class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.