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


PHP UserList::get方法代码示例

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


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

示例1: getAccessEntityUsers

 public function getAccessEntityUsers(PermissionAccess $pa)
 {
     $gl = new UserList();
     foreach ($this->groups as $g) {
         $gl->filterByGroupID($g->getGroupID());
     }
     return $gl->get();
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:8,代码来源:group_combination.php

示例2: getLeaders

 public function getLeaders($searchString, $city, $limit)
 {
     Loader::model('user_list');
     $av = Loader::helper('concrete/avatar');
     $ul = new UserList();
     $ul->filterByKeywords($searchString);
     $ul->filterByGroup('Walk Leaders');
     $ul->filterByIsActive(1);
     $ul->filterByFirstName(null, '!=');
     $ul->filterByFirstName('', '!=');
     $ul->filter('uLastLogin', 0, '!=');
     $ul->sortBy('uLastLogin');
     $userSet = [];
     foreach ($ul->get($limit ?: 5) as $user) {
         $home_city = $user->getAttribute('home_city');
         $userSet[$user->getUserID()] = ['user_id' => $user->getUserID(), 'first_name' => $user->getAttribute('first_name'), 'last_name' => $user->getAttribute('last_name'), 'city_name' => $home_city ? $home_city->getCollectionName() : null, 'city_id' => $home_city ? $home_city->getCollectionID() : null, 'bio' => $user->getAttribute('bio'), 'twitter' => $user->getAttribute('twitter'), 'facebook' => $user->getAttribute('facebook'), 'website' => $user->getAttribute('website'), 'avatar' => $av->getImagePath($user)];
     }
     return json_encode($userSet);
 }
开发者ID:r-bansal,项目名称:janeswalk-web-1,代码行数:19,代码来源:walk_leaders.php

示例3: die

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
$valt = Loader::helper('validation/token');
if ($valt->validate('quick_user_select_' . $_REQUEST['key'], $_REQUEST['token'])) {
	$u = new User();
	Loader::model('user_list');
	$db = Loader::db();
	$userList = new UserList();
	if ($_GET['term'] != '') {
		$term = $db->quote($_GET['term'].'%');
		$userList->filter(false, '( u.uName LIKE ' . $term . ')');
	}
	$userList->sortBy('uName','ASC');
	$users = $userList->get(7);
	$userNames = array();
	foreach($users as $ui) {
		$userNames[] = $ui->getUserName();
	}
	$jh = Loader::helper('json');
	echo $jh->encode($userNames);
}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:21,代码来源:autocomplete.php

示例4: UserList

<?php

include 'base.php';
User::protect();
$section = 'admin_users';
$page_title = 'Add/Edit Users';
$ul = new UserList();
$userlist = $ul->get($_GET['entries_per_page'], $_GET['start']);
$news_total = $ul->getTotal();
include 'layout/header.php';
?>

<div id="breadcrumb">
	<a href="index.php">Audition&nbsp;&#62;</a>&nbsp;<a href="admin.php">Administer Audition&nbsp;&#62;</a>&nbsp;Users
</div>

<?php 
$u = User::getCurrent();
if (!$u->isAdmin()) {
    Error::outputDialog('Return to Main Menu', 'index.php', 'Only an administrator may access administrator options.');
} else {
    if (db::isError($newslist)) {
        $newslist->outputList();
    }
    ?>
	
	<h1>users:</h1>
	<div class="inset">
	<p>
	<form id="amount_form" action="<?php 
    echo $PHP_SELF;
开发者ID:pinecreativelabs,项目名称:audition,代码行数:31,代码来源:admin_users.php

示例5: view

 /**
  * Call model data needed by view
  *
  * @param int $userID The user ID of who we're viewing
  * @return null
  */
 public function view($userID = 0)
 {
     // Load helpers
     Loader::model('page_list');
     $nh = Loader::helper('navigation');
     $ah = Loader::helper('concrete/avatar');
     $th = Loader::helper('text');
     $ih = Loader::helper('image');
     // Set helpers for view
     // Set the page view first
     $this->set('bodyData', ['pageViewName' => 'ProfilePageView']);
     parent::view($userID);
     // Load the current user
     $u = new User();
     $ui = UserInfo::getByID($u->getUserID());
     $profile = $this->get('profile');
     // Basic flags identifying the type of user
     // Whether or not the logged in user is viewing their own "profile"
     $userIsViewingSelf = $u->getUserID() === $profile->getUserID();
     // User is a CO
     $userIsCityOrganizer = in_array('City Organizers', $profile->getUserObject()->getUserGroups());
     /**
      * New dashboard variables
      *
      */
     // Remaining variables/logic only needed for "self viewing"
     if ($userIsViewingSelf) {
         /**
          * Helper
          *
          */
         $html = Loader::helper('html');
         $this->addHeaderItem($html->javascript('swfobject.js'));
         /**
          * User data
          *
          */
         // Whether the logged in user has set their first and last name
         $this->set('userHasSetName', (bool) trim($ui->getAttribute('first_name') . ' ' . $ui->getAttribute('last_name')));
         // The home city for the logged in user (false otherwise)
         $userHomeCity = $ui->getAttribute('home_city');
         $this->set('userHomeCity', $userHomeCity);
         // Whether the logged in user has chosen an avatar/display picture
         $this->set('userPicture', $ah->getImagePath($ui));
         // Walks owned by user
         $pl = new PageList();
         $pl->filterByCollectionTypeHandle('walk');
         $pl->filterByUserID($u->getUserID());
         // Include the names of draft walks, not last published
         $pl->displayUnapprovedPages();
         $this->set('userWalks', $pl->get());
         // Whether the logged in user has created any blog posts
         $pl = new PageList();
         $pl->filterByCollectionTypeHandle(['walk_blog_entry', 'city_blog_entry']);
         $pl->filterByUserID($u->getUserID());
         $this->set('userBlogPosts', $pl->get());
         /**
          * User city data
          *
          */
         if ($userHomeCity) {
             // Set the city
             $city = $ui->getAttribute('home_city');
             // Load organizer user for this city
             $cityOrganizer = UserInfo::getByID($userHomeCity->getCollectionUserID());
             if ($cityOrganizer) {
                 // The email address of the city organizer for the logged in user's
                 // home city
                 $cityOrganizerEmailAddress = $cityOrganizer->getUserEmail();
                 $this->set('cityOrganizerEmailAddress', $cityOrganizerEmailAddress);
             }
             // Whether the city has a blog page set up for it
             $pl = new PageList();
             $pl->filterByCollectionTypeHandle('blog');
             $pl->filterByParentID($userHomeCity->getCollectionID());
             $cityHasBlogSetup = (bool) $pl->getTotal();
             $this->set('cityHasBlogSetup', $cityHasBlogSetup);
             // List of basic data for three walks we want to highlight to city
             // organizers/walk leaders that showcase creative/unique walks
             $pl = new PageList();
             $pl->filterByCollectionTypeHandle('walk');
             $pl->filter(false, 'p1.uID !=' . $u->getUserID());
             $pl->filterByAttribute('exclude_page_list', false);
             $pl->sortBy('RAND()');
             // Load this list of featured walks
             $featuredWalkData = array_map(function ($page) use($nh, $ih) {
                 $_city = Page::getByID($page->getCollectionParentID());
                 $_country = Page::getByID($_city->getCollectionParentID());
                 $_thumb = $page->getAttribute('thumbnail');
                 $countryName = $_country->getCollectionName();
                 if ($countryName === 'United States') {
                     $countryName = 'United States of America';
                 }
                 $countryName = str_replace(' ', '_', $countryName);
//.........这里部分代码省略.........
开发者ID:r-bansal,项目名称:janeswalk-web-1,代码行数:101,代码来源:controller.php

示例6: generateUsername

 protected function generateUsername()
 {
     $name = $this->user->firstName . " " . $this->user->lastName;
     $name = str_replace(" ", "", $name);
     // Replace spaces.
     $name = strtolower($name);
     // Make lowercase.
     $isUnique = false;
     $count = 0;
     $username = $name;
     while ($isUnique == false) {
         $ul = new UserList();
         $ul->filterByUsername($username);
         $list = $ul->get(1);
         if (count($list) == 0) {
             $isUnique = true;
         } else {
             $count++;
             $username = $name . $count;
         }
     }
     return $username;
 }
开发者ID:remo,项目名称:social,代码行数:23,代码来源:controller.php

示例7: elseif

        } elseif ($k === 'attributes') {
            // $attribute keys: 'id', 'value', 'compare'
            foreach ($filter as $attribute) {
                list($handle, $value, $comparison) = array_replace($defaultAttribute, $attribute);
                $ul->filterByAttribute($handle, $value, $comparison);
            }
        }
        $ul->sortBy('ak_order', 'asc');
    }
    /**
     * Build doc with all the 'member's in it, and load the values we'll
     * need to display.
     */
    return array_map(function ($member) use($av) {
        return ['id' => $member->getUserID(), 'img' => $av->getImagePath($member), 'name' => trim($member->getAttribute('first_name') . ' ' . $member->getAttribute('last_name')), 'title' => $member->getAttribute('job_title') ?: "Jane's Walk", 'email' => $member->getUserEmail(), 'description' => $member->getAttribute('bio')];
    }, $ul->get(100));
};
echo $controller->getContent();
?>
<ul class="ccm-staff-list">
<?php 
foreach ($getMembers($filters) as $member) {
    ?>
    <li>
        <div
            class="u-avatar <?php 
    echo 'placeholder' . ord($member['id']) % 3;
    ?>
"
            <?php 
    echo $member['img'] ? ' style="background-image:url(' . $member['img'] . ')"' : '';
开发者ID:r-bansal,项目名称:janeswalk-web-1,代码行数:31,代码来源:staff_list.php


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