function friendjoingroup($mid) { import("ORG.Util.Page"); $cond = ''; $group = array(); $friendlist = getfriendlist($mid); //放入缓存当中 if (!empty($friendlist) && is_array($friendlist)) { $in = 'uid IN ' . render_in($friendlist, 'fuid'); $count = D('Member')->field('count(distinct(gid)) AS count')->where($in)->find(); //显示分页总数 if ($count['count'] == 0) { return ''; } $p = new Page($count['count'], 10); $friendgroup = D('Member')->field('gid')->where($in)->group('gid')->limit($p->firstRow . ',' . $p->listRows)->findAll(); //获取数据 foreach ($friendgroup as $k => $v) { $group[$v['gid']] = D('Member')->where($in . " AND gid=" . $v['gid'])->findAll(); //循环显示朋友 $group[$v['gid']]['c'] = D('Member')->where($in . " AND gid=" . $v['gid'])->count(); } return array($group, $p->show()); } return false; }
$username=$this->username; $userid=$this->userid; $albumname=$this->albumname; $tagrows=$this->tagrows; $Itemid=AwdwallHelperUser::getComItemId(); $pid=$_REQUEST['pid']; $wallversion=checkversionwall(); $db =& JFactory :: getDBO(); $user =& JFactory::getUser(); $photorow=$this->photorow; $next=$this->nextR; $prev=$this->prevR; $totalRecord=$this->totRecord; $curPosition=$this->curPosition; $totalcommentrows=$this->totalcommentrows; $friendstr=getfriendlist(); $pendingFriends = JsLib::getPendingFriends($user->id); $groupsUrl=JRoute::_('index.php?option=com_awdwall&task=groups&Itemid=' . $Itemid, false); if($wallversion=='cb') { $friendJsUrl = JRoute::_('index.php?option=com_awdwall&task=friends&Itemid=' . $Itemid, false); $accountUrl=JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='******'&Itemid=' . AwdwallHelperUser::getJsItemId(), false); } elseif($wallversion=='js') { $friendJsUrl = JRoute::_('index.php?option=com_community&view=friends&userid=' . $user->id . '&Itemid=' . $Itemid,false); $accountUrl=JRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id . '&Itemid=' . $Itemid, false); } else { $friendJsUrl = JRoute::_('index.php?option=com_awdwall&task=friends&Itemid=' . $Itemid, false);