public function dolist() { global $_GPC, $_W; checklogin(); $weid = intval($_W['weid']); if (checksubmit('verify') && !empty($_GPC['select'])) { pdo_update('message_list', array('isshow' => 1, 'create_time' => TIMESTAMP), " id IN ('" . implode("','", $_GPC['select']) . "')"); message('审核成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page']))); } if (checksubmit('delete') && !empty($_GPC['select'])) { pdo_delete('message_list', " id IN ('" . implode("','", $_GPC['select']) . "')"); message('删除成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page']))); } $isshow = isset($_GPC['isshow']) ? intval($_GPC['isshow']) : 0; $pindex = max(1, intval($_GPC['page'])); $psize = 20; $message = pdo_fetch("SELECT id, isshow, weid FROM " . tablename('message_reply') . " WHERE weid = '{$weid}' LIMIT 1"); $list = pdo_fetchall("SELECT * FROM " . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}' ORDER BY create_time DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}"); if (!empty($list)) { $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}'"); $pager = pagination($total, $pindex, $psize); foreach ($list as &$row) { $row['content'] = emotion($row['content']); $userids[] = $row['from_user']; } unset($row); } include $this->template('list'); }
/** * 格式化输出微信墙信息 * @param $list 消息集合 * @return boolean */ public function formatMsg(&$list) { global $_W; if (empty($list)) { return false; } foreach ($list as &$row) { if ($row['type'] == 'image') { $row['content'] = '<img src="' . tomedia($row['content']) . '" target="_blank" />'; } elseif ($row['type'] == 'txwall') { $content = iunserializer($row['content']); $row['content'] = $content['content']; $row['avatar'] = $content['avatar']; $row['nickname'] = $content['nickname']; } $row['content'] = emotion($row['content'], '48px'); // 获取粉丝信息 if ($row['type'] != 'txwall') { $sql = 'SELECT `nickname` FROM ' . tablename('mc_mapping_fans') . ' WHERE `openid` = :openid'; $params = array(':openid' => $row['from_user']); $row['nickname'] = pdo_fetchcolumn($sql, $params); $sql = 'SELECT `avatar` FROM ' . tablename('wxwall_members') . ' WHERE `from_user` = :openid'; $row['avatar'] = pdo_fetchcolumn($sql, $params); } } unset($row); }
public function doWebMessage() { global $_GPC, $_W; $op = trim($_GPC['op']) ? trim($_GPC['op']) : 'list'; if ($op == 'list') { $isshow = isset($_GPC['isshow']) ? intval($_GPC['isshow']) : '2'; $pindex = max(1, intval($_GPC['page'])); $psize = 20; if ($isshow == '2') { //==2表示显示全部 $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('we7car_message_list') . " WHERE weid = :weid AND fid = 0", array(':weid' => $_W['uniacid'])); $list = pdo_fetchall("SELECT * FROM " . tablename('we7car_message_list') . " WHERE weid = :weid AND fid = 0 ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}", array(':weid' => $_W['uniacid'])); } else { $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('we7car_message_list') . " WHERE weid = :weid AND isshow = :isshow AND fid = 0", array(':weid' => $_W['uniacid'], ':isshow' => $isshow)); $list = pdo_fetchall("SELECT * FROM " . tablename('we7car_message_list') . " WHERE weid = :weid AND isshow = :isshow AND fid = 0 ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}", array(':weid' => $_W['uniacid'], ':isshow' => $isshow)); } $pager = pagination($total, $pindex, $psize); $message = pdo_fetch("SELECT id, isshow, weid FROM " . tablename('we7car_message_set') . " WHERE weid = '{$weid}' LIMIT 1"); if (!empty($list)) { foreach ($list as &$row) { $row['content'] = emotion($row['content']); $row['reply'] = pdo_fetchall("SELECT * FROM " . tablename('we7car_message_list') . " WHERE weid = :weid AND fid = :fid ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}", array(':weid' => $_W['uniacid'], ':fid' => $row['id'])); unset($row); } } if (checksubmit('delete') && (!empty($_GPC['select']) || !empty($_GPC['select1']))) { if (!empty($_GPC['select'])) { pdo_delete('we7car_message_list', " fid IN ('" . implode("','", $_GPC['select']) . "')"); pdo_delete('we7car_message_list', " id IN ('" . implode("','", $_GPC['select']) . "')"); } if (!empty($_GPC['select1'])) { pdo_delete('we7car_message_list', " id IN ('" . implode("','", $_GPC['select1']) . "')"); } message('删除成功!', $this->createWebUrl('message', array('weid' => $weid, 'page' => $_GPC['page'], 'isshow' => $_GPC['isshow']))); } if (checksubmit('verify') && (!empty($_GPC['select']) || !empty($_GPC['select1']))) { $isshow = intval($_GPC['isshow']); if (!empty($_GPC['select'])) { pdo_update('we7car_message_list', array('isshow' => $isshow), " id IN ('" . implode("','", $_GPC['select']) . "')"); } if (!empty($_GPC['select1'])) { pdo_update('we7car_message_list', array('isshow' => $isshow), " id IN ('" . implode("','", $_GPC['select1']) . "')"); } message('审核成功!', $this->createWebUrl('message', array('weid' => $weid, 'page' => $_GPC['page'], 'isshow' => $_GPC['isshow']))); } include $this->template('web/message_list'); } if ($op == 'set') { if (checksubmit('submit')) { $id = intval($_GPC['id']); $title = !empty($_GPC['title']) ? trim($_GPC['title']) : message('请填写意见反馈的显示名称'); $thumb = !empty($_GPC['thumb']) ? trim($_GPC['thumb']) : message('请上传意见反馈的头部图片'); //保存数据 $insert = array('weid' => $_W['uniacid'], 'title' => $title, 'thumb' => $thumb, 'status' => intval($_GPC['status']), 'isshow' => intval($_GPC['isshow']), 'create_time' => TIMESTAMP); if ($id == 0) { $temp = pdo_insert('we7car_message_set', $insert); } else { $temp = pdo_update('we7car_message_set', $insert, array('id' => $id)); } if ($temp == false) { message('抱歉,更新设置数据失败!', '', 'error'); } else { message('更新设置数据成功!', $this->createWebUrl('message', array('op' => 'set', 'weid' => $_W['uniacid'])), 'success'); } } $theone = pdo_fetch("SELECT * FROM " . tablename('we7car_message_set') . " WHERE weid = :weid ", array(':weid' => $_W['uniacid'])); //数据为空,赋值 if (empty($theone)) { $theone = array('status' => 1, 'isshow' => 1); } include $this->template('web/message_set'); } }
if ($da['flag'] == 2) { if ($da['msgtype'] == 'text') { $str .= tpl_chats_log(emotion($da['content']), $da['createtime']); } elseif ($da['msgtype'] == 'image') { $content = '<a href="' . $da['content'] . '" target="_blank"><img src="' . $da['content'] . '" width="200"></a>'; $str .= tpl_chats_log($content, $da['createtime']); } elseif ($da['msgtype'] == 'link') { $content = '<a href="' . $da['content'] . '" target="_blank">' . $da['content'] . '</a>'; $str .= tpl_chats_log($content, $da['createtime']); } elseif ($da['msgtype'] == 'location') { $content = '<a target="_blank" href="http://st.map.soso.com/api?size=800*600¢er=' . $da['content']['location_y'] . ',' . $da['content']['location_x'] . '&zoom=' . $da['content']['scale'] . '&markers=' . $da['content']['location_y'] . ',' . $da['content']['location_x'] . '"><img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAcEBAQFBAcFBQcKBwUHCgwJBwcJDA0LCwwLCw0RDQ0NDQ0NEQ0PEBEQDw0UFBYWFBQeHR0dHiIiIiIiIiIiIiL/2wBDAQgHBw0MDRgQEBgaFREVGiAgICAgICAgICAgICAhICAgICAgISEhICAgISEhISEhISEiIiIiIiIiIiIiIiIiIiL/wAARCABvAMgDAREAAhEBAxEB/8QAHAABAAEFAQEAAAAAAAAAAAAAAAMBAgQFBgcI/8QATBAAAAUBAwYICQkGBQUAAAAAAAECAwQRBQYSExQhIjFRBzJBUlSRktIVFyNTYXGToaMWJDM0N0JicoF0g7Gys9FDY3OCwQglNUTh/8QAGgEBAAMBAQEAAAAAAAAAAAAAAAECAwUGBP/EADARAAIBAgMHBAEEAgMAAAAAAAABAgMRExRSBBIhMVFhkQUyQXEiIzRCgTOhscHx/9oADAMBAAIRAxEAPwD3yfPzeiElVZ+4UnOxWUrGF4Wmb09QyxGU32PC03enqDEY32PC03enqDEY32PC03enqDEY32PC03enqDEY32PC03enqDEY32WuWxOS2pRGmpEZ7BWdaSi32JjK7MVF4rTNEUzNFXTIl6voHC2T1ivOpGLtZ9jpV9mhGDa+DLVbE0kmdU6C3D0CqM5m+ZVoT5D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{ $str .= tpl_chats_log(emotion($da['content']['content']), $da['createtime'], 1); } elseif ($da['msgtype'] == 'image') { $image = media2local($da['content']['media_id']); $content = '<a href="' . $image . '" target="_blank"><img src="' . $image . '" width="200"></a>'; $str .= tpl_chats_log($content, $da['createtime'], 1); } elseif ($da['msgtype'] == 'voice') { $image = media2local($da['content']['media_id']); $content = '<a href="' . $image . '" target="_blank"><i class="fa fa-bullhorn"></i> 语音消息</a>'; $str .= tpl_chats_log($content, $da['createtime'], 1); } elseif ($da['msgtype'] == 'music') { $music = tomedia($da['content']['hqmusicurl']); if (empty($music)) { $music = tomedia($da['content']['musicurl']); } $content = '<a href="' . $music . '" target="_blank"><i class="fa fa-music"></i> 音乐消息</a>'; $str .= tpl_chats_log($content, $da['createtime'], 1);
public function doWebHistory() { global $_W, $_GPC; $where = ''; $starttime = empty($_GPC['start']) ? strtotime(date('Y-m-d')) : strtotime($_GPC['start']); $endtime = empty($_GPC['end']) ? TIMESTAMP : strtotime($_GPC['end']) + 86399; $where .= " AND createtime >= '{$starttime}' AND createtime < '{$endtime}'"; !empty($_GPC['keyword']) && ($where .= " AND message LIKE '%{$_GPC['keyword']}%'"); switch ($_GPC['searchtype']) { case 'default': $where .= " AND module = 'default'"; break; case 'rule': default: $where .= " AND module <> 'default'"; break; } $pindex = max(1, intval($_GPC['page'])); $psize = 50; $list = pdo_fetchall("SELECT * FROM " . tablename('stat_msg_history') . " WHERE weid = '{$_W['weid']}' {$where} ORDER BY createtime DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize); if (!empty($list)) { foreach ($list as $index => &$history) { if ($history['type'] == 'link') { $history['message'] = iunserializer($history['message']); $history['message'] = '<a href="' . $history['message']['link'] . '" target="_blank" title="' . $history['message']['description'] . '">' . $history['message']['title'] . '</a>'; } elseif ($history['type'] == 'image') { $history['message'] = '<a href="' . $history['message'] . '" target="_blank">查看图片</a>'; } elseif ($history['type'] == 'location') { $history['message'] = iunserializer($history['message']); $history['message'] = '<a href="http://st.map.soso.com/api?size=800*600¢er=' . $history['message']['y'] . ',' . $history['message']['x'] . '&zoom=16&markers=' . $history['message']['y'] . ',' . $history['message']['x'] . ',1" target="_blank">查看方位</a>'; } else { $history['message'] = emotion($history['message']); } if (!empty($history['rid'])) { $rids[$history['rid']] = $history['rid']; } } } if (!empty($rids)) { $rules = pdo_fetchall("SELECT name, id FROM " . tablename('rule') . " WHERE id IN (" . implode(',', $rids) . ")", array(), 'id'); } $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('stat_msg_history') . " WHERE weid = '{$_W['weid']}' {$where}"); $pager = pagination($total, $pindex, $psize); include $this->template('history'); }
<div class="left" style="width:250px;float:left;">' . $con['title'] . '</div> <div class="right" style="width:60px;float:right;"> <img src="' . $con['thumb_media_id'] . '" style="width:60px;height:50px"alt=""/> </div> </a> </div> </div> </div> </div>'; } } $i++; } } elseif ($data['msgtype'] == 'text') { $html = '<div class="panel panel-default" style="margin-bottom:0"> <div class="panel panel-body">' . emotion($data['content']) . '</div> </div>'; } elseif ($data['msgtype'] == 'image') { $data['content'] = media2local($data['content']); $html = '<div class="panel panel-default" style="margin-bottom:0"> <div class="panel panel-body"><img src="' . $data['content'] . '" style="width:365px;"></div> </div>'; } exit($html); } } } function iurldecode($str) { if (!is_array($str)) { return urldecode($str);
public function doReply() { global $_GPC, $_W; //评论用户ID //$replyid =authcode(base64_decode($_GPC['uid']), 'DECODE'); $replyid = $_GPC['uid'] ? authcode(base64_decode($_GPC['uid']), 'DECODE') : $_W['fans']['from_user']; //被楼中评论的评论用户ID if (empty($_GPC['to_uid'])) { $touid = ''; } else { $touid = $this->doUserinfo($_GPC['to_uid']); } $to_uid = $touid['from_user']; //主题作者ID //$postid =authcode(base64_decode($_GPC['postuid']), 'DECODE'); $pid = $this->doUserinfo($_GPC['postuid']); //print_r($pid);exit; $postid = $pid['from_user']; //主题ID $id = intval($_GPC['id']); //版块规则ID $rid = intval($_GPC['rid']); $sns = pdo_fetch("SELECT id, type, default_tips, send_tips, rule, picture, replycredit,description FROM " . tablename('sns') . " WHERE rid = '{$rid}' LIMIT 1"); $post = pdo_fetch("SELECT * FROM " . tablename('sns_post') . " WHERE post_id= '{$id}' AND is_del='0' LIMIT 1"); if (empty($replyid) || empty($postid) || empty($id) || empty($rid)) { exit('非法参数'); } if (empty($sns)) { $result['status'] = '-1'; $result['message'] = '找不到模块配置参数'; message($result, create_url('mobile/module', array('name' => 'sns', 'do' => 'list', 'id' => $rid, 'from_user' => $replyid)), 'ajax'); exit; } if (empty($post)) { $result['status'] = '-1'; $result['message'] = '未找到你要回复的贴子,请确实贴子ID是否正确'; message($result, create_url('mobile/module', array('name' => 'sns', 'do' => 'list', 'id' => $rid, 'from_user' => $replyid)), 'ajax'); exit; } $fans = $this->doUserinfo($replyid); $result = $this->doPmem($replyid); if ($fans['status'] == '-1') { //message($result, create_url('index/module', array('name' => 'sns', 'do' => 'list', 'id' => intval($_GPC['id']), 'from_user' => $_GPC['from_user'])), 'ajax');} message($fans, create_url('mobile/module', array('name' => 'sns', 'do' => 'list', 'id' => intval($_GPC['id']))), 'ajax'); exit; } if ($result['status'] == '-1') { message($result, create_url('mobile/module', array('name' => 'sns', 'do' => 'list', 'id' => $rid, 'from_user' => $replyid)), 'ajax'); exit; } if ($post['lock'] == 1) { $result['status'] = '-1'; $result['message'] = '此贴已经被锁定。请返回!'; message($result, create_url('mobile/module', array('name' => 'sns', 'do' => 'list', 'id' => $rid, 'from_user' => $replyid)), 'ajax'); exit; } $data = array('post_id' => $_GPC['id'], 'post_uid' => $postid, 'to_reply_id' => $_GPC['to_reply_id'] ? $_GPC['to_reply_id'] : 0, 'uid' => $replyid, 'to_uid' => $to_uid ? $to_uid : 0, 'content' => ihtmlspecialchars(emotion($_GPC['content'])), 'ctime' => TIMESTAMP, 'storey' => $_GPC['storey'], 'weid' => $fans['weid'], 'rid' => $_GPC['rid']); //插入内容开始 if (empty($data['content']) || strlen($data['content']) < 20) { $result['status'] = '-1'; $result['message'] = '请填写您内容!且内容不能小于20个字符!'; message($result, '', 'ajax'); exit; } $data2['credit'] = $fans['credit'] + $sns['replycredit']; $data3['reply_count'] = $post['reply_count'] + 1; $data3['last_reply_time'] = TIMESTAMP; $data3['last_reply_uid'] = $replyid; pdo_insert('sns_reply', $data); pdo_update('fans', $data2, array('from_user' => $replyid)); pdo_update('sns_post', $data3, array('post_id' => $id)); $result = array('status' => 0, 'uid' => $data['uid'], 'to_uid' => $data['to_uid'], 'to_reply_id' => $data['to_reply_id'], 'content' => $data['content'], 'ctime' => date('Y-m-d H:i:s', $data['ctime']), 'storey' => $data['storey'], 'message' => '评论成功!'); message($result, create_url('mobile/module', array('name' => 'sns', 'do' => 'view', 'id' => intval($_GPC['id']), 'rid' => intval($_GPC['rid']), 'from_user' => $replyid)), 'ajax'); exit; }
$history['message'] = emotion($history['message']['original']) ? emotion($history['message']['original']) : emotion($history['message']['content']); } elseif ($history['type'] == 'link') { $history['message'] = iunserializer($history['message']); $history['module'] = empty($history['message']['source']) ? $history['message']['content'] : $history['message']['source']; $history['message'] = '<a href="' . $history['message']['url'] . '" target="_blank" title="' . $history['message']['description'] . '">' . $history['message']['title'] . '</a>'; } elseif ($history['type'] == 'image') { $history['message'] = '<a href="' . url('platform/stat/browser', array('attach' => $history['message'])) . '" class="btn btn-success btn-sm" target="_blank">查看图片</a>'; } elseif ($history['type'] == 'location') { $history['message'] = iunserializer($history['message']); $history['message'] = '<a href="http://st.map.soso.com/api?size=800*600¢er=' . $history['message']['y'] . ',' . $history['message']['x'] . '&zoom=16&markers=' . $history['message']['y'] . ',' . $history['message']['x'] . ',1" target="_blank">查看方位</a>'; } elseif ($history['type'] == 'click') { $history['message'] = emotion($history['message']); } elseif ($history['type'] == 'view') { $history['message'] = '<a href="' . $history['message']['url'] . '" target="_blank">跳转链接</a>'; } else { $history['message'] = emotion($history['message']); } if (!empty($history['rid'])) { $rids[$history['rid']] = $history['rid']; } } } if (!empty($rids)) { $rules = pdo_fetchall("SELECT name, id, module FROM " . tablename('rule') . " WHERE id IN (" . implode(',', $rids) . ")", array(), 'id'); foreach ($rules as $key => &$li) { if ($li['module'] == 'cover') { $cover_reply = pdo_fetch('SELECT module,do FROM ' . tablename('cover_reply') . ' WHERE rid = :rid', array(':rid' => $key)); if (!in_array($cover_reply['module'], array('mc', 'site', 'card'))) { $eid = pdo_fetchcolumn('SELECT eid FROM ' . tablename('modules_bindings') . ' WHERE module = :m AND do = :do AND entry = :entry', array(':m' => $cover_reply['module'], ':do' => $cover_reply['do'], ':entry' => 'cover')); $li['url'] = url('platform/cover/', array('eid' => $eid)); } else {
public function doWebManage() { //消息管理 global $_GPC, $_W; checklogin(); $id = intval($_GPC['id']); if (checksubmit('delete') && !empty($_GPC['select'])) { pdo_delete('stat_msg_history', " id IN ('" . implode("','", $_GPC['select']) . "')"); message('删除成功!', create_url('site/module/manage', array('type' => '3', 'name' => 'kf', 'id' => $id, 'page' => $_GPC['page']))); } $where = ''; $starttime = empty($_GPC['start']) ? strtotime(date('Y-m-d')) : strtotime($_GPC['start']); $endtime = empty($_GPC['end']) ? TIMESTAMP : strtotime($_GPC['end']) + 86399; $where .= " AND createtime >= '{$starttime}' AND createtime < '{$endtime}'"; !empty($_GPC['keyword']) && ($where .= " AND message LIKE '%{$_GPC['keyword']}%'"); if ($_GPC['kf']) { $mod = pdo_fetchall("SELECT name FROM " . tablename('modules') . " ORDER BY mid DESC"); foreach ($mod as $v) { $where .= " AND module <> '" . $v['name'] . "'"; } $where .= $where . "AND module <> 'welcome' AND module <> 'default'"; } else { $where .= " AND module = 'kf' "; } $pindex = max(1, intval($_GPC['page'])); $psize = 50; $list = pdo_fetchall("SELECT * FROM " . tablename('stat_msg_history') . " WHERE weid = '{$_W['weid']}' {$where} ORDER BY createtime DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize); if (!empty($list)) { foreach ($list as $index => &$history) { //增加判断用户是否绑定FID,如果已经绑定就显示用户头像和昵称 $condition = "AND from_user = '******'from_user']}'"; $sql = "SELECT id,nickname,avatar FROM " . tablename('fans') . " WHERE weid = '{$_W['weid']}' {$condition} LIMIT 1 "; //$sql ="SELECT username,fakeid,nickname,avatar FROM " . tablename('wxuser') . " WHERE weid = '{$_W['weid']}' $condition LIMIT 1 "; $wx = pdo_fetch($sql); if ($history['type'] == 'link') { $history['message'] = iunserializer($history['message']); $history['message'] = '<a href="' . $history['message']['link'] . '" target="_blank" title="' . $history['message']['description'] . '">' . $history['message']['title'] . '</a>'; } elseif ($history['type'] == 'image') { $history['message'] = '<a href="' . $history['message'] . '" target="_blank">查看图片</a>'; } elseif ($history['type'] == 'location') { $history['message'] = iunserializer($history['message']); $history['message'] = '<a href="http://st.map.soso.com/api?size=800*600¢er=' . $history['message']['y'] . ',' . $history['message']['x'] . '&zoom=16&markers=' . $history['message']['y'] . ',' . $history['message']['x'] . ',1" target="_blank">查看方位</a>'; } else { $history['message'] = emotion($history['message']); } if (!empty($history['rid'])) { $rids[$history['rid']] = $history['rid']; } if (!empty($wx)) { $history['from_user'] = '******' . create_url('site/module/jdchat', array('name' => 'kf', 'fakeid' => $wx['fakeid'])) . '" title="' . $wx['nickname'] . '"><img width="45px" height="45px" src="' . $_W['attachurl'] . $wx['avatar'] . '" /></a><br />' . $wx['nickname']; } else { $history['from_user'] = '******' . create_url('site/module/pip', array('name' => 'moli', 'id' => $history['id'])) . '" title="' . $history['from_user'] . '">' . $history['from_user'] . '</a>'; } if ($history['type'] == 'wxlkf') { $history['from_user'] = '******' . $history['module'] . '的回复</span>'; } } } $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('stat_msg_history') . " WHERE weid = '{$_W['weid']}' {$where}"); $pager = pagination($total, $pindex, $psize); include $this->template('manage'); }
private function formatMsg(&$list) { global $_W; if (empty($list)) { return false; } $uids = $members = array(); foreach ($list as &$row) { $uids[$row['from_user']] = $row['from_user']; if ($row['type'] == 'link') { $row['content'] = iunserializer($row['content']); $row['content'] = '<a href="' . $row['content']['link'] . '" target="_blank" title="' . $row['content']['description'] . '">' . $row['content']['title'] . '</a>'; } elseif ($row['type'] == 'image') { $row['content'] = '<img src="' . $row['content'] . '" />'; } elseif ($row['type'] == 'txwall') { $content = unserialize($row['content']); $row['content'] = $content['content']; $row['avatar'] = $content['avatar']; $row['nickname'] = $content['nickname']; } $row['content'] = emotion($row['content'], '48px'); } unset($row); if (!empty($uids)) { $members = fans_search($uids, array('nickname', 'avatar')); } if (!empty($members)) { foreach ($list as $index => &$row) { if ($row['type'] == 'txwall') { continue; } $row['nickname'] = $members[$row['from_user']]['nickname']; $row['avatar'] = $members[$row['from_user']]['avatar']; } unset($row); } }
private function formatMsg(&$list) { global $_W; if (empty($list)) { return false; } $uids = $members = array(); foreach ($list as &$row) { $uids[$row['from_user']] = $row['from_user']; if ($row['type'] == 'link') { $row['content'] = iunserializer($row['content']); $row['content'] = '<a href="' . $row['content']['link'] . '" target="_blank" title="' . $row['content']['description'] . '">' . $row['content']['title'] . '</a>'; } elseif ($row['type'] == 'image') { $row['content'] = '<img src="' . $_W['attachurl'] . $row['content'] . '" />'; } $row['content'] = emotion($row['content'], '48px'); } unset($row); if (!empty($uids)) { $members = pdo_fetchall("SELECT nickname, avatar, from_user FROM " . tablename('wxwall_members') . " WHERE from_user IN ('" . implode("','", $uids) . "')", array(), 'from_user'); } if (!empty($members)) { foreach ($list as $index => &$row) { $row['nickname'] = $members[$row['from_user']]['nickname']; $row['avatar'] = $members[$row['from_user']]['avatar']; unset($list[$index]['from_user']); } unset($row); } }