WordPress.org

Plugin Directory

Changeset 584921


Ignore:
Timestamp:
08/13/12 16:50:31 (5 years ago)
Author:
xeagle
Message:

added vbsso 1.2.2

Location:
vbsso
Files:
16 added
5 edited

Legend:

Unmodified
Added
Removed
  • vbsso/trunk/includes/api.1.0.php

    r444966 r584921  
    144144 
    145145        if ($update) { 
    146             $user_id = wp_insert_user(get_object_vars($u)); 
     146            $user_id = wp_insert_user(get_object_vars($u->data)); 
    147147 
    148148            if (!is_wp_error($user_id)) { 
  • vbsso/trunk/includes/sharedapi.php

    r440959 r584921  
    77 
    88if (!defined('SHAREDAPI')) { 
     9    define ('SHAREDAPI_PRODUCT_VERSION_1_2', '1.2'); 
    910    define ('SHAREDAPI_PRODUCT_VERSION_1_1', '1.1'); 
    1011    define ('SHAREDAPI_PRODUCT_VERSION_1_0', '1.0'); 
    1112 
    12     define ('SHAREDAPI', SHAREDAPI_PRODUCT_VERSION_1_1); 
     13    define ('SHAREDAPI', SHAREDAPI_PRODUCT_VERSION_1_2); 
    1314 
    1415    define ('SHAREDAPI_PRODUCT_ID', 'sharedapi'); 
     
    100101    define ('SHAREDAPI_PLATFORM_DRUPAL', 6); 
    101102 
    102     function sharedapi_get_platforms() { 
     103    function sharedapi_get_platforms($platform = null) { 
    103104        static $platforms; 
    104105 
     
    115116        } 
    116117 
    117         return $platforms; 
     118        return $platform ? $platforms[$platform] : $platforms; 
    118119    } 
    119120 
     
    227228        } 
    228229 
    229         if (SHAREDAPI_EVENT_UNKNOWN == $event) { 
     230        if (strpos($variable, $event . ':') !== false) { 
     231            $variable = substr($variable, strlen($event . ':')); 
     232        } else /*if (SHAREDAPI_EVENT_UNKNOWN == $event)*/ { 
    230233            if (preg_match('/^\d+:(.*)/', $variable, $matches)) { 
    231234                $variable = $matches[1]; 
    232235            } 
    233         } else if (strpos($variable, $event . ':') !== false) { 
    234             $variable = substr($variable, strlen($event . ':')); 
    235236        } 
    236237 
     
    256257 
    257258    function sharedapi_capture_destination($pid, $event, $api_path) { 
     259        $expire = time() + 60 * 4; // expire in 4 minutes. 
     260 
    258261        $destination = sharedapi_get_destination($pid, $event, 'gr'); 
    259262        if (!empty($destination) && strpos($destination, $api_path) === false) { 
    260             setcookie(SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_DESTINATION), $_SESSION[SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_DESTINATION)] = $event . ':' . $destination, 0, '/'); 
     263            setcookie(SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_DESTINATION), $_SESSION[SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_DESTINATION)] = $event . ':' . $destination, $expire, '/'); 
    261264        } 
    262265 
    263266        $lid = sharedapi_get_lid($pid, $event, 'g'); 
    264267        if (!empty($lid)) { 
    265             setcookie(SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_LID), $_SESSION[SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_LID)] = $event . ':' . $lid, 0, '/'); 
     268            setcookie(SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_LID), $_SESSION[SHAREDAPI_NAME_DEFINITION($pid, SHAREDAPI_EVENT_FIELD_LID)] = $event . ':' . $lid, $expire, '/'); 
    266269        } 
    267270    } 
     
    305308        $ret = $ret && is_array($ret) ? $ret : null; 
    306309        echo sharedapi_build_response($product, $version, 
    307                                       $ret && isset($ret[SHAREDAPI_EVENT_FIELD_DATA]) ? $ret[SHAREDAPI_EVENT_FIELD_DATA] 
    308                                               : null, 
    309                                       $ret && isset($ret[SHAREDAPI_EVENT_FIELD_ERROR]) 
    310                                               ? $ret[SHAREDAPI_EVENT_FIELD_ERROR] : null, 
    311                                       $shared_key); 
     310            $ret && isset($ret[SHAREDAPI_EVENT_FIELD_DATA]) ? $ret[SHAREDAPI_EVENT_FIELD_DATA] 
     311                : null, 
     312            $ret && isset($ret[SHAREDAPI_EVENT_FIELD_ERROR]) 
     313                ? $ret[SHAREDAPI_EVENT_FIELD_ERROR] : null, 
     314            $shared_key); 
    312315        exit; 
    313316    } 
     
    328331 
    329332        return is_array($json) && (isset($json[SHAREDAPI_EVENT_FIELD_EVENT]) || isset($json[SHAREDAPI_EVENT_FIELD_PRODUCT])) 
    330                 ? $json : false; 
     333            ? $json : false; 
    331334    } 
    332335 
     
    337340    function sharedapi_build_response($product, $version, $data = null, $error = null, $key = null) { 
    338341        $response = array(SHAREDAPI_EVENT_FIELD_PRODUCT => $product, 
    339                           SHAREDAPI_EVENT_FIELD_VERSION => $version, 
     342            SHAREDAPI_EVENT_FIELD_VERSION => $version, 
    340343        ); 
    341344 
     
    383386    function sharedapi_http_status_error($status) { 
    384387        $status = intval($status); 
    385         return $status < 200 || $status > 399; 
     388        return $status >= 400; 
    386389    } 
    387390 
     
    483486 
    484487    function sharedapi_get_server_url($uri = true) { 
    485         $url = 'http://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : ''); 
     488        $url = 'http://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] 
     489            : ''); 
    486490 
    487491        if ($uri === true) { 
  • vbsso/trunk/includes/vbsso_shared.php

    r444966 r584921  
    99 
    1010if (!defined('VBSSO_SHARED')) { 
     11    define ('VBSSO_PRODUCT_VERSION_1_4_4', '1.4.4'); 
     12    define ('VBSSO_PRODUCT_VERSION_1_4_3', '1.4.3'); 
     13    define ('VBSSO_PRODUCT_VERSION_1_4_2', '1.4.2'); 
     14    define ('VBSSO_PRODUCT_VERSION_1_4_1', '1.4.1'); 
    1115    define ('VBSSO_PRODUCT_VERSION_1_4', '1.4'); 
    1216    define ('VBSSO_PRODUCT_VERSION_1_3', '1.3'); 
     
    1519    define ('VBSSO_PRODUCT_VERSION_1_0', '1.0'); 
    1620 
    17     define ('VBSSO_SHARED', VBSSO_PRODUCT_VERSION_1_4); 
     21    define ('VBSSO_SHARED', VBSSO_PRODUCT_VERSION_1_4_4); 
    1822 
    1923    define ('VBSSO_PRODUCT_ID', 'vbsso'); 
     
    4953    define ('VBSSO_PLATFORM_FOOTER_LINK_DESCRIPTION_HTML', 'To remove the footer link back to this project, you may purchase a <a href="http://www.vbsso.com/documentation/#remove-footer-link">Branding Free license</a>. Your support is used to maintain this project.'); 
    5054    define ('VBSSO_PLATFORM_FOOTER_LINK_HTML', '<div align="center" style="z-index: 3;color: #777777;clear:both;">Single Sign On provided by <a href="http://www.vbsso.com/">' . VBSSO_PRODUCT_NAME . '</a>' . '</div>'); 
     55 
     56 
     57    define ('VBSSO_PLATFORM_FOOTER_GA_HTML', "<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-25094208-2']); /*_gaq.push(['_trackPageview']);*/ _gaq.push(['_trackEvent', '{platform}', window.location.host, window.location.href]); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>"); 
     58    function VBSSO_PLATFORM_FOOTER_GA_HTML($platform) { 
     59        return str_replace("{platform}", $platform, VBSSO_PLATFORM_FOOTER_GA_HTML); 
     60    } 
    5161 
    5262    define ('VBSSO_PLATFORM_FOOTER_LINK_SHOW_NONE', 0); 
     
    7585 
    7686    define ('VBSSO_NAMED_EVENT_FIELD_TIMEOUT', SHAREDAPI_NAME_DEFINITION(VBSSO_PRODUCT_ID, SHAREDAPI_EVENT_FIELD_TIMEOUT)); 
     87 
     88    define ('VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE', SHAREDAPI_NAME_DEFINITION(VBSSO_PRODUCT_ID, 'vb_author_profile_url')); 
     89    define ('VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE_TITLE', 'Show vBulletin Author Profile'); 
     90 
     91    define ('VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE', SHAREDAPI_NAME_DEFINITION(VBSSO_PRODUCT_ID, 'vb_profile_url')); 
     92    define ('VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE_TITLE', 'Show vBulletin Profile'); 
    7793 
    7894    define ('VBSSO_NAMED_EVENT_FIELD_FETCH_AVATARS', SHAREDAPI_NAME_DEFINITION(VBSSO_PRODUCT_ID, 'fetch_avatars')); 
     
    156172                VBSSO_NAMED_EVENT_FIELD_LOSTPASSWORD_URL => array('field' => SHAREDAPI_EVENT_FIELD_LOSTPASSWORD_URL, 'title' => VBSSO_NAMED_EVENT_FIELD_LOSTPASSWORD_URL_TITLE), 
    157173                VBSSO_NAMED_EVENT_FIELD_AVATAR_URL => array('field' => SHAREDAPI_EVENT_FIELD_AVATAR_URL, 'title' => VBSSO_NAMED_EVENT_FIELD_AVATAR_URL_TITLE), 
     174                VBSSO_NAMED_EVENT_FIELD_PROFILE_URL => array('field' => SHAREDAPI_EVENT_FIELD_PROFILE_URL, 'title' => VBSSO_NAMED_EVENT_FIELD_PROFILE_URL_TITLE), 
    158175            ); 
    159176        } 
  • vbsso/trunk/readme.txt

    r444966 r584921  
    44Tags: single sign-on, sign on, authentication, vbulletin, wordpress, mediwiki, joomla, drupal, moodle, interprise shopping cart 
    55Requires at least: 3.0 
    6 Tested up to: 3.2 
    7 Stable tag: 1.2 
     6Tested up to: 3.4 
     7Stable tag: 1.2.2 
    88 
    99Provides universal Secure Single Sign-On between vBulletin and different popular platforms like WordPress. 
    1010 
    1111== Description == 
     12 
     13= Newer versions are available at http://www.vbsso.com/download = 
    1214 
    1315Provides universal Single Sign-On feature so that WordPress can use the vBulletin user database to manage authentication 
     
    2426 
    2527== Installation == 
     28 
     29= Newer versions are available at http://www.vbsso.com/download = 
    2630 
    2731This section describes how to install the plugin and get it working. 
     
    4549== Frequently Asked Questions == 
    4650 
     51= Newer versions are available at http://www.vbsso.com/download = 
     52 
    4753More details are available at http://www.vbsso.com/ 
    4854 
    4955== Screenshots == 
     56 
     57= Newer versions are available at http://www.vbsso.com/download = 
     58 
    50591. vBSSO Settings. 
    51602. Footer Link Settings. 
     
    5362 
    5463== Changelog == 
     64 
     65= Newer versions are available at http://www.vbsso.com/download = 
     66 
     67= 1.2.2 = 
     68* Added support of vBulletin Profile Page connected to WordPress. 
     69* Added support of vBulletin Author Page connected to WordPress. 
     70* Added support of "Registration" url connected to vBulletin. 
     71* [Updated August 10, 2012] 
     72 
     73= 1.2.1 = 
     74* Fixed "Use of undefined constant IS_PROFILE_PAGE - assumed 'IS_PROFILE_PAGE'". 
     75* Fixed an issue when sometimes avatars are not fetched from vBulletin and displayed. 
     76* [Updated June 22, 2012] 
    5577 
    5678= 1.2 = 
  • vbsso/trunk/vbsso.php

    r444966 r584921  
    55Description: Provides universal Secure Single Sign-On between vBulletin and different popular platforms like WordPress. 
    66Author: Yura Zaplavnov (www.vbsso.com) 
    7 Version: 1.2 
     7Version: 1.2.2 
    88Author URI: http://www.vbsso.com 
    99License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1010Network: true 
    11 Compatibility: 3.x 
     11Compatibility: 3.3.x or later 
    1212*/ 
    1313 
     
    2727 
    2828/** 
     29 * Profile Url Redirection 
     30 */ 
     31if (get_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE, 1) && get_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE, '') != '' && get_site_option(VBSSO_NAMED_EVENT_FIELD_PROFILE_URL, '') != '') { 
     32    add_action( 'load-profile.php', 'vbsso_load_profile_hook' ); 
     33} 
     34function vbsso_load_profile_hook() { 
     35 
     36    /*if current user is an 'administrator' do nothing*/ 
     37    global $current_user; 
     38    if (!in_array('administrator', $current_user->roles)) { 
     39        wp_redirect(get_site_option(VBSSO_NAMED_EVENT_FIELD_PROFILE_URL)); 
     40    } 
     41} 
     42 
     43if (get_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE, 1) && get_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE, '') != '' && get_site_option(VBSSO_NAMED_EVENT_FIELD_PROFILE_URL, '') != '') { 
     44    add_filter( 'author_link', 'vbsso_author_link_hook', 10, 2 ); 
     45} 
     46function vbsso_author_link_hook( $link, $author_id ) { 
     47    $email = (get_userdata($author_id)) ? get_userdata($author_id)->user_email : 0; 
     48    return  get_site_option(VBSSO_NAMED_EVENT_FIELD_PROFILE_URL, '') . md5(strtolower($email)); 
     49} 
     50 
     51/** 
     52 * Register Url Filter 
     53 */ 
     54if (vbsso_get_platform_config_property(SHAREDAPI_PLATFORM_WORDPRESS, 'override-links', true) && get_site_option(VBSSO_NAMED_EVENT_FIELD_REGISTER_URL, '') != '') { 
     55    add_filter('register', 'vbsso_register_url_hook'); 
     56} 
     57function vbsso_register_url_hook( $link ) { 
     58    if ( ! is_user_logged_in() ) { 
     59        if ( get_option('users_can_register') ) 
     60            $link = '<li><a href="'. sharedapi_url_add_destination(get_site_option(VBSSO_NAMED_EVENT_FIELD_REGISTER_URL, ''), 'server', '', get_site_option(VBSSO_NAMED_EVENT_FIELD_LID, '')) .'">' . __('Register') . '</a></li>'; 
     61        else 
     62            $link = ''; 
     63    } else { 
     64        $link = '<li><a href="' . admin_url() . '">' . __('Site Admin') . '</a></li>'; 
     65    } 
     66 
     67    return $link; 
     68} 
     69 
     70/** 
    2971 * Login Url Filter 
    3072 */ 
    3173if (vbsso_get_platform_config_property(SHAREDAPI_PLATFORM_WORDPRESS, 'override-links', true) && get_site_option(VBSSO_NAMED_EVENT_FIELD_LOGIN_URL, '') != '') { 
    32     add_filter('login_url', 'vbsso_login_url'); 
    33 } 
    34 function vbsso_login_url() { 
     74    add_filter('login_url', 'vbsso_login_url_hook'); 
     75} 
     76function vbsso_login_url_hook() { 
    3577    return sharedapi_url_add_destination(get_site_option(VBSSO_NAMED_EVENT_FIELD_LOGIN_URL, ''), 'server', '', get_site_option(VBSSO_NAMED_EVENT_FIELD_LID, '')); 
    3678} 
     
    4082 */ 
    4183if (vbsso_get_platform_config_property(SHAREDAPI_PLATFORM_WORDPRESS, 'override-links', true) && get_site_option(VBSSO_NAMED_EVENT_FIELD_LOGOUT_URL, '') != '') { 
    42     add_filter('logout_url', 'vbsso_logout_url'); 
    43 } 
    44 function vbsso_logout_url() { 
     84    add_filter('logout_url', 'vbsso_logout_url_hook'); 
     85} 
     86function vbsso_logout_url_hook() { 
    4587    return sharedapi_url_add_destination(get_site_option(VBSSO_NAMED_EVENT_FIELD_LOGOUT_URL, ''), 'server', '', get_site_option(VBSSO_NAMED_EVENT_FIELD_LID, '')); 
    4688} 
     
    5092 */ 
    5193if (vbsso_get_platform_config_property(SHAREDAPI_PLATFORM_WORDPRESS, 'override-links', true) && get_site_option(VBSSO_NAMED_EVENT_FIELD_LOSTPASSWORD_URL, '') != '') { 
    52     add_filter('lostpassword_url', 'vbsso_lostpassword_url'); 
    53 } 
    54 function vbsso_lostpassword_url() { 
     94    add_filter('lostpassword_url', 'vbsso_lostpassword_url_hook'); 
     95} 
     96function vbsso_lostpassword_url_hook() { 
    5597    return sharedapi_url_add_destination(get_site_option(VBSSO_NAMED_EVENT_FIELD_LOSTPASSWORD_URL, ''), 'server', '', get_site_option(VBSSO_NAMED_EVENT_FIELD_LID, '')); 
    5698} 
     
    59101 * Profile Personal Options Filter 
    60102 */ 
    61 if (IS_PROFILE_PAGE) { 
    62     add_action('profile_personal_options', 'vbsso_profile_personal_options'); 
    63 } 
    64 function vbsso_profile_personal_options() { 
     103if (defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE) { 
     104    add_action('profile_personal_options', 'vbsso_profile_personal_options_hook'); 
     105} 
     106function vbsso_profile_personal_options_hook() { 
    65107    global $current_user; 
    66108    if (!in_array('administrator', $current_user->roles)) { 
     
    72114 * Footer Filter 
    73115 */ 
    74 add_filter('wp_footer', 'vbsso_wp_footer'); 
    75 function vbsso_wp_footer() { 
     116add_filter('wp_footer', 'vbsso_wp_footer_hook'); 
     117function vbsso_wp_footer_hook() { 
    76118    global $current_user; 
    77119 
     
    80122        echo VBSSO_PLATFORM_FOOTER_LINK_HTML; 
    81123    } 
     124 
     125    echo VBSSO_PLATFORM_FOOTER_GA_HTML(sharedapi_get_platforms(SHAREDAPI_PLATFORM_WORDPRESS)); 
    82126} 
    83127 
     
    85129 * Admin Footer Filter 
    86130 */ 
    87 add_filter('admin_footer', 'vbsso_admin_footer'); 
    88 function vbsso_admin_footer() { 
     131add_filter('admin_footer', 'vbsso_admin_footer_hook'); 
     132function vbsso_admin_footer_hook() { 
    89133    if (in_array(get_site_option(VBSSO_PLATFORM_FOOTER_LINK_PROPERTY, VBSSO_PLATFORM_FOOTER_LINK_SHOW_ADMIN), array(VBSSO_PLATFORM_FOOTER_LINK_SHOW_EVERYWHERE, VBSSO_PLATFORM_FOOTER_LINK_SHOW_ADMIN))) { 
    90134        echo VBSSO_PLATFORM_FOOTER_LINK_HTML; 
    91135    } 
     136 
     137    echo VBSSO_PLATFORM_FOOTER_GA_HTML(sharedapi_get_platforms(SHAREDAPI_PLATFORM_WORDPRESS)); 
    92138} 
    93139 
     
    95141 * Auth Cookie Expiration Filter. 
    96142 */ 
    97 add_filter('auth_cookie_expiration', 'vbsso_auth_cookie_expiration', 10, 3); 
    98 function vbsso_auth_cookie_expiration($timeout, $user_id, $remember) { 
     143add_filter('auth_cookie_expiration', 'vbsso_auth_cookie_expiration_hook', 10, 3); 
     144function vbsso_auth_cookie_expiration_hook($timeout, $user_id, $remember) { 
    99145    $vbsso_timeout = sharedapi_gpc_variable(VBSSO_NAMED_EVENT_FIELD_TIMEOUT, '', 'c'); 
    100146    return !empty($vbsso_timeout) && $vbsso_timeout > 0 ? $vbsso_timeout : $timeout; 
     
    121167        } 
    122168 
    123         return vbsso_get_avatar('', $bloggers[$id], $size, $default, $alt); 
     169        return vbsso_get_avatar_hook('', $bloggers[$id], $size, $default, $alt); 
    124170    } 
    125171} 
     
    129175 */ 
    130176if (get_site_option(VBSSO_NAMED_EVENT_FIELD_FETCH_AVATARS, 1) && get_site_option(VBSSO_NAMED_EVENT_FIELD_AVATAR_URL, '') != '') { 
    131     add_action('get_avatar', 'vbsso_get_avatar', 10, 5); 
    132 } 
    133 function vbsso_get_avatar($avatar, $id_or_email, $size, $default, $alt) { 
     177    add_action('get_avatar', 'vbsso_get_avatar_hook', 10, 5); 
     178} 
     179function vbsso_get_avatar_hook($avatar, $id_or_email, $size = '96', $default = '', $alt = false) { 
    134180    $avatar_url = get_site_option(VBSSO_NAMED_EVENT_FIELD_AVATAR_URL, ''); 
    135181 
     
    147193        $id = (int)$id_or_email; 
    148194        $user = get_userdata($id); 
    149         if ($user) 
     195        if ($user) { 
    150196            $email = $user->user_email; 
     197        } 
    151198    } elseif (is_object($id_or_email)) { 
    152199        // No avatar for pingbacks or trackbacks 
    153200        $allowed_comment_types = apply_filters('get_avatar_comment_types', array('comment')); 
    154         if (!empty($id_or_email->comment_type) && !in_array($id_or_email->comment_type, (array)$allowed_comment_types)) 
     201        if (!empty($id_or_email->comment_type) && !in_array($id_or_email->comment_type, (array)$allowed_comment_types)) { 
    155202            return false; 
     203        } 
    156204 
    157205        if (!empty($id_or_email->user_id)) { 
    158206            $id = (int)$id_or_email->user_id; 
    159207            $user = get_userdata($id); 
    160             if ($user) 
     208            if ($user) { 
    161209                $email = $user->user_email; 
     210            } 
    162211        } elseif (!empty($id_or_email->comment_author_email)) { 
    163212            $email = $id_or_email->comment_author_email; 
     
    180229 * Mail Filter 
    181230 */ 
    182 add_filter('wp_mail', 'vbsso_disable_registration_email_filter'); 
    183 function vbsso_disable_registration_email_filter($result = '') { 
     231add_filter('wp_mail', 'vbsso_disable_registration_email_filter_hook'); 
     232function vbsso_disable_registration_email_filter_hook($result = '') { 
    184233    extract($result); 
    185234    if (preg_match('/New .+ User/', $subject)) { 
     
    198247 */ 
    199248if (is_admin()) { 
    200     add_action('admin_menu', 'vbsso_admin_menu'); 
    201 } 
    202 function vbsso_admin_menu() { 
     249    add_action('admin_menu', 'vbsso_admin_menu_hook'); 
     250} 
     251function vbsso_admin_menu_hook() { 
    203252    global $wpdb; 
    204253 
     
    216265        update_site_option(VBSSO_NAMED_EVENT_FIELD_API_KEY, $_POST[VBSSO_NAMED_EVENT_FIELD_API_KEY]); 
    217266        update_site_option(VBSSO_NAMED_EVENT_FIELD_FETCH_AVATARS, $_POST[VBSSO_NAMED_EVENT_FIELD_FETCH_AVATARS]); 
     267        update_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE, $_POST[VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE]); 
     268        update_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE, $_POST[VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE]); 
    218269        update_site_option(VBSSO_PLATFORM_FOOTER_LINK_PROPERTY, $_POST[VBSSO_PLATFORM_FOOTER_LINK_PROPERTY]); 
    219270    } 
     
    235286    $fetch_avatars_name = VBSSO_NAMED_EVENT_FIELD_FETCH_AVATARS; 
    236287    $fetch_avatars_title = VBSSO_NAMED_EVENT_FIELD_FETCH_AVATARS_TITLE; 
     288 
     289    $show_vb_authors_profiles = get_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE, 1) ? 'checked' : ''; 
     290    $show_vb_authors_profiles_name = VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE; 
     291    $show_vb_authors_profiles_title = VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_AUTHOR_PROFILE_TITLE; 
     292 
     293    $show_vb_profile = get_site_option(VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE, 1) ? 'checked' : ''; 
     294    $show_vb_profile_name = VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE; 
     295    $show_vb_profile_title = VBSSO_NAMED_EVENT_FIELD_SHOW_VBULLETIN_PROFILE_TITLE; 
    237296 
    238297    echo <<<EOD 
     
    272331    </p> 
    273332 
     333    <p> 
     334        <input type="checkbox" id="{$show_vb_authors_profiles_name}" name="{$show_vb_authors_profiles_name}" value="1" {$show_vb_authors_profiles}> 
     335        <label for="{$show_vb_authors_profiles_name}">{$show_vb_authors_profiles_title}</label> <br/> 
     336    </p> 
     337 
     338    <p> 
     339        <input type="checkbox" id="{$show_vb_profile_name}" name="{$show_vb_profile_name}" value="1" {$show_vb_profile}> 
     340        <label for="{$show_vb_profile_name}">{$show_vb_profile_title}</label> <br/> 
     341    </p> 
     342 
    274343    <p class="submit"> 
    275344        <input type="submit" name="Submit" class="button-primary" value="Save Changes"/> 
Note: See TracChangeset for help on using the changeset viewer.