Changeset 24234 for extensions/EasyCaptcha/main.inc.php
- Timestamp:
- Aug 25, 2013, 12:36:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/EasyCaptcha/main.inc.php
r24233 r24234 31 31 else 32 32 { 33 add_event_handler('init', 'easycaptcha_document_init'); 34 add_event_handler('loc_end_section_init', 'easycaptcha_section_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30); 33 add_event_handler('loc_end_section_init', 'easycaptcha_document_init', EVENT_HANDLER_PRIORITY_NEUTRAL+30); 35 34 } 36 35 … … 67 66 68 67 69 // modules : picture comment & register68 // modules 70 69 function easycaptcha_document_init() 71 70 { 72 global $conf, $ user;71 global $conf, $pwg_loaded_plugins, $page; 73 72 74 73 if (!is_a_guest()) return; … … 84 83 include(EASYCAPTCHA_PATH . 'include/picture.inc.php'); 85 84 } 86 87 } 88 89 // modules : album comment & contact & guestbook 90 function easycaptcha_section_init() 91 { 92 global $conf, $pwg_loaded_plugins, $page; 93 94 if (!is_a_guest() || !isset($page['section'])) return; 95 96 if ( 97 script_basename() == 'index' && 98 $page['section'] == 'categories' && isset($page['category']) && 99 isset($pwg_loaded_plugins['Comments_on_Albums']) && 100 $conf['EasyCaptcha']['activate_on']['category'] 101 ) 85 else if (isset($page['section'])) 102 86 { 103 $conf['EasyCaptcha']['template'] = 'comment'; 104 include(EASYCAPTCHA_PATH . 'include/category.inc.php'); 105 } 106 else if ( $page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform'] ) 107 { 108 $conf['EasyCaptcha']['template'] = 'contactform'; 109 include(EASYCAPTCHA_PATH . 'include/contactform.inc.php'); 110 } 111 else if ( $page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook'] ) 112 { 113 $conf['EasyCaptcha']['template'] = 'guestbook'; 114 include(EASYCAPTCHA_PATH . 'include/guestbook.inc.php'); 87 if ( 88 script_basename() == 'index' && 89 $page['section'] == 'categories' && isset($page['category']) && 90 isset($pwg_loaded_plugins['Comments_on_Albums']) && 91 $conf['EasyCaptcha']['activate_on']['category'] 92 ) 93 { 94 $conf['EasyCaptcha']['template'] = 'comment'; 95 include(EASYCAPTCHA_PATH . 'include/category.inc.php'); 96 } 97 else if ( $page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform'] ) 98 { 99 $conf['EasyCaptcha']['template'] = 'contactform'; 100 include(EASYCAPTCHA_PATH . 'include/contactform.inc.php'); 101 } 102 else if ( $page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook'] ) 103 { 104 $conf['EasyCaptcha']['template'] = 'guestbook'; 105 include(EASYCAPTCHA_PATH . 'include/guestbook.inc.php'); 106 } 115 107 } 116 108 }
Note: See TracChangeset
for help on using the changeset viewer.