'user_info_tracking')) . '/'); define('USER_INFO_TRACKING_DIR', PWG_LOCAL_DIR . 'user_info_tracking/'); define('USER_INFO_TRACKING_VERSION', '1.0.0'); // this is automatically updated by PEM if you publish your plugin with SVN, otherwise you musn't forget to change it, as well as "Version" in the plugin header // +-----------------------------------------------------------------------+ // | Add event handlers | // +-----------------------------------------------------------------------+ // init the plugin add_event_handler('init', 'user_info_tracking_init'); if (defined('IN_ADMIN')) { // admin plugins menu link add_event_handler('get_admin_plugin_menu_links', 'user_info_tracking_admin_plugin_menu_links'); // new tab on photo page // add_event_handler('tabsheet_before_select', 'user_info_tracking_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); // file containing all previous handlers functions include_once(USER_INFO_TRACKING_PATH . 'include/admin_events.inc.php'); } else { // file containing all previous handlers functions Look at the skeleton plugin for an example // include_once(USER_INFO_TRACKING_PATH . 'include/public_events.inc.php'); } // Successful Login - Logs Data into the Table // --------------------------- add_event_handler('login_success', 'ui_successfulLogin'); // Failed Login - Logs Data into the Table // --------------------------- add_event_handler('login_failure', 'ui_failedLogin'); // Logout - Logs Data into the Table // --------------------------- add_event_handler('logout', 'ui_logout'); // add API function add_event_handler('ws_add_methods', 'skeleton_ws_add_methods'); // files containing specific plugin functions include_once(USER_INFO_TRACKING_PATH . 'include/functions.inc.php'); /** * plugin initialization * - check for upgrades * - unserialize configuration * - load language */ function user_info_tracking_init() { global $conf, $pwg_loaded_plugins; // apply upgrade if needed if ( USER_INFO_TRACKING_VERSION == 'auto' or $pwg_loaded_plugins[USER_INFO_TRACKING_ID]['version'] == 'auto' or version_compare($pwg_loaded_plugins[USER_INFO_TRACKING_ID]['version'], USER_INFO_TRACKING_VERSION, '<') ) { // call install function include_once(USER_INFO_TRACKING_PATH . 'include/install.inc.php'); user_info_tracking_install(); // update plugin version in database if ( $pwg_loaded_plugins[USER_INFO_TRACKING_ID]['version'] != 'auto' and USER_INFO_TRACKING_VERSION != 'auto' ) { $query = ' UPDATE '. PLUGINS_TABLE .' SET version = "'. USER_INFO_TRACKING_VERSION .'" WHERE id = "'. USER_INFO_TRACKING_ID .'"'; pwg_query($query); $pwg_loaded_plugins[USER_INFO_TRACKING_ID]['version'] = USER_INFO_TRACKING_VERSION; if (defined('IN_ADMIN')) { $_SESSION['page_infos'][] = 'User Info Tracking updated to version '. USER_INFO_TRACKING_VERSION; } } } // load plugin language file load_language('plugin.lang', USER_INFO_TRACKING_PATH); // prepare plugin configuration // $conf['user_info_tracking'] = unserialize($conf['user_info_tracking']); } ?>