Changeset 17922 for extensions/Subscribe_to_comments/main.inc.php
- Timestamp:
- Sep 15, 2012, 11:14:27 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Subscribe_to_comments/main.inc.php
r16106 r17922 13 13 global $prefixeTable; 14 14 15 define('SUBSCRIBE_TO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');15 define('SUBSCRIBE_TO_PATH' , PHPWG_PLUGINS_PATH . 'Subscribe_to_comments/'); 16 16 define('SUBSCRIBE_TO_TABLE', $prefixeTable . 'subscribe_to_comments'); 17 define('SUBSCRIBE_TO_VERSION', '2.0.3'); 18 17 19 18 20 add_event_handler('init', 'stc_init'); 19 21 22 20 23 function stc_init() 21 24 { 22 global $conf, $user ;25 global $conf, $user, $pwg_loaded_plugins; 23 26 24 27 // no comments on luciano 25 28 if ($user['theme'] == 'luciano') return; 26 29 30 // apply upgrade if needed 31 if ( 32 $pwg_loaded_plugins['Subscribe_to_comments']['version'] == 'auto' or 33 version_compare($pwg_loaded_plugins['Subscribe_to_comments']['version'], SUBSCRIBE_TO_VERSION, '<') 34 ) 35 { 36 include_once(SUBSCRIBE_TO_PATH . 'include/install.inc.php'); 37 stc_install(); 38 39 if ($pwg_loaded_plugins['Subscribe_to_comments']['version'] != 'auto') 40 { 41 $query = ' 42 UPDATE '. PLUGINS_TABLE .' 43 SET version = "'. SUBSCRIBE_TO_VERSION .'" 44 WHERE id = "Subscribe_to_comments"'; 45 pwg_query($query); 46 47 $pwg_loaded_plugins['Subscribe_to_comments']['version'] = SUBSCRIBE_TO_VERSION; 48 49 if (defined('IN_ADMIN')) 50 { 51 $_SESSION['page_infos'][] = 'Subscribe to comments updated to version '. SUBSCRIBE_TO_VERSION; 52 } 53 } 54 } 55 56 // load language and conf 27 57 load_language('plugin.lang', SUBSCRIBE_TO_PATH); 28 58 $conf['Subscribe_to_Comments'] = unserialize($conf['Subscribe_to_Comments']); 59 29 60 30 61 include_once(SUBSCRIBE_TO_PATH.'include/functions.inc.php'); 31 62 include_once(SUBSCRIBE_TO_PATH.'include/subscribe_to_comments.inc.php'); 32 63 64 33 65 // send mails 34 66 add_event_handler('user_comment_insertion', 'stc_comment_insertion'); … … 54 86 } 55 87 88 56 89 function stc_admin_menu($menu) 57 90 { … … 62 95 return $menu; 63 96 } 97 64 98 ?>
Note: See TracChangeset
for help on using the changeset viewer.