本文整理汇总了PHP中getFromClient函数的典型用法代码示例。如果您正苦于以下问题:PHP getFromClient函数的具体用法?PHP getFromClient怎么用?PHP getFromClient使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getFromClient函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: home_index_left_feedtop
/**
* 主页右钩子
*/
public function home_index_left_feedtop()
{
$list = $this->model('FeedTop')->getFeedTopList(1);
$close_feeds = $_SESSION['feed_top_' . $this->mid];
foreach ($list as $k => $v) {
if (!in_array($v['feed_id'], $close_feeds)) {
$list[$k]['feed_info'] = model('Feed')->get($v['feed_id']);
} else {
unset($list[$k]);
}
}
foreach ($list as &$v) {
switch ($v['feed_info']['app']) {
case 'weiba':
$v['feed_info']['from'] = getFromClient(0, $v['feed_info']['app'], '微吧');
break;
case 'tipoff':
$v['feed_info']['from'] = getFromClient(0, $v['feed_info']['app'], '爆料');
break;
default:
$v['feed_info']['from'] = getFromClient($v['feed_info']['from'], $v['feed_info']['app']);
break;
}
!isset($uids[$v['feed_info']['uid']]) && $v['feed_info']['uid'] != $GLOBALS['ts']['mid'] && ($uids[] = $v['feed_info']['uid']);
}
$this->assign('data', $list);
// 赞微博
$feed_ids = getSubByKey($list, 'feed_id');
$diggArr = model('FeedDigg')->checkIsDigg($feed_ids, $GLOBALS['ts']['mid']);
$this->assign('diggArr', $diggArr);
$this->display('feedtop');
}
开发者ID:lyhiving,项目名称:icampus,代码行数:35,代码来源:FeedTopHooks.class.php
示例2: home_index_left_feedtop
/**
* 主页右钩子
*/
public function home_index_left_feedtop()
{
$list = $this->model('FeedTop')->getFeedTopList(1);
$close_feeds = $_SESSION['feed_top_' . $this->mid];
foreach ($list as $k => $v) {
if (!in_array($v['feed_id'], $close_feeds)) {
$list[$k]['feed_info'] = model('Feed')->get($v['feed_id']);
} else {
unset($list[$k]);
}
}
foreach ($list as $k => &$v) {
if ($v['feed_info']['is_del'] == 1) {
$this->model('FeedTop')->doDel($v['id']);
unset($list[$k]);
continue;
}
switch ($v['feed_info']['app']) {
case 'weiba':
$v['feed_info']['from'] = getFromClient(0, $v['feed_info']['app'], '微吧');
break;
case 'tipoff':
$v['feed_info']['from'] = getFromClient(0, $v['feed_info']['app'], '爆料');
break;
default:
$v['feed_info']['from'] = getFromClient($v['feed_info']['from'], $v['feed_info']['app']);
break;
}
!isset($uids[$v['feed_info']['uid']]) && $v['feed_info']['uid'] != $GLOBALS['ts']['mid'] && ($uids[] = $v['feed_info']['uid']);
}
$this->assign('data', $list);
$cancomment_old_type = array('post', 'repost', 'postimage', 'postfile', 'weiba_post', 'weiba_repost', 'blog_post', 'blog_repost', 'event_post', 'event_repost', 'vote_post', 'vote_repost', 'photo_post', 'photo_repost');
$this->assign('cancomment_old_type', $cancomment_old_type);
$uids = array();
foreach ($list as $item) {
$uids[] = $item['feed_info']['uid'];
}
if (!empty($uids)) {
$map = array();
$map['uid'] = $GLOBALS['ts']['mid'];
$map['fid'] = array('in', $uids);
$followUids = model('Follow')->where($map)->getAsFieldArray('fid');
$this->assign('followUids', $followUids);
$remarkHash = model('Follow')->getRemarkHash($GLOBALS['ts']['mid']);
$this->assign('remarkHash', $remarkHash);
}
// 赞分享
$feed_ids = getSubByKey($list, 'feed_id');
$diggArr = model('FeedDigg')->checkIsDigg($feed_ids, $GLOBALS['ts']['mid']);
$this->assign('diggArr', $diggArr);
$this->display('feedtop');
}
开发者ID:medz,项目名称:thinksns-4,代码行数:55,代码来源:FeedTopHooks.class.php
示例3: detail_cyj
public function detail_cyj()
{
if ($_GET['weibo_id']) {
$data['id'] = intval($_GET['weibo_id']);
} elseif ($_GET['id']) {
$data['id'] = intval($_GET['id']);
}
$detail = api('WeiboStatuses')->data($data)->show();
$detail['userGroupData'] = $this->_usergroup($detail['uid']);
$map['source_id'] = $data['id'];
$map['uid'] = $this->mid;
$detail['iscoll']['colled'] = model('Collection')->where($map)->count() ? 1 : 0;
$detail['favorited'] = $detail['iscoll']['colled'];
// $detail['is_favorite'] = api('Favorites')->data($data)->isFavorite() ? 1 : 0;
// $detail['content'] = wapFormatContent($detail['content'], false, urlencode($this->_self_url));
// $detail = $this->__formatByContent($detail);
// optimize data
if (($detail['type'] === 'repost' && $detail['api_source']['is_del'] === '0' || $detail['type'] === 'repost' && $detail['transpond_data']['api_source']['is_del'] === '0') && isset($detail['transpond_data']['feed_content'])) {
switch ($detail['transpond_data']['type']) {
case 'postimage':
$detail['type'] = 'repost-postimage';
break;
case 'postfile':
$detail['type'] = 'repost-postfile';
foreach ($detail['transpond_data']['attach'] as $k => $v) {
if ($v['size'] > 1024 && $v['size'] < 1024 * 1024) {
$detail['transpond_data']['attach'][$k]['size'] = round($v['size'] / 1024, 2) . 'K';
} else {
if ($v['size'] < 1024) {
$detail['transpond_data']['attach'][$k]['size'] .= 'B';
} else {
$detail['transpond_data']['attach'][$k]['size'] = round($v['size'] / 1024 / 1024, 2) . 'M';
}
}
}
break;
case 'postvideo':
$detail['type'] = 'repost-postvideo';
break;
}
} else {
if (($detail['api_source']['is_del'] === '1' || $detail['transpond_data']['api_source']['is_del'] === '1') && $detail['type'] === 'repost') {
$detail['type'] = 'repost-removed';
} else {
if ($detail['type'] === 'postfile') {
foreach ($detail['attach'] as $k => $v) {
if ($v['size'] > 1024 && $v['size'] < 1024 * 1024) {
$detail['attach'][$k]['size'] = round($v['size'] / 1024, 2) . 'K';
} else {
if ($v['size'] < 1024) {
$detail['attach'][$k]['size'] .= 'B';
} else {
$detail['attach'][$k]['size'] = round($v['size'] / 1024 / 1024, 2) . 'M';
}
}
}
} else {
if ($detail['type'] === 'weiba_repost') {
if ($detail['api_source']['is_del'] === '1' || $detail['transpond_data']['is_del'] === '1') {
$detail['type'] = 'weiba_repost-removed';
}
}
}
}
}
$detail['from'] = getFromClient($detail['from'], $detail['app']);
if ($detail['type'] == 'postvideo') {
// $weibolist[$k]['content'] = $v['source_body'];
$detail['content'] = $detail['feed_content'] ? $detail['feed_content'] : $detail['source_body'];
$detail['content'] = wapDetailCYJContent($detail['content'], true, $self_url, "视频");
} else {
$detail['content'] = wapDetailCYJContent($detail['content'], true, $self_url);
}
// 非视频分享
if ($detail['transpond_data']['content']) {
if (strpos($weibolist[$k]['type'], 'video')) {
$detail['transpond_data']['content'] = wapDetailCYJContent($detail['transpond_data']['content'], true, $self_url, "视频");
} else {
$detail['transpond_data']['content'] = wapDetailCYJContent($detail['transpond_data']['content'], true, $self_url);
}
}
// 转发分享标志
$detail['repost'] = $detail['app_row_id'];
// 如果是转发,看是否有评论当前用户的权限
$privacy1 = $this->privacy($detail['uid']);
$detail['cancomment_current'] = 0;
if ($privacy1 === true || $privacy1['comment_weibo'] == 0) {
$detail['cancomment_current'] = 1;
}
// 判断是否有评论作者或原文作者权限
$origin_uid = $detail['api_source']['uid'] ? $detail['api_source']['uid'] : 0;
$detail['cancomment'] = 0;
// 如果是转发,判断是否有评论给原作者的权限
if ($origin_uid && $origin_uid != $this->mid) {
$privacy = $this->privacy($origin_uid);
if ($privacy === true || $privacy['comment_weibo'] == 0) {
$detail['cancomment'] = 1;
}
}
$this->assign('feed', $detail);
//.........这里部分代码省略.........
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:101,代码来源:IndexAction.class.php
示例4: searchFeeds
/**
* 数据库搜索微博
* @param string $key 关键字
* @param string $type 微博类型,post、repost、postimage、postfile
* @param integer $limit 结果集数目
* @param boolean $forApi 是否返回API数据,默认为false
* @return array 搜索后的微博数据
*/
public function searchFeeds($key, $feed_type, $limit, $Stime, $Etime)
{
$map['a.is_del'] = 0;
$map['a.is_audit'] = 1;
$map['b.feed_content'] = array('LIKE', '%' . t($key) . '%');
if ($feed_type) {
$map['a.type'] = $feed_type;
if ($map['a.type'] == 'post') {
unset($map['a.type']);
$map['a.is_repost'] = 0;
}
}
if ($Stime && $Etime) {
$map['a.publish_time'] = array('between', array($Stime, $Etime));
}
$table = "{$this->tablePrefix}feed AS a LEFT JOIN {$this->tablePrefix}feed_data AS b ON a.feed_id = b.feed_id";
$feedlist = $this->table($table)->field('a.feed_id')->where($map)->order('a.publish_time DESC')->findPage($limit);
//return D()->getLastSql();exit;
$feed_ids = getSubByKey($feedlist['data'], 'feed_id');
$feedlist['data'] = $this->getFeeds($feed_ids);
foreach ($feedlist['data'] as &$v) {
switch ($v['app']) {
case 'weiba':
$v['from'] = getFromClient(0, $v['app'], '微吧');
break;
default:
$v['from'] = getFromClient($v['from'], $v['app']);
break;
}
!isset($uids[$v['uid']]) && $v['uid'] != $GLOBALS['ts']['mid'] && ($uids[] = $v['uid']);
}
return $feedlist;
}
开发者ID:yang7hua,项目名称:hunshe,代码行数:41,代码来源:FeedModel.class.php
示例5: PostFeed
/**
* 发布微博操作,用于AJAX
* @return json 发布微博后的结果信息JSON数据
*/
public function PostFeed()
{
// 返回数据格式
$return = array('status' => 1, 'data' => '');
// 用户发送内容
$d['content'] = isset($_POST['content']) ? filter_keyword(h($_POST['content'])) : '';
// 原始数据内容
$d['body'] = filter_keyword($_POST['body']);
//$this->success($d['body']);//测试
// 安全过滤
foreach ($_POST as $key => $val) {
$_POST[$key] = t($_POST[$key]);
}
$d['source_url'] = urldecode($_POST['source_url']);
//应用分享到微博,原资源链接
// 滤掉话题两端的空白
$d['body'] = preg_replace("/#[\\s]*([^#^\\s][^#]*[^#^\\s])[\\s]*#/is", '#' . trim("\${1}") . '#', $d['body']);
// 附件信息
$d['attach_id'] = trim(t($_POST['attach_id']), "|");
if (!empty($d['attach_id'])) {
$d['attach_id'] = explode('|', $d['attach_id']);
array_map('intval', $d['attach_id']);
}
// 发送微博的类型
$type = t($_POST['type']);
// 所属应用名称
$app = isset($_POST['app_name']) ? t($_POST['app_name']) : APP_NAME;
// 当前动态产生所属的应用
if (!($data = model('Feed')->put($this->uid, $app, $type, $d))) {
$return = array('status' => 0, 'data' => model('Feed')->getError());
exit(json_encode($return));
}
// 发布邮件之后添加积分
model('Credit')->setUserCredit($this->uid, 'add_weibo');
// 微博来源设置
$data['from'] = getFromClient($data['from'], $data['app']);
$this->assign($data);
// 微博配置
$weiboSet = model('Xdata')->get('admin_Config:feed');
$this->assign('weibo_premission', $weiboSet['weibo_premission']);
$return['data'] = $this->fetch();
// 微博ID
$return['feedId'] = $data['feed_id'];
$return['is_audit'] = $data['is_audit'];
// 添加话题
model('FeedTopic')->addTopic(html_entity_decode($d['body'], ENT_QUOTES, 'UTF-8'), $data['feed_id'], $type);
// 更新用户最后发表的微博
$last['last_feed_id'] = $data['feed_id'];
$last['last_post_time'] = $_SERVER['REQUEST_TIME'];
model('User')->where('uid=' . $this->uid)->save($last);
$isOpenChannel = model('App')->isAppNameOpen('channel');
if (!$isOpenChannel) {
exit(json_encode($return));
}
// 添加微博到投稿数据中
$channelId = t($_POST['channel_id']);
// 绑定用户
$bindUserChannel = D('Channel', 'channel')->getCategoryByUserBind($this->mid);
if (!empty($bindUserChannel)) {
$channelId = array_merge($bindUserChannel, explode(',', $channelId));
$channelId = array_filter($channelId);
$channelId = array_unique($channelId);
$channelId = implode(',', $channelId);
}
// 绑定话题
$content = html_entity_decode($d['body'], ENT_QUOTES, 'UTF-8');
$content = str_replace("#", "#", $content);
preg_match_all("/#([^#]*[^#^\\s][^#]*)#/is", $content, $topics);
$topics = array_unique($topics[1]);
foreach ($topics as &$topic) {
$topic = trim(preg_replace("/#/", '', t($topic)));
}
$bindTopicChannel = D('Channel', 'channel')->getCategoryByTopicBind($topics);
if (!empty($bindTopicChannel)) {
$channelId = array_merge($bindTopicChannel, explode(',', $channelId));
$channelId = array_filter($channelId);
$channelId = array_unique($channelId);
$channelId = implode(',', $channelId);
}
if (!empty($channelId)) {
// 获取后台配置数据
$channelConf = model('Xdata')->get('channel_Admin:index');
$return['is_audit_channel'] = $channelConf['is_audit'];
// 添加频道数据
D('Channel', 'channel')->setChannel($data['feed_id'], $channelId, false);
}
exit(json_encode($return));
}
开发者ID:lyhiving,项目名称:icampus,代码行数:92,代码来源:FeedAction.class.php
示例6: constant
<?php
if ($sourceInfo["feedType"] == "post") {
?>
<div class="feed_txt feed_txt_default">
<?php
echo constant(" 转发原文 *");
?>
<span class="source_info"><?php
echo $sourceInfo['source_user_info']['space_link'];
?>
<em> <?php
echo friendlydate($sourceInfo['publish_time']);
?>
<!-- <?php
echo getFromClient($sourceInfo['from']);
?>
--></em></span>
<p class="txt-mt" onclick="core.weibo.clickRepost(this);" href="<?php
echo U('public/Profile/feed', array('uid' => $sourceInfo['uid'], 'feed_id' => $sourceInfo['feed_id']));
?>
"><?php
echo msubstr(t($sourceInfo['source_content']), 0, 128);
?>
</p>
</div><?php
}
?>
<?php
}
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:30,代码来源:public_d5630e8495232f98.php
示例7: getCommentList
/**
* 获取评论列表,已在后台被使用
* @param array $map 查询条件
* @param string $order 排序条件,默认为comment_id ASC
* @param integer $limit 结果集数目,默认为10
* @param boolean $isReply 是否显示回复信息
* @return array 评论列表信息
*/
public function getCommentList($map = null, $order = 'comment_id ASC', $limit = 10, $isReply = false)
{
!$map['app'] && $this->_app && ($map['app'] = $this->_app);
!$map['table'] && $this->_app_table && ($map['table'] = $this->_app_table);
!isset($map['is_del']) && ($map['is_del'] = 0);
$data = $this->where($map)->order($order)->findPage($limit);
// dump($data);exit;
foreach ($data['data'] as $k => &$v) {
if (!empty($v['to_comment_id']) && $isReply) {
$replyInfo = $this->getCommentInfo($v['to_comment_id'], false);
$v['replyInfo'] = '//@{uid=' . $replyInfo['user_info']['uid'] . '|' . $replyInfo['user_info']['uname'] . '}:' . $replyInfo['content'];
}
$v['user_info'] = model('User')->getUserInfo($v['uid']);
$groupData = static_cache('groupdata' . $v['uid']);
if (!$groupData) {
$groupData = model('UserGroupLink')->getUserGroupData($v['uid']);
if (!$groupData) {
$groupData = 1;
}
static_cache('groupdata' . $v['uid'], $groupData);
}
$v['user_info']['groupData'] = $groupData;
//获取用户组信息
$v['content'] = parse_html($v['content'] . $v['replyInfo']);
$v['content'] = formatEmoji(false, $v['content']);
// 解析emoji
$v['sourceInfo'] = model('Source')->getCommentSource($v);
//$v['data'] = unserialize($v['data']);
$order = strtolower($order);
if (strpos($order, 'desc')) {
$v['storey'] = $data['count'] - $k - ($data['nowPage'] - 1) * $limit;
} else {
$v['storey'] = $k + 1 + ($data['nowPage'] - 1) * $limit;
}
$v['client_type'] = getFromClient($v['client_type'], $v['app']);
}
return $data;
}
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:46,代码来源:CommentModel.class.php
示例8: feed
/**
* 获取指定用户的某条动态
*
* @return void
*/
public function feed()
{
$feed_id = intval($_GET['feed_id']);
if (empty($feed_id)) {
$this->error(L('PUBLIC_INFO_ALREADY_DELETE_TIPS'));
}
//获取微博信息
$feedInfo = model('Feed')->get($feed_id);
if (!$feedInfo) {
$this->error('该微博不存在或已被删除');
exit;
}
if ($feedInfo['is_audit'] == '0' && $feedInfo['uid'] != $this->mid) {
$this->error('此微博正在审核');
exit;
}
if ($feedInfo['is_del'] == '1') {
$this->error(L('PUBLIC_NO_RELATE_WEIBO'));
exit;
}
// 获取用户信息
$user_info = model('User')->getUserInfo($feedInfo['uid']);
// 赞功能
$diggArr = model('FeedDigg')->checkIsDigg($feed_id, $this->mid);
$data['diggArr'] = $diggArr;
// 判断隐私设置
$userPrivacy = $this->privacy($this->uid);
$data['userPrivacy'] = $userPrivacy;
if ($userPrivacy['space'] !== 1) {
$weiboSet = model('Xdata')->get('admin_Config:feed');
$a['initNums'] = $weiboSet['weibo_nums'];
$a['weibo_type'] = $weiboSet['weibo_type'];
$a['weibo_premission'] = $weiboSet['weibo_premission'];
switch ($feedInfo['app']) {
case 'weiba':
$feedInfo['from'] = getFromClient(0, $feedInfo['app'], '微吧');
break;
default:
$feedInfo['from'] = getFromClient($from, $feedInfo['app']);
break;
}
$data['check'] = $a;
$data['feedInfo'] = $feedInfo;
return $data;
} else {
return $this->_assignUserInfo($this->uid);
}
}
开发者ID:CaliProject,项目名称:thinksns,代码行数:53,代码来源:BeautifyCenterHooks.class.php
示例9: messageContent
/**
* 消息弹出层内容获取
*/
public function messageContent($type)
{
if (!$type) {
$type = t(empty($_POST['type']) ? $_GET['type'] : $_POST['type']);
}
$_POST['type'] = $type;
switch ($type) {
// @我的
case 'at':
// 获取未读@Me的条数
$this->assign('unread_atme_count', model('UserData')->where('uid=' . $this->mid . " and `key`='unread_atme'")->getField('value'));
// 拼装查询条件
$map['uid'] = $this->mid;
$d['tab'] = model('Atme')->getTab(null);
foreach ($d['tab'] as $key => $vo) {
if ($key == 'feed') {
$d['tabHash']['feed'] = L('PUBLIC_WEIBO');
} elseif ($key == 'comment') {
$d['tabHash']['comment'] = L('PUBLIC_STREAM_COMMENT');
} else {
$langKey = 'PUBLIC_APPNAME_' . strtoupper($key);
$lang = L($langKey);
if ($lang == $langKey) {
$d['tabHash'][$key] = ucfirst($key);
} else {
$d['tabHash'][$key] = $lang;
}
}
}
$this->assign($d);
!empty($_POST['t']) && ($map['table'] = t($_POST['t']));
// at类型
$this->assign('tt', $_POST['t']);
// 设置应用名称与表名称
$app_name = isset($_GET['app_name']) ? t($_GET['app_name']) : 'public';
// $app_table = isset($_GET['app_table']) ? t($_GET['app_table']) : '';
// 获取@Me分享列表
$at_list = model('Atme')->setAppName($app_name)->setAppTable($app_table)->getAtmeList($map, $order = 'atme_id DESC', $limit = 20);
// 赞功能
$feed_ids = getSubByKey($at_list['data'], 'feed_id');
$diggArr = model('FeedDigg')->checkIsDigg($feed_ids, $GLOBALS['ts']['mid']);
$this->assign('diggArr', $diggArr);
// dump($at_list);exit;
// 添加Widget参数数据
foreach ($at_list['data'] as &$val) {
if ($val['source_table'] == 'comment') {
$val['widget_sid'] = $val['sourceInfo']['source_id'];
$val['widget_style'] = $val['sourceInfo']['source_table'];
$val['widget_sapp'] = $val['sourceInfo']['app'];
$val['widget_suid'] = $val['sourceInfo']['uid'];
$val['widget_share_sid'] = $val['sourceInfo']['source_id'];
} else {
if ($val['is_repost'] == 1) {
$val['widget_sid'] = $val['source_id'];
$val['widget_stype'] = $val['source_table'];
$val['widget_sapp'] = $val['app'];
$val['widget_suid'] = $val['uid'];
$val['widget_share_sid'] = $val['app_row_id'];
$val['widget_curid'] = $val['source_id'];
$val['widget_curtable'] = $val['source_table'];
} else {
$val['widget_sid'] = $val['source_id'];
$val['widget_stype'] = $val['source_table'];
$val['widget_sapp'] = $val['app'];
$val['widget_suid'] = $val['uid'];
$val['widget_share_sid'] = $val['source_id'];
}
}
// 获取转发与评论数目
if ($val['source_table'] != 'comment') {
$feedInfo = model('Feed')->get($val['widget_sid']);
$val['repost_count'] = $feedInfo['repost_count'];
$val['comment_count'] = $feedInfo['comment_count'];
}
// 解析数据成网页端显示格式(@xxx 加链接)
$val['source_content'] = parse_html($val['source_content']);
$val['from'] = getFromClient($val['from'], $val['app']);
}
// 获取分享设置
$weiboSet = model('Xdata')->get('admin_Config:feed');
$this->assign($weiboSet);
// 用户@Me未读数目重置
// model('UserCount')->resetUserCount($this->mid, 'unread_atme', 0);
$userInfo = model('User')->getUserInfo($this->mid);
// 分页链接重写
$at_list['html'] = $this->messagePage($at_list['html']);
$this->assign($at_list);
// 消息类型
$this->assign('type', $type);
$html = $this->fetch("at");
break;
// 我的评论
// 我的评论
case 'comment':
$stype = t($_POST['stype']);
if (empty($_POST['stype'])) {
$stype = $_POST['stype'] = 'receive';
//.........这里部分代码省略.........
开发者ID:weiphpdev,项目名称:xindongfang,代码行数:101,代码来源:IndexAction.class.php
示例10: weibo
/**
* 分享排行
*/
public function weibo()
{
$order = intval($_GET['order']);
switch ($order) {
case 2:
$feed_order = 'repost_count desc';
break;
case 3:
$feed_order = 'digg_count desc';
break;
default:
$feed_order = 'comment_count desc';
break;
}
$map['is_del'] = 0;
$map['is_audit'] = 1;
$data = model('Feed')->getList($map, 20, $feed_order);
//赞功能
$feed_ids = getSubByKey($data['data'], 'feed_id');
$data['diggArr'] = model('FeedDigg')->checkIsDigg($feed_ids, $GLOBALS['ts']['mid']);
$data['remarkHash'] = model('Follow')->getRemarkHash($GLOBALS['ts']['mid']);
foreach ($data['data'] as &$v) {
switch ($v['app']) {
case 'weiba':
$v['from'] = getFromClient(0, $v['app'], '微吧');
break;
case 'tipoff':
$v['from'] = getFromClient(0, $v['app'], '爆料');
break;
default:
$v['from'] = getFromClient($v['from'], $v['app']);
break;
}
!isset($uids[$v['uid']]) && $v['uid'] != $GLOBALS['ts']['mid'] && ($uids[] = $v['uid']);
}
if (!empty($uids)) {
$map = array();
$map['uid'] = $GLOBALS['ts']['mid'];
$map['fid'] = array('in', $uids);
$data['followUids'] = model('Follow')->where($map)->getAsFieldArray('fid');
} else {
$data['followUids'] = array();
}
$weiboSet = model('Xdata')->get('admin_Config:feed');
$this->assign($weiboSet);
$this->assign($data);
$this->assign('order', $order);
$cancomment_old_type = array('post', 'repost', 'postimage', 'postfile', 'weiba_post', 'weiba_repost', 'blog_post', 'blog_repost', 'event_post', 'event_repost', 'vote_post', 'vote_repost', 'photo_post', 'photo_repost');
$this->assign('cancomment_old_type', $cancomment_old_type);
$this->_rightRank();
$this->display();
}
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:55,代码来源:RankAction.class.php
示例11: __formatByContent
//.........这里部分代码省略.........
* // $weibolist[$k]['content'] = wapFormatContent($v['content'], true, $self_url);
* // 视频处理
* $weibolist[$k]['content'] = wapFormatContent($v['api_source']['content'], true, $self_url);
*
* //if($v['type'] == 'postvideo'){
* // //$weibolist[$k]['content'] = $v['source_body'];
* // $weibolist[$k]['content'] = $v['feed_content'] ? $v['feed_content'] : $v['source_body'];
* // $weibolist[$k]['content'] = wapFormatContent($weibolist[$k]['content'], true, $self_url, "知识");
* //}else{
* // $weibolist[$k]['content'] = wapFormatContent($weibolist[$k]['content'], true, $self_url);
* //}
* // 非视频分享
* if ($v['transpond_data']['content']) {
* if(strpos($weibolist[$k]['type'], 'video')){
* $weibolist[$k]['transpond_data']['content'] = wapFormatContent($v['transpond_data']['content'], true, $self_url, "视频");
* }else{
* $weibolist[$k]['transpond_data']['content'] = wapFormatContent($v['transpond_data']['content'], true, $self_url);
* }
* $weibolist[$k]['transpond_data']['weibo_id'] = $weibolist[$k]['transpond_data']['feed_id'];
* }else{
* $row_id = model('Feed')->where('feed_id='.$v['feed_id'])->getField('app_row_id');
* $uid = model('Feed')->where('feed_id='.$row_id)->getField('uid');
* $weibolist[$k]['transpond_data'] = model('User')->getUserInfo($this->uid);
* }
* $weibolist[$k]['ctime'] = date('Y-m-d H:i', $v['publish_time']);
* }else{
* if($weibolist[$k]['row_id']){
* $weibolist[$k]['ctime'] = strtotime($weibolist[$k]['ctime']);
* }else{
* unset($weibolist[$k]);
* }
*
* }
*/
break;
case 'public':
if ($v['feed_id']) {
$weibolist[$k]['weibo_id'] = $weibolist[$k]['feed_id'];
// $weibolist[$k]['content'] = wapFormatContent($v['content'], true, $self_url);
// 视频处理
if ($v['type'] == 'postvideo') {
// $weibolist[$k]['content'] = $v['source_body'];
$weibolist[$k]['content'] = $v['feed_content'] ? $v['feed_content'] : $v['source_body'];
$weibolist[$k]['content'] = wapFormatContent($weibolist[$k]['content'], true, $self_url, "视频");
} else {
$weibolist[$k]['content'] = wapFormatContent($weibolist[$k]['content'], true, $self_url);
}
// 非视频分享
if ($v['transpond_data']['content']) {
if (strpos($weibolist[$k]['type'], 'video')) {
$weibolist[$k]['transpond_data']['content'] = wapFormatContent($v['transpond_data']['content'], true, $self_url, "视频");
} else {
$weibolist[$k]['transpond_data']['content'] = wapFormatContent($v['transpond_data']['content'], true, $self_url);
}
$weibolist[$k]['transpond_data']['weibo_id'] = $weibolist[$k]['transpond_data']['feed_id'];
} else {
$row_id = model('Feed')->where('feed_id=' . $v['feed_id'])->getField('app_row_id');
$uid = model('Feed')->where('feed_id=' . $row_id)->getField('uid');
$weibolist[$k]['transpond_data'] = model('User')->getUserInfo($this->uid);
}
$weibolist[$k]['ctime'] = date('Y-m-d H:i', $v['publish_time']);
} else {
if ($weibolist[$k]['row_id']) {
$weibolist[$k]['ctime'] = strtotime($weibolist[$k]['ctime']);
} else {
unset($weibolist[$k]);
}
}
break;
case 'weiba':
$weiba_post = D('WeibaPost', 'weiba')->where('post_id=' . $v['app_row_id'])->find();
$weibolist[$k]['weibo_id'] = $weibolist[$k]['feed_id'];
$weibolist[$k]['transpond_data'] = $weiba_post;
$weibolist[$k]['transpond_data']['weibo_id'] = $weibolist[$k]['feed_id'];
$weibolist[$k]['transpond_data']['uname'] = model('User')->where('uid=' . $weiba_post['post_uid'])->getField('uname');
$weibolist[$k]['transpond_data']['uid'] = $weiba_post['post_uid'];
break;
default:
// code...
break;
}
// 处理视频链接
/*
* if(strpos($weibolist[$k]['type'], 'video')){
* $weibolist[$k]['content'] = preg_replace("/(.*)<a([^>*])>([^<*])</a>(.*)/i", "\\1<a\\2>视频</a>\\4", $weibolist[$k]['content']);
* $weibolist[$k]['transpond_data']['content'] = preg_replace("/(.*)<a([^>*])>([^<*])</a>(.*)/i", "\\1<a\\2>视频</a>\\4", $weibolist[$k]['transpond_data']['content']);
* }
*/
$weibolist[$k]['from'] = getFromClient($weibolist[$k]['from'], $v['app']);
$map['source_id'] = $v['feed_id'];
$map['uid'] = $this->mid;
$fav = model('Collection')->where($map)->getField('source_id');
if ($fav) {
$weibolist[$k]['favorited'] = 1;
} else {
$weibolist[$k]['favorited'] = 0;
}
}
return $weibolist;
}
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:101,代码来源:ChannelAction.class.php
示例12: feed_top_home
public function feed_top_home()
{
$uid = intval($_GET['uid']);
$list = $this->model('FeedTopHome')->getFeedTopHome($uid);
$this->assign('uid', $uid);
$this->assign('mid', $this->mid);
foreach ($list as &$value) {
$value['feed_info'] = model('Feed')->get($value['feed_id']);
switch ($value['feed_info']['app']) {
case 'weiba':
$value['feed_info']['from'] = getFromClient(0, $value['feed_info']['app'], '微吧');
break;
case 'tipoff':
$value['feed_info']['from'] = getFromClient(0, $value['feed_info']['app'], '爆料');
break;
default:
$value['feed_info']['from'] = getFromClient($value['feed_info']['from'], $value['feed_info']['app']);
}
}
$this->assign('data', $list);
$feed_ids = getSubByKey($list, 'feed_id');
$diggArr = model('FeedDigg')->checkIsDigg($feed_ids, $this->mid);
$this->assign('diggArr', $diggArr);
$cancomment_old_type = array('post', 'repost', 'postimage', 'postfile', 'weiba_post', 'weiba_repost', 'blog_post', 'blog_repost', 'event_post', 'event_repost', 'vote_post', 'vote_repost', 'photo_post', 'photo_repost');
$this->assign('cancomment_old_type', $cancomment_old_type);
$uids = array();
foreach ($list as $item) {
$uids[] = $item['feed_info']['uid'];
}
if (!empty($uids)) {
$map = array();
$map['uid'] = $GLOBALS['ts']['mid'];
$map['fid'] = array('in', $uids);
$followUids = model('Follow')->where($map)->getAsFieldArray('fid');
$this->assign('followUids', $followUids);
$remarkHash = model('Follow')->getRemarkHash($GLOBALS['ts']['mid']);
$this->assign('remarkHash', $remarkHash);
}
$this->display('feedTop');
}
开发者ID:medz,项目名称:thinksns-4,代码行数:40,代码来源:FeedTopHomeHooks.class.php
示例13: doPostTrue
public function doPostTrue()
{
$uid = $data['user_id'] = $_GET['uid'] <= 0 ? $this->mid : $_GET['uid'];
$profile = api('User')->data($data)->show();
$data['id'] = $profile['last_feed']["{$uid}"]['feed_id'];
$feed = api('WeiboStatuses')->data($data)->show();
$feed['from'] = getFromClient($feed['from'], 'public');
// $feed = $this->__formatByContent($feed);
// dump($feed);
$this->assign('feed', $feed);
$this->display('doPostTrue');
}
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:12,代码来源:IndexAction.class.php
示例14: getDiggListPage
public function getDiggListPage($map, $limit = 20)
{
$list = $this->where($map)->order('id desc')->findPage($limit);
foreach ($list['data'] as &$d) {
$d['user'] = model('User')->getUserInfo($d['uid']);
$d['feed'] = model('Feed')->getFeedInfo($d['feed_id']);
$d['feed']['content'] = parse_html($d['feed']['content']);
$d['feed']['feed_content'] = parse_html($d['feed']['feed_content']);
switch ($d['feed']['app']) {
case 'weiba':
$d['feed']['from'] = getFromClient(0, $d['feed']['app'], '微吧');
break;
default:
$d['feed']['from'] = getFromClient($d['feed']['from'], $d['feed']['app']);
break;
}
}
return $list;
}
开发者ID:medz,项目名称:thinksns-4,代码行数:19,代码来源:CommentDiggModel.class.php
示例15: shareFeed
//.........这里部分代码省略.........
// 处理分享类型
$feedType = 'repost';
// 默认为普通的转发格式
if (!empty($oldInfo['feedtype']) && !in_array($oldInfo['feedtype'], array('post', 'postimage', 'postfile'))) {
$feedType = $oldInfo['feedtype'];
}
if ($app != 'public') {
// 非分享类型内容转发
$oldInfo['uid'] = $oldInfo['source_user_info']['uid'];
$oldInfo['sourceInfo']['source_id'] = $oldInfo['feed_id'];
$feedType = $app . '_repost';
}
$d['sourceInfo'] = !empty($oldInfo['sourceInfo']) ? $oldInfo['sourceInfo'] : $oldInfo;
// 是否发送@上级节点
$isOther = $from == 'comment' ? false : true;
// 获取上个节点资源ID
$d['curid'] = $data['curid'];
// 获取转发原分享信息
$appId = $oldInfo['source_id'];
$appTable = $oldInfo['source_table'];
$d['from'] = isset($data['from']) ? intval($data['from']) : 0;
$d['latitude'] = isset($data['latitude']) ? $data['latitude'] : 0;
$d['longitude'] = isset($data['longitude']) ? $data['longitude'] : 0;
$d['address'] = isset($data['address']) ? $data['address'] : 0;
if ($res = model('Feed')->put($GLOBALS['ts']['mid'], $app, $feedType, $d, $appId, $appTable, null, $lessUids, $isOther, 1)) {
// if($data['comment'] != 0 && $oldInfo['uid'] != $data['comment_touid']) {
if ($data['comment'] != 0 || $data['comment_old'] != 0) {
// && $oldInfo['uid'] != $data['comment_touid']
// 发表评论
$c['type'] = 2;
$c['app'] = $app;
$c['table'] = 'feed';
$c['app_uid'] = $oldInfo['uid'];
$c['content'] = !empty($d['body']) ? $d['body'] : $d['content'];
$c['row_id'] = !empty($oldInfo['sourceInfo']) ? $oldInfo['sourceInfo']['source_id'] : $appId;
$c['client_type'] = getVisitorClient();
$notCount = true;
unlockSubmit();
$comment_id = model('Comment')->addComment($c, true, $notCount, $lessUids);
// 同步到微吧
if ($app == 'weiba') {
$postDetail = D('weiba_post')->where('feed_id=' . $c['row_id'])->find();
if ($postDetail) {
$datas['weiba_id'] = $postDetail['weiba_id'];
$datas['post_id'] = $postDetail['post_id'];
$datas['post_uid'] = $postDetail['post_uid'];
// $datas['to_reply_id'] = $data['to_comment_id']?D('weiba_reply')->where('comment_id='.$data['to_comment_id'])->getField('reply_id'):0;
// $datas['to_uid'] = $data['to_uid'];
$datas['uid'] = $GLOBALS['ts']['mid'];
$datas['ctime'] = time();
$datas['content'] = $c['content'];
$datas['comment_id'] = $comment_id;
if (D('weiba_reply')->add($datas)) {
$map['last_reply_uid'] = $this->mid;
$map['last_reply_time'] = $datas['ctime'];
D('weiba_post')->where('post_id=' . $datas['post_id'])->save($map);
// 回复统计数加1
D('weiba_post')->where('post_id=' . $datas['post_id'])->setInc('reply_count');
}
}
}
}
// 添加话题
model('FeedTopic')->addTopic(html_entity_decode($d['body'], ENT_QUOTES), $res['feed_id'], $feedType);
// 渲染数据
$rdata = $res;
// 渲染完后的结果
$rdata['feed_id'] = $res['feed_id'];
$rdata['app_row_id'] = $data['sid'];
$rdata['app_row_table'] = $data['type'];
$rdata['app'] = $app;
$rdata['is_repost'] = 1;
switch ($app) {
case 'weiba':
$rdata['from'] = getFromClient(0, $app, '微吧');
break;
default:
$rdata['from'] = getFromClient($from, $app);
break;
}
$return['data'] = $rdata;
$return['status'] = 1;
// 被分享内容“分享统计”数+1,同时可检测出app,table,row_id 的有效性
if (!($pk = D($data['type'], $data['app_name'])->getPk())) {
$pk = $data['type'] . '_id';
}
D($data['type'], $data['app_name'])->setInc('repost_count', "`{$pk}`={$data['sid']}", 1);
if ($data['curid'] != $data['sid'] && !empty($data['curid'])) {
if (!($pk = D($data['curtable'])->getPk())) {
$pk = $data['curtable'] . '_id';
}
D($data['curtable'])->setInc('repost_count', "`{$pk}`={$data['curid']}", 1);
D($data['curtable'])->cleanCache($data['curid']);
}
D($data['type'], $data['app_name'])->cleanCache($data['sid']);
} else {
$return['data'] = model('Feed')->getError();
}
return $return;
}
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:101,代码来源:ShareModel.class.php
示例16: feed
/**
* 获取指定用户的某条动态
* @return void
*/
public function feed()
{
if (empty($_GET['feed_id'])) {
$this->error(L('PUBLIC_INFO_ALREADY_DELETE_TIPS'));
}
// 获取用户信息
$user_info = model('User')->getUserInfo($this->uid);
//个人空间头部
$this->_top();
//判断隐私设置
$u
|
请发表评论