当前位置: 首页>>代码示例>>PHP>>正文


PHP iaUtil::getLetters方法代码示例

本文整理汇总了PHP中iaUtil::getLetters方法的典型用法代码示例。如果您正苦于以下问题:PHP iaUtil::getLetters方法的具体用法?PHP iaUtil::getLetters怎么用?PHP iaUtil::getLetters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iaUtil的用法示例。


在下文中一共展示了iaUtil::getLetters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: IN

     $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();
开发者ID:nicefirework,项目名称:subrion,代码行数:31,代码来源:members.php

示例2: isset

     $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);
开发者ID:nicefirework,项目名称:subrion-lyrics,代码行数:31,代码来源:artists.php


注:本文中的iaUtil::getLetters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。