本文整理匯總了PHP中member::getMemberByIds方法的典型用法代碼示例。如果您正苦於以下問題:PHP member::getMemberByIds方法的具體用法?PHP member::getMemberByIds怎麽用?PHP member::getMemberByIds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類member
的用法示例。
在下文中一共展示了member::getMemberByIds方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_member_info
/**
*
* Enter description here ...
* 獲取會員信息
* @param unknown_type $member_id 會員ids
*/
private function get_member_info($member_id = array())
{
if (is_array($member_id)) {
if ($member_id[0]) {
$mem_ids = array_keys($member_id[0]);
//老會員
}
if ($member_id[1]) {
$mem_new_ids = array_keys($member_id[1]);
//新會員
}
}
if ($mem_new_ids) {
if (is_array($mem_new_ids)) {
$member_ids = implode(',', $mem_new_ids);
}
if ($member_ids) {
$this->create_curl_obj('members');
$params['member_id'] = $member_ids;
$params['a'] = 'show';
$params['r'] = 'member';
$member_new_infos = $this->get_common_datas($params);
if ($member_new_infos) {
foreach ($member_new_infos as $k => $v) {
$mem_info = array();
$mem_info['id'] = $v['member_id'];
//對手機用戶名做處理
if (is_numeric($v['nick_name']) && strlen($v['nick_name']) == 11) {
$v['nick_name'] = str_replace(substr($v['nick_name'], 3, 4), '****', $v['nick_name']);
}
$mem_info['nick_name'] = $v['nick_name'];
$mem_info['avatar']['host'] = $v['avatar']['host'];
$mem_info['avatar']['dir'] = $v['avatar']['dir'];
$mem_info['avatar']['filepath'] = $v['avatar']['filepath'];
$mem_info['avatar']['filename'] = $v['avatar']['filename'];
$mem_infos[$v['member_id']] = $mem_info;
}
}
$member_info[1] = $mem_infos;
}
}
if ($mem_ids) {
if (is_array($mem_ids)) {
$member_ids = implode(',', $mem_ids);
}
include_once ROOT_PATH . 'lib/class/member.class.php';
$member = new member();
$member_infos = $member->getMemberByIds($member_ids);
$member_info[0] = $member_infos[0];
}
return $member_info;
}
示例2: show
public function show()
{
$this->verify_content_prms(array('_action' => 'manage'));
$offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
$count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 10;
$limit = " limit {$offset}, {$count}";
$orders = array('id');
$descasc = strtoupper($this->input['hgupdn']);
if ($descasc != 'ASC') {
$descasc = 'DESC';
}
if (in_array($this->input['hgorder'], $orders)) {
$orderby = ' ORDER BY ' . $this->input['hgorder'] . ' ' . $descasc;
} else {
$orderby = ' ORDER BY m.order_id ' . $descasc;
}
$condition = $this->get_condition();
$field = ' m.id,m.title,m.content_url,m.app_uniqueid,m.mod_uniqueid,m.userid,m.username,m.member_id,m.author,m.pub_time,m.ip,m.ip_info,m.state,m.content,m.useful,m.yawp,m.contentid,m.cmid,m.appname,m.order_id,m.content_title,m.last_reply,n.name as groupname ';
$join = ' LEFT JOIN ' . DB_PREFIX . 'message_node n ON m.groupid = n.id ';
$mes = new Message();
$res = $mes->show($field, $condition, $orderby, $limit, $join);
//需要會員信息
$need_member_info = intval($this->input['need_member_info']);
if (is_array($res) && count($res)) {
$cmid = array();
$member_id = array();
//獲取有多少內容發布後id
foreach ($res as $key => $val) {
//抓取會員id
if ($need_member_info && $val['member_id']) {
$member_id[$val['member_id']] = 1;
}
//獲取發布id
if ($val['cmid']) {
$cmid['app'][$val['cmid']] = 0;
} else {
//欄目
if ($val['app_uniqueid'] == 'column' && $val['mod_uniqueid'] == 'column') {
$cmid['column'][$val['contentid']] = 1;
}
}
}
//獲取會員信息
if ($need_member_info && $member_id) {
include_once ROOT_PATH . 'lib/class/member.class.php';
$member = new member();
$mem_ids = array_keys($member_id);
$member_id = implode(',', $mem_ids);
$member_info = $member->getMemberByIds($member_id);
$member_info = $member_info[0];
}
//查詢每個發布內容的標題
if (count($cmid)) {
$arr = array();
foreach ($cmid as $key => $val) {
foreach ($val as $k => $v) {
if ($key == 'app') {
$r = $mes->get_publish_content($k);
$v = trim($this->input['content_title']);
$arr['app'][$k] = $v;
} else {
if ($key == 'column') {
$r = $mes->get_publish_content($k, $v);
$v = trim($this->input['content_title']);
$arr['column'][$k] = $v;
}
}
}
}
}
//整合輸出內容
foreach ($res as $k => $v) {
//添加內容標題
if (count($arr)) {
if ($v['cmid']) {
foreach ($arr['app'] as $kk => $vv) {
if ($kk == $v['cmid']) {
$v['content_title'] = $vv;
}
}
} else {
if ($v['contentid'] && $v['app_uniqueid'] == 'column') {
if ($arr['column']) {
foreach ($arr['column'] as $kk => $vv) {
if ($kk == $v['contentid']) {
$v['content_title'] = $vv;
}
}
}
}
}
}
$v['status'] = $v['state'];
//狀態判斷
if ($v['state'] == '1') {
$v['state'] = '已審核';
} else {
if ($v['state'] == '2') {
$v['state'] = '已打回';
} else {
//.........這裏部分代碼省略.........