mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
XUP (Social Login) fixes in usersettings form. Banner menu query corrected.
This commit is contained in:
@@ -80,6 +80,12 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_realname($parm)
|
function sc_realname($parm)
|
||||||
{
|
{
|
||||||
|
if(!empty($this->var['user_xup'])) // social login active.
|
||||||
|
{
|
||||||
|
return $this->var['user_login'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$options = array('title'=> '', 'size' => 40,'required'=>$pref['signup_option_realname']);
|
$options = array('title'=> '', 'size' => 40,'required'=>$pref['signup_option_realname']);
|
||||||
return e107::getForm()->text('realname',$this->var['user_login'], 100, $options);
|
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)
|
function sc_password1($parm)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
$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')
|
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)
|
function sc_password2($parm)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
$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')
|
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)
|
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);
|
$options = array('size' => 40,'title'=>'','required'=>true);
|
||||||
return e107::getForm()->email('email', $this->var['user_email'], 100, $options);
|
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)
|
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));
|
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 .= ($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'))
|
if($tags = e107::getRegistry('core/form/related'))
|
||||||
{
|
{
|
||||||
$tags_regexp = "'(^|,)(".str_replace(",", "|", $tags).")(,|$)'";
|
$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))
|
if($data = $sql->retrieve('banner', 'banner_id, banner_image, banner_clickurl,banner_campaign, banner_description', $query,true))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user