Esempio n. 1
0
     $wpmu = 1;
 } else {
     if (basename(dirname(__FILE__)) == "si-captcha-for-wordpress" && function_exists('is_site_admin')) {
         // optionally activated
         $wpmu = 2;
     }
 }
 $si_captcha_dir = WP_PLUGIN_DIR . '/si-captcha-for-wordpress/captcha';
 if ($wpmu == 1) {
     if (defined('MUPLUGINDIR')) {
         $si_captcha_dir = MUPLUGINDIR . '/si-captcha-for-wordpress/captcha';
     } else {
         $si_captcha_dir = WP_CONTENT_DIR . '/mu-plugins/si-captcha-for-wordpress/captcha';
     }
 }
 $si_captcha_url = $si_image_captcha->get_captcha_url_si();
 // only used for the no-session captcha setting
 $si_captcha_url_ns = $si_captcha_url . '/temp/';
 $si_captcha_dir_ns = $si_captcha_dir . '/temp/';
 $si_image_captcha->si_captcha_init_temp_dir($si_captcha_dir_ns);
 //Actions
 add_action('init', array(&$si_image_captcha, 'si_captcha_init'));
 // get the options now
 $si_image_captcha->si_captcha_get_options();
 if (isset($si_captcha_opt['si_captcha_disable_session']) && $si_captcha_opt['si_captcha_disable_session'] == 'true') {
     // add javascript (conditionally to footer)
     // http://scribu.net/wordpress/optimal-script-loading.html
     add_action('wp_footer', array(&$si_image_captcha, 'si_captcha_add_script'));
 } else {
     // start the PHP session
     // buddypress had session error on member and groups pages, so start session here instead of init