getQuery(true); $q->select('*'); $q->from('#__plg_slogin_profile'); $q->where('`user_id` = '.(int)$userid); $q->where('`current_profile` = 1'); $db->setQuery($q,0,1); $profile = $db->loadObject(); if (!$profile){ $q = $db->getQuery(true); $q->select('*'); $q->from('#__plg_slogin_profile'); $q->where('`user_id` = '.(int)$userid); $db->setQuery($q,0,1); $profile = $db->loadObject(); } if (!$profile) return false; if(!empty($profile->avatar)){ //Получаем папку с изображениями $plugin = JPluginHelper::getPlugin('slogin_integration', 'profile'); $pluginParams = new JRegistry(); $pluginParams->loadString($plugin->params); $paramFolder = $pluginParams->get('rootfolder', 'images/avatar'); $profile->avatar = preg_replace("/.*?\//","",$profile->avatar); $profile->avatar = $paramFolder.'/'.$profile->avatar; } return $profile; } } ?>