Example #1
0
     $activeGroup = $_SESSION['group'];
     $cause = '`usergroup_id` = ' . $activeGroup . ' AND ';
 } else {
     $cause = '`usergroup_id` IN (' . implode(',', array_keys($usergroups)) . ') AND ';
 }
 $iaView->assign('activeGroup', $activeGroup);
 $filterBy = 'username';
 /* check values */
 if (isset($_GET['account_by'])) {
     $_SESSION['account_by'] = $_GET['account_by'];
 }
 if (!isset($_SESSION['account_by'])) {
     $_SESSION['account_by'] = 'username';
 }
 $filterBy = $_SESSION['account_by'] == 'fullname' ? 'fullname' : 'username';
 $letters['all'] = iaUtil::getLetters();
 $letters['active'] = isset($iaCore->requestPath[0]) && in_array($iaCore->requestPath[0], $letters['all']) ? $iaCore->requestPath[0] : false;
 $cause .= $letters['active'] ? '0-9' == $letters['active'] ? "(`{$filterBy}` REGEXP '^[0-9]') AND " : "(`{$filterBy}` LIKE '{$letters['active']}%') AND " : '';
 if ($letters['active']) {
     $iaView->set('subpage', array_search($letters['active'], $letters) + 1);
 }
 $iaDb->setTable(iaUsers::getTable());
 // gets current page and defines start position
 $pagination = array('limit' => 20, 'total' => (int) $iaDb->one(iaDb::STMT_COUNT_ROWS, $cause . "`status` = 'active' "), 'url' => IA_URL . 'members/' . ($letters['active'] ? $letters['active'] . '/' : '') . '?page={page}');
 $page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
 $start = (max($page, 1) - 1) * $pagination['limit'];
 $membersList = $iaDb->all(iaDb::ALL_COLUMNS_SELECTION, $cause . "`status` = 'active' ORDER BY `date_reg`", $start, $pagination['limit']);
 $fields = $iaCore->factory('field')->filter($membersList, iaUsers::getTable());
 $letters['existing'] = array();
 $array = $iaDb->all('DISTINCT UPPER(SUBSTR(`' . $filterBy . '`, 1, 1)) `letter`', $cause . "`status` = 'active' GROUP BY `username`");
 $iaDb->resetTable();
Example #2
0
     $iaView->assign('lyrics', $lyrics);
     $iaView->assign('total_lyrics', $total_lyrics);
     // breadcrumb formation
     iaBreadcrumb::add(_t('artists'), 'artists/');
     // set meta keywords and description
     $iaView->set('description', $artist['meta_description']);
     $iaView->set('keywords', $artist['meta_keywords']);
     $iaView->title($artist['title']);
     $iaView->display('artistview');
     break;
 case 'artists':
     // gets current page and defines start position
     $per_page = $iaCore->get('artists_per_page', 20);
     $page = isset($_GET['page']) && 1 < $_GET['page'] ? (int) $_GET['page'] : 1;
     $start = ($page - 1) * $per_page;
     $search_alphas = iaUtil::getLetters();
     $alpha = isset($iaCore->requestPath[0]) && in_array($iaCore->requestPath[0], $search_alphas) ? $iaCore->requestPath[0] : false;
     $cause = $alpha ? '0-9' == $alpha ? "(`title` REGEXP '^[0-9]') AND " : "(`title` LIKE '{$alpha}%') AND " : '';
     $iaView->assign('search_alphas', $search_alphas);
     $iaView->assign('alpha', $alpha);
     $iaArtist->where = $cause . "`status`='active' ORDER BY `title` ASC ";
     $artists = $iaArtist->getArtists(false, $start, $per_page);
     $total_artists = $iaArtist->count;
     if ($artists) {
         $iaItem = $iaCore->factory('item');
         $artists = $iaItem->updateItemsFavorites($artists, $iaArtist->getItemName());
         // filter fields
         $fields = iaField::filterFields($artists, 'artists');
         $iaView->assign('fields', $fields);
     }
     $iaView->assign('artists', $artists);