<?php
PA::showSearchbar();

$args = array('page' => 1,
              'howMany' => Config::get('PPP'),
              'orderBy' => array('created','DESC'));
$users = PA::getProfiles($args);

if ($users['number'] > 0) {
    $users_feature = $users;
    shuffle($users_feature['data']);

    $a = 0; $featured_user = array();
    foreach ($users_feature['data'] as $uf) {
        if ($uf->admin_featured == 1) {
            $featured_user['data'][] = $uf;
            $a++;
        }
        if ($a == 5) {
            break;
        }
    }

    echo '<h2 class="headline">'.Text::get('INDEX_USERS_FEATURED').'</h2>';
    PA::showFeaturedUsers($featured_user);
    echo '<div class="clear"></div>';
    echo '<h2 class="headline">'.Text::get('INDEX_USERS_FEATURED_ALL').'</h2>';
    PA::generateUserList($users['data'], false, true);
}

PA::showPagination($users['number'],$args['howMany'],'',Text::get('OFFERS_MORE'),true);

PA::showFooter();
