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


PHP CUserHelper::filterUserByName方法代码示例

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


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

示例1: ajaxLoadGroupEventMembers

 public function ajaxLoadGroupEventMembers($namePrefix, $cid, $limitstart = 0, $limit = 200)
 {
     // pending filter
     $objResponse = new JAXResponse();
     $filter = JFilterInput::getInstance();
     $callback = 'events,inviteUsers';
     $cid = $filter->clean($cid, 'int');
     $namePrefix = $filter->clean($namePrefix, 'string');
     $my = CFactory::getUser();
     //get the handler
     $handlerName = '';
     //load the event
     $event = JTable::getInstance('Event', 'CTable');
     $event->load($cid);
     //check permission here
     //get all the members of the group
     $groupid = $event->contentid;
     $groupsModel = CFactory::getModel('groups');
     $guestIds = $event->getMembers(COMMUNITY_EVENT_STATUS_ATTEND, 0, false, false, false);
     //get a list of attending users
     $userids = array();
     foreach ($guestIds as $uid) {
         $userids[] = $uid->id;
     }
     $members = $groupsModel->getMembers($groupid, 0, true, false, SHOW_GROUP_ADMIN, true);
     $memberList = array();
     foreach ($members as $member) {
         if ($member->id == $my->id || in_array($member->id, $userids)) {
             continue;
             //exclude myself and those who already attending
         }
         $memberList[] = $member->id;
     }
     //calculate pending group list
     $results = CUserHelper::filterUserByName($memberList, $namePrefix, $limitstart, $limit);
     $memberList = $results['users'];
     $invitation = JTable::getInstance('Invitation', 'CTable');
     $invitation->load($callback, $cid);
     $tmpl = new CTemplate();
     $tmpl->set('friends', $memberList)->set('selected', $invitation->getInvitedUsers());
     $html = $tmpl->fetch('ajax.friend.list.events');
     $loadedFriend = $limitstart + count($memberList);
     if ($results['total'] > $loadedFriend) {
         //update limitstart
         $limitstart = $limitstart + count($memberList);
         $moreCount = $results['total'] - $loadedFriend;
         //load more option
         $loadMore = '<a onClick="joms.friends.loadMoreFriend(\'' . $callback . '\',\'' . $cid . '\',\'' . $limitstart . '\',\'' . $limit . '\');" href="javascript:void(0)">' . JText::_('COM_COMMUNITY_INVITE_LOAD_MORE') . '(' . $moreCount . ') </a>';
     } else {
         //nothing to load
         $loadMore = '';
     }
     $json = array('html' => $html, 'loadMore' => $loadMore ? true : false, 'moreCount' => isset($moreCount) ? $moreCount : 0);
     die(json_encode($json));
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:55,代码来源:system.php


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