Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into save-twitter-avatar

Conflicts:
	social-connect.php
  • Loading branch information
Frique committed Aug 4, 2014
2 parents 091f6a8 + 044de0c commit 5eaba92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion admin.php
Expand Up @@ -58,7 +58,7 @@ function sc_render_social_connect_settings() {
<h3><?php _e('Twitter Settings', 'social_connect'); ?></h3>
<p><?php _e('To offer login via Twitter, you need to register your site as a Twitter Application and get a <strong>API Key</strong> and a <strong>API Secret</strong>.', 'social_connect'); ?></p>
<p><?php printf(__('Already registered? Find your keys in your <a target="_blank" href="%2$s">%1$s Application List</a>', 'social_connect'), 'Twitter', 'https://dev.twitter.com/apps'); ?></p>
<p><?php printf(__('Need to register? <a href="%1$s">Register an Application</a> and fill the form with the details below:', 'social_connect'), 'http://dev.twitter.com/apps/new'); ?></p>
<p><?php printf(__('Need to register? <a target="_blank" href="%1$s">Register an Application</a> and fill the form with the details below:', 'social_connect'), 'http://dev.twitter.com/apps/new'); ?></p>
<ol>
<li><?php printf(__('Callback URL: <strong>%1$s</strong>', 'social_connect'), SOCIAL_CONNECT_PLUGIN_URL . '/twitter/callback.php'); ?></li>
<li><?php _e('Access level: <strong>Read-only</strong>', 'social_connect'); ?></li>
Expand Down
21 changes: 6 additions & 15 deletions social-connect.php
Expand Up @@ -28,15 +28,6 @@ function sc_activate(){
}
register_activation_hook( __FILE__, 'sc_activate' );


/**
* Registration.php is deprecated since version 3.1 with no alternative available.
* registration.php functions moved to user.php, everything is now included by default
* This file only need to be included for versions before 3.1.
*/
if ( !function_exists( 'email_exists' ) )
require_once( ABSPATH . WPINC . '/registration.php' );

/**
* Internationalization of the plugin
**/
Expand Down Expand Up @@ -132,7 +123,7 @@ function sc_social_connect_process_login( $is_ajax = false ) {
$sc_provider_identity = $_REQUEST[ 'social_connect_twitter_identity' ];
social_connect_verify_signature( $sc_provider_identity, $sc_provided_signature, $redirect_to );
$sc_name = $_REQUEST[ 'social_connect_name' ];
$names = explode(" ", $sc_name );
$names = explode( ' ', $sc_name, 2 );
$sc_first_name = $names[0];
$sc_last_name = $names[1];
$sc_screen_name = $_REQUEST[ 'social_connect_screen_name' ];
Expand Down Expand Up @@ -167,12 +158,12 @@ function sc_social_connect_process_login( $is_ajax = false ) {
$sc_first_name = $sc_name;
$sc_last_name = '';
} else {
$names = explode(" ", $sc_username );
$names = explode( ' ', $sc_username, 2 );
$sc_first_name = $names[0];
$sc_last_name = $names[1];
}
} else {
$names = explode(" ", $sc_name );
$names = explode( ' ', $sc_name, 2 );
$sc_first_name = $names[0];
$sc_last_name = $names[1];
}
Expand All @@ -190,7 +181,7 @@ function sc_social_connect_process_login( $is_ajax = false ) {
$sc_first_name = $sc_name;
$sc_last_name = '';
} else {
$names = explode(" ", $sc_name );
$names = explode( ' ', $sc_name, 2 );
$sc_first_name = $names[0];
$sc_last_name = $names[1];
}
Expand Down Expand Up @@ -351,8 +342,8 @@ function sc_filter_avatar($avatar, $id_or_email, $size, $default, $alt) {
$size_label = 'mini';
}

$custom_avatar = get_user_meta($user_id, 'social_connect_twitter_avatar', true);
$custom_avatar = str_replace('_normal', '_'.$size_label, $custom_avatar);
$custom_avatar = get_user_meta( $user_id, 'social_connect_twitter_avatar', true );
$custom_avatar = str_replace( '_normal', '_' . $size_label, $custom_avatar );
break;
}
}
Expand Down

0 comments on commit 5eaba92

Please sign in to comment.