public function getProfileURL($userid, $task = '', $xhtml = true) { if ($userid) { $user = ES::user($userid); // When simple urls are enabled, we just hardcode the url $config = ES::config(); $jConfig = ES::jConfig(); if (!ES::isSh404Installed() && $config->get('users.simpleUrl') && $jConfig->getValue('sef')) { $url = rtrim(JURI::root(), '/') . '/' . $user->getAlias(false); return $url; } // If it's not configured for simple urls, just set the alias $alias = $user->getAlias(); } else { $alias = $userid; } $options = array('id' => $alias); if ($task) { $options['layout'] = $task; } $url = FRoute::profile($options, $xhtml); return $url; }