mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
XUP (Social Login) fixes in usersettings form. Banner menu query corrected.
This commit is contained in:
parent
fa8f25dfc5
commit
238c7b0bac
@ -80,6 +80,12 @@ class usersettings_shortcodes extends e_shortcode
|
||||
|
||||
function sc_realname($parm)
|
||||
{
|
||||
if(!empty($this->var['user_xup'])) // social login active.
|
||||
{
|
||||
return $this->var['user_login'];
|
||||
}
|
||||
|
||||
|
||||
$pref = e107::getPref();
|
||||
$options = array('title'=> '', 'size' => 40,'required'=>$pref['signup_option_realname']);
|
||||
return e107::getForm()->text('realname',$this->var['user_login'], 100, $options);
|
||||
@ -90,6 +96,11 @@ class usersettings_shortcodes extends e_shortcode
|
||||
function sc_password1($parm)
|
||||
{
|
||||
$pref = e107::getPref();
|
||||
|
||||
if(!empty($this->var['user_xup'])) // social login active.
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!isset($pref['auth_method']) || $pref['auth_method'] == '' || $pref['auth_method'] == 'e107' || $pref['auth_method'] == '>e107')
|
||||
{
|
||||
@ -105,6 +116,11 @@ class usersettings_shortcodes extends e_shortcode
|
||||
function sc_password2($parm)
|
||||
{
|
||||
$pref = e107::getPref();
|
||||
|
||||
if(!empty($this->var['user_xup'])) // social login active.
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!isset($pref['auth_method']) || $pref['auth_method'] == '' || $pref['auth_method'] == 'e107' || $pref['auth_method'] == '>e107')
|
||||
{
|
||||
@ -130,7 +146,12 @@ class usersettings_shortcodes extends e_shortcode
|
||||
|
||||
|
||||
function sc_email($parm)
|
||||
{
|
||||
{
|
||||
if(!empty($this->var['user_xup'])) // social login active.
|
||||
{
|
||||
return $this->var['user_email'];
|
||||
}
|
||||
|
||||
$options = array('size' => 40,'title'=>'','required'=>true);
|
||||
return e107::getForm()->email('email', $this->var['user_email'], 100, $options);
|
||||
}
|
||||
@ -227,6 +248,12 @@ class usersettings_shortcodes extends e_shortcode
|
||||
|
||||
function sc_avatar_remote($parm)
|
||||
{
|
||||
if(!empty($this->var['user_xup'])) // social login active.
|
||||
{
|
||||
// return $this->var['user_image'];
|
||||
return e107::getParser()->toAvatar($this->var);
|
||||
}
|
||||
|
||||
return e107::getForm()->avatarpicker('image',$this->var['user_image'],array('upload'=>1));
|
||||
}
|
||||
|
||||
|
@ -106,13 +106,25 @@ if(!empty($menu_pref['banner_campaign']) && !empty($menu_pref['banner_amount']))
|
||||
// $query .= ($parm ? " AND banner_campaign='".$tp->toDB($parm)."'" : '');
|
||||
|
||||
|
||||
|
||||
|
||||
$query .= " AND banner_active IN (".USERCLASS_LIST.") ";
|
||||
|
||||
$query .= " ORDER BY ";
|
||||
|
||||
|
||||
$ord = array();
|
||||
|
||||
if($tags = e107::getRegistry('core/form/related'))
|
||||
{
|
||||
$tags_regexp = "'(^|,)(".str_replace(",", "|", $tags).")(,|$)'";
|
||||
$query .= " AND banner_keywords REGEXP ".$tags_regexp;
|
||||
$ord[] = " banner_keywords REGEXP ".$tags_regexp." DESC";
|
||||
}
|
||||
|
||||
$query .= " AND banner_active IN (".USERCLASS_LIST.") ORDER BY RAND($seed) LIMIT ".intval($menu_pref['banner_amount']);
|
||||
$ord[] = " RAND($seed) ASC";
|
||||
|
||||
$query .= implode(', ',$ord);
|
||||
$query .= " LIMIT ".intval($menu_pref['banner_amount']);
|
||||
|
||||
if($data = $sql->retrieve('banner', 'banner_id, banner_image, banner_clickurl,banner_campaign, banner_description', $query,true))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user