Beispiel #1
0
function open_social_login_html($atts = array())
{
    $html = '<div class="open_social_box login_box">';
    $show = isset($atts) && !empty($atts) && isset($atts['show']) ? $atts['show'] : '';
    foreach ($GLOBALS['open_arr'] as $v) {
        if ($show && stripos($show, $v) === false) {
            continue;
        }
        if (osop(strtoupper($v))) {
            $html .= open_login_button_show($v, str_replace('%OPEN_TYPE%', $GLOBALS['open_str'][$v], $GLOBALS['open_str']['login']), home_url('/'));
        }
    }
    $html .= '</div>';
    return $html;
}
Beispiel #2
0
function open_social_bind_options($user)
{
    $html = '<table class="form-table"><tr valign="top"><th scope="row">' . __('Open Social', 'open-social') . '</th><td>';
    $open_type = get_user_meta($user->ID, 'open_type', true);
    $open_email = get_user_meta($user->ID, 'open_email', true);
    if (osop('extend_comment_email', 1)) {
        $html .= '<p><label for="open_email"><input type="checkbox"';
        if (preg_match('/fake\\.com/', $user->user_email)) {
            $html .= ' class="disabled" disabled="disabled"';
        }
        $html .= ' value="1" id="open_email" name="open_email" ' . checked(esc_attr($open_email), 1, false) . ' />' . __('Receive reply email notification', 'open-social') . '</label>';
        $html .= ' <a href="javascript:jQuery(\'#email\').select();jQuery(\'h3\').get(2).scrollIntoView();">#' . __('Please make sure you have a valid email', 'open-social') . '</a>';
        $html .= '<br/><br/></p>';
    }
    if (osop('extend_lang_switcher', 1)) {
        $html .= '<p><input class="button-primary" type="button" onclick="location.href=\'?open_lang=' . (get_locale() != 'en_US' ? 'en_US' : 'zh_CN') . '\'" value="' . __('Language Switcher', 'open-social') . '"/><br/><br/></p>';
    }
    $html .= '<div id="open_social_login_box" class="open_social_box login_box">';
    foreach ($GLOBALS['open_arr'] as $v => $k) {
        if (osop(strtoupper($v))) {
            if ($open_type && stripos($open_type, $v) !== false) {
                $html .= open_login_button_unbind($v, sprintf(__('Unbind with %s', 'open-social'), $k), home_url('/'));
            } else {
                $html .= open_login_button_show($v, sprintf(__('Login with %s', 'open-social'), $k), home_url('/'));
            }
        }
    }
    $html .= '</div>';
    $html .= '</td></tr></table>';
    echo $html;
}