function profile_url($segment = null, $user = null)
{
$user = (empty($user)) ? get_user() : $user;
$url = $user['username'] . "/" . $segment;
return url($url);
}
$query = db()->query("SELECT id , SUM(views) , entity_id, username, first_name, last_name, gender, country, avatar, online_time, featured FROM feeds,users WHERE `timestamp` >= DATE_SUB( CURRENT_DATE, INTERVAL 90 DAY )AND id = entity_id GROUP BY `id` ORDER BY SUM(`views`) DESC LIMIT 3");
return fetch_all($query);