diff --git a/e107_core/shortcodes/batch/usersettings_shortcodes.php b/e107_core/shortcodes/batch/usersettings_shortcodes.php index 48828708f..87f74f8a3 100755 --- a/e107_core/shortcodes/batch/usersettings_shortcodes.php +++ b/e107_core/shortcodes/batch/usersettings_shortcodes.php @@ -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)); } diff --git a/e107_plugins/banner/banner_menu.php b/e107_plugins/banner/banner_menu.php index eadde56c4..2a8852ca0 100644 --- a/e107_plugins/banner/banner_menu.php +++ b/e107_plugins/banner/banner_menu.php @@ -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)) {