1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 00:41:52 +02:00

XUP shortcode, avatar image fix

This commit is contained in:
secretr
2012-08-02 11:26:47 +00:00
parent 8c94862fb3
commit 392b4610f4
2 changed files with 43 additions and 8 deletions

View File

@@ -40,17 +40,27 @@ class signup_shortcodes extends e_shortcode
}
}
function sc_signup_xup() // show it to those who were using xup
function sc_signup_xup($param) // show it to those who were using xup
{
return $this->sc_signup_social_login();
switch ($param)
{
case 'login':
return $this->sc_signup_social_login();
break;
case 'signup':
default:
return $this->sc_signup_xup_signup();
break;
}
}
function sc_signup_social_login()
// TODO - template
function sc_signup_xup_login()
{
$pref = e107::getPref('social_login_active');
if(vartrue($pref))
if(!empty($pref))
{
$text = "";
$providers = e107::getPref('social_login');
@@ -60,7 +70,32 @@ class signup_shortcodes extends e_shortcode
$p = strtolower($p);
if($v['enabled'] == 1)
{
$text .= "<a href='".e_BASE."index.php?provider={$p}'><img class='e-tip' title='Register using your {$p} account' src='".e_HANDLER."hybridauth/icons/{$p}.png' alt='' /></a>";
$text .= "<a href='".e107::getUrl()->create('system/xup/login?provider='.$p)."'><img class='e-tip' title='Register using your {$p} account' src='".e_HANDLER."hybridauth/icons/{$p}.png' alt='' /></a>";
}
//TODO different icon options. see: http://zocial.smcllns.com/
}
// $text .= "<hr />";
return $text;
}
}
// TODO - template
function sc_signup_xup_signup()
{
$pref = e107::getPref('social_login_active');
if(!empty($pref))
{
$text = "";
$providers = e107::getPref('social_login');
foreach($providers as $p=>$v)
{
$p = strtolower($p);
if($v['enabled'] == 1)
{
$text .= "<a href='".e107::getUrl()->create('system/xup/signup?provider='.$p)."'><img class='e-tip' title='Register using your {$p} account' src='".e_HANDLER."hybridauth/icons/{$p}.png' alt='' /></a>";
}
//TODO different icon options. see: http://zocial.smcllns.com/
}

View File

@@ -954,8 +954,8 @@ class e_user_provider
$userdata['user_login'] = $userdata['user_name'];
$userdata['user_customtitle'] = ''; // not used
$userdata['user_password'] = $userMethods->HashPassword($plainPwd, $userdata['user_loginname']); // pwd
$userdata['user_sess'] = $profile->photoURL; // should we?
$userdata['user_image'] = ''; // not used
$userdata['user_sess'] = ''; //
$userdata['user_image'] = $profile->photoURL; // avatar
$userdata['user_signature'] = ''; // not used
$userdata['user_hideemail'] = 1; // hide it by default
$userdata['user_xup'] = $sql->escape($this->userId());