'birthdate')) . '/'); define('BIRTHDATE_DIR', PWG_LOCAL_DIR . 'birthdate/'); define('BIRTHDATE_VERSION', 'auto'); // +-----------------------------------------------------------------------+ // | Add event handlers | // +-----------------------------------------------------------------------+ // init the plugin add_event_handler('init', 'birthdate_init'); if (defined('IN_ADMIN')) { // admin plugins menu link add_event_handler('get_admin_plugin_menu_links', 'birthdate_admin_plugin_menu_links'); // file containing all previous handlers functions include_once(BIRTHDATE_PATH . 'include/admin_events.inc.php'); } else { // add age on tags add_event_handler('loc_end_picture', 'birthdate_loc_end_picture'); // file containing all previous handlers functions include_once(BIRTHDATE_PATH . 'include/public_events.inc.php'); } // files containing specific plugin functions include_once(BIRTHDATE_PATH . 'include/functions.inc.php'); /** * plugin initialization * - check for upgrades * - unserialize configuration * - load language */ function birthdate_init() { global $conf, $pwg_loaded_plugins; // apply upgrade if needed if ( BIRTHDATE_VERSION == 'auto' or $pwg_loaded_plugins[BIRTHDATE_ID]['version'] == 'auto' or version_compare($pwg_loaded_plugins[BIRTHDATE_ID]['version'], BIRTHDATE_VERSION, '<') ) { // call install function include_once(BIRTHDATE_PATH . 'include/install.inc.php'); birthdate_install(); // update plugin version in database if ( $pwg_loaded_plugins[BIRTHDATE_ID]['version'] != 'auto' and BIRTHDATE_VERSION != 'auto' ) { $query = ' UPDATE '. PLUGINS_TABLE .' SET version = "'. BIRTHDATE_VERSION .'" WHERE id = "'. BIRTHDATE_ID .'"'; pwg_query($query); $pwg_loaded_plugins[BIRTHDATE_ID]['version'] = BIRTHDATE_VERSION; if (defined('IN_ADMIN')) { $_SESSION['page_infos'][] = 'Birthdate updated to version '. BIRTHDATE_VERSION; } } } // load plugin language file load_language('plugin.lang', BIRTHDATE_PATH); } ?>