• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP friendlyDate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中friendlyDate函数的典型用法代码示例。如果您正苦于以下问题:PHP friendlyDate函数的具体用法?PHP friendlyDate怎么用?PHP friendlyDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: viewPosts

 /**
  * 查看回复
  * @author JunhaoHo
  */
 public function viewPosts()
 {
     $aid = I('aid', null);
     //更优的方法是通过SAE的KVDB实现计数,考虑到用户数较少暂且先这样做↓↓↓↓↓
     D('Activity')->updateActivityCounterByAid($aid, 'views');
     $posts = D('Post')->getPostsByAid($aid);
     $info = D('Activity')->getActivityByAid($aid, 'subject,replies,views');
     $subject = $info['subject'];
     $replies = $info['replies'];
     $views = $info['views'];
     $uids = array();
     foreach ($posts as $post) {
         $uids[] = $post['uid'];
     }
     $avatars = D('Member')->getAvatarsByUids($uids);
     foreach ($posts as &$post) {
         $post['avatar'] = $avatars[$post['uid']];
         $post['friendly_date'] = friendlyDate($post['dateline']);
     }
     $members_num = D('ActivityMember')->getMemberNumByAid($aid);
     $haspost = count($posts) ? true : false;
     $this->assign('members_num', $members_num);
     $this->assign('posts', $posts);
     $this->assign("haspost", $haspost);
     $this->assign("aid", $aid);
     $this->assign('subject', $subject);
     $this->assign('replies', $replies);
     $this->assign('views', $views);
     $this->display();
 }
开发者ID:imdaqian,项目名称:SCAP,代码行数:34,代码来源:PostController.class.php


示例2: render

 public function render($data)
 {
     $tpl_section = $data['tpl'];
     $info = $data['info'];
     $tpl_section = $this->handle($tpl_section, '{$[title]}', op_t($info['title']));
     $tpl_section = $this->handle($tpl_section, '{$[cTime]}', friendlyDate($info['create_time']));
     $tpl_section = $this->handle($tpl_section, '{$[cTimeD]}', date('n j', $info['create_time']));
     $tpl_section = $this->handle($tpl_section, '{$[url]}', U('Cat/Index/info', array('info_id' => $info['id'])));
     /*用户标签*/
     $user = query_user(array('nickname', 'avatar32', 'avatar64', 'avatar128', 'avatar256', 'space_url'), $info['uid']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar32]}', $user['avatar32']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar64]}', $user['avatar64']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar128]}', $user['avatar128']);
     $tpl_section = $this->handle($tpl_section, '{$[user_avatar256]}', $user['avatar256']);
     $tpl_section = $this->handle($tpl_section, '{$[user_nickname]}', $user['nickname']);
     $tpl_section = $this->handle($tpl_section, '{$[user_space_url]}', $user['space_url']);
     $tpl_section = $this->handle($tpl_section, '{$[user_uid]}', $user['uid']);
     /*用户标签end*/
     $tpl_section = $this->handle($tpl_section, '{$[fav_btn]}', R('FavBtn/render', array(array('info' => $info)), 'Widget'));
     $entity = D('cat_entity')->find($info['entity_id']);
     if ($entity['can_over']) {
         $tpl_section = $this->handle($tpl_section, '{$[over_time]}', date('Y-m-d', $info['over_time']));
     } else {
         $tpl_section = $this->handle($tpl_section, '{$[over_time]}', '');
     }
     return $tpl_section;
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:27,代码来源:SysTagRenderWidget.class.php


示例3: index

 /**
  * 文章管理
  */
 public function index()
 {
     $map = array();
     if ($_POST['content']) {
         $map['content'] = array('like', '%' . t($_POST['content']) . '%');
     }
     if ($_POST['explain']) {
         $map['explain'] = array('like', '%' . t($_POST['explain']) . '%');
     }
     if ($_POST['paper_id']) {
         $map['paper_id'] = intval($_POST['paper_id']);
     }
     if ($_POST['paper_section']) {
         $map['paper_section'] = intval($_POST['paper_section']);
     }
     $this->pageKeyList = array('id', 'paper_id', 'paper_section', 'content', 'explain', 'DOACTION');
     $this->pageTab[] = array('title' => '文章列表', 'tabHash' => 'index', 'url' => U('admin/PaperArticle/index'));
     $list = M('paper_section_article')->where($map)->findPage();
     foreach ($list['data'] as &$v) {
         $v['answer_time'] = friendlyDate($v['answer_time'], 'full');
         $v['DOACTION'] = '<a href="' . U('admin/PaperArticle/editArticle', array('id' => $v['id'], 'tabHash' => 'editArticle')) . '">编辑</a>';
     }
     $this->searchKey = array('paper_id', 'paper_section', 'content', 'explain');
     $this->pageButton[] = array('title' => '搜索', 'onclick' => "admin.fold('search_form')");
     $this->assign('pageTitle', '试卷文章管理');
     $this->displayList($list);
 }
开发者ID:317703064,项目名称:ssat,代码行数:30,代码来源:PaperArticleAction.class.php


示例4: show

 public function show($data)
 {
     $data['entity'] = M('store_entity')->find($data['info']['entity_id']);
     $data['data'] = M('Data')->getByInfoId($data['info']['id']);
     $data['user'] = query_user(array('nickname', 'space_url', 'avatar64', 'avatar128'), $data['info']['uid']);
     $data['user']['info_count'] = M('Goods')->where('uid=' . $data['info']['uid'])->count();
     $map['info_id'] = $data['info']['id'];
     $data['mid'] = is_login();
     $items = M('store_item')->where('good_id=' . $data['info']['id'])->select();
     $ids = getSubByKey($items, 'order_id');
     $ids_uni = array_unique($ids);
     $m_com['id'] = array('in', implode(',', $ids_uni));
     $data['info']['com'] = M('Order')->where($m_com)->findPage(10);
     foreach ($data['info']['com']['data'] as $k => &$v) {
         $data['info']['com']['data'][$k]['user'] = query_user(array('nickname', 'space_url', 'avatar64'), $v['uid']);
         $v['response_time_format'] = $v['response_time'] ? friendlyDate($v['response_time']) : '系统自动';
     }
     $this->assign($data);
     if ($data['entity']['name'] == 'shop') {
         $this->display('Widget/DefaultInfoTpl/shop');
     } elseif ($data['entity']['name'] == 'good') {
         $data['shop'] = M('Store/StoreShop')->getById($data['info']['shop_id']);
         $this->assign($data);
         $this->display('Widget/DefaultInfoTpl/good');
     } else {
         $this->display('Widget/DefaultInfoTpl/tpl');
     }
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:28,代码来源:DefaultInfoTplWidget.class.php


示例5: getHaventReadMeassageAndToasted

 /**
  * 取回全部未读,也没有提示过的信息
  * @param $uid
  * @return mixed
  */
 public function getHaventReadMeassageAndToasted($uid)
 {
     $messages = D('message')->where(array('to_uid' => $uid, 'is_read' => 0, 'last_toast' => array('neq', 0)))->order('id desc')->limit(99999)->select();
     foreach ($messages as &$v) {
         $v['ctime'] = friendlyDate($v['create_time']);
         $v['content'] = op_t($v['content']);
     }
     unset($v);
     return $messages;
 }
开发者ID:admpub,项目名称:OpenCenter,代码行数:15,代码来源:MessageModel.class.php


示例6: getHaventReadMeassageAndToasted

 public function getHaventReadMeassageAndToasted($uid)
 {
     $messages = D('message')->where('to_uid=' . $uid . ' and  is_read=0  and last_toast!=0')->order('id desc')->limit(99999)->select();
     foreach ($messages as &$v) {
         $v['ctime'] = friendlyDate($v['create_time']);
         $v['content'] = op_t($v['content']);
     }
     unset($v);
     return $messages;
 }
开发者ID:fishling,项目名称:chatPro,代码行数:10,代码来源:MessageModel.class.php


示例7: quick

 public function quick()
 {
     $files = $this->getFile($this->mPackPath);
     $list = array();
     foreach ($files as $f) {
         $info = $this->toArray(json_decode($this->read_file($this->mPackPath . '/' . $f)));
         if (!$info) {
             continue;
         }
         $file = $this->mPackPath . '/' . $info['ctime'] . '.sql';
         $info['file'] = $info['ctime'] . '.sql';
         $info['id'] = $info['ctime'];
         $info['ctime'] = friendlyDate($info['ctime']);
         $size = filesize($this->pack_sql_dir . '/' . $info['id'] . '.sql');
         if ($size / 1024 > 1) {
             $info['size'] = number_format($size * 1.0 / 1024 / 1024, 2) . 'MB';
         } else {
             $info['size'] = number_format($size * 1.0 / 1024, 2) . 'KB';
         }
         if ($info['mtime'] != 0) {
             $info['mtime'] = friendlyDate($info['mtime']);
         }
         $list[] = $info;
     }
     /*        $listBuilder = new AdminListBuilder();*/
     /*      $listBuilder->keyText('title', L('_TITLE_'))->keyText('des', L('_INTRODUCTION_'))->keyText('author', L('_AUTHOR_'))->keyText('file', L('_SQL_FILE_NAME_'))->keyText('size', L('_SQL_SIZE_'))->keyText('ctime', L('_CREATE_TIME_'))->keyText('mtime', L('_CHANGE_TIME_'))
             ->keyDoActionEdit('update/addpack?id=###', L('_EDIT_'));*/
     /*  $listBuilder->data($list);
         $listBuilder->display();
         dump($list);
         exit;*/
     /*
                     dump($fiels);
                     exit;
     
                     $db = $this->read_file($this->pack_db_path);
                     $db = json_decode($db);
                     $db = $this->toArray($db);
                     foreach ($db['packs'] as &$pack) {
                         $file = $this->pack_sql_dir . '/' . $pack['title'] . '.sql';
                         $pack['mtime'] = date('Y-m-d H:i:s', $pack['mtime']);
                         $pack['size'] = filesize($file) . ' bytes';
                     }
                     unset($pack);*/
     $this->assign('list', $list);
     $title = L('_FAST_OPERATION_');
     //渲染模板
     $this->assign('meta_title', $title);
     $this->display();
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:50,代码来源:UpdateController.class.php


示例8: index

 public function index()
 {
     $this->pageKeyList = array('id', 'img', 'url', 'ctime', 'DOACTION');
     $this->pageTab[] = array('title' => '数据列表', 'tabHash' => 'index', 'url' => U('admin/SatPublic/index'));
     $this->pageButton[] = array('title' => '添加图片', 'onclick' => "javascript:location.href='" . U('admin/SatPublic/addImg', array('tabHash' => 'addImg')) . "'");
     $list = M('sat_ad')->findPage();
     foreach ($list['data'] as &$v) {
         $v['img'] = '<img width="150" height="150" src="' . getAttachUrlByAttachId($v['img']) . '" />';
         $v['ctime'] = friendlyDate($v['ctime'], 'full');
         $v['DOACTION'] = '<a href="' . U('admin/SatPublic/editImg', array('id' => $v['id'], 'tabHash' => 'editImg')) . '">编辑</a> ' . '<a href="javascript:admin.delsatimg(' . $v['id'] . ')">删除</a>';
     }
     $this->assign('pageTitle', '铃铛广告');
     $this->displayList($list);
 }
开发者ID:317703064,项目名称:ssat,代码行数:14,代码来源:SatPublicAction.class.php


示例9: quick

 public function quick()
 {
     $files = $this->getFile($this->mPackPath);
     $list = array();
     foreach ($files as $f) {
         $info = $this->toArray(json_decode($this->read_file($this->mPackPath . '/' . $f)));
         if (!$info) {
             continue;
         }
         $file = $this->mPackPath . '/' . $info['ctime'] . '.sql';
         $info['file'] = $info['ctime'] . '.sql';
         $info['id'] = $info['ctime'];
         $info['ctime'] = friendlyDate($info['ctime']);
         $size = filesize($this->pack_sql_dir . '/' . $info['id'] . '.sql');
         if ($size / 1024 > 1) {
             $info['size'] = number_format($size * 1.0 / 1024 / 1024, 2) . 'MB';
         } else {
             $info['size'] = number_format($size * 1.0 / 1024, 2) . 'KB';
         }
         if ($info['mtime'] != 0) {
             $info['mtime'] = friendlyDate($info['mtime']);
         }
         $list[] = $info;
     }
     /*        $listBuilder = new AdminListBuilder();*/
     /*      $listBuilder->keyText('title', '标题')->keyText('des', '用途介绍')->keyText('author', '作者')->keyText('file', 'sql文件名')->keyText('size', 'sql大小')->keyText('ctime', '创建时间')->keyText('mtime', '修改时间')
             ->keyDoActionEdit('update/addpack?id=###', '编辑');*/
     /*  $listBuilder->data($list);
         $listBuilder->display();
         dump($list);
         exit;*/
     /*
                     dump($fiels);
                     exit;
     
                     $db = $this->read_file($this->pack_db_path);
                     $db = json_decode($db);
                     $db = $this->toArray($db);
                     foreach ($db['packs'] as &$pack) {
                         $file = $this->pack_sql_dir . '/' . $pack['title'] . '.sql';
                         $pack['mtime'] = date('Y-m-d H:i:s', $pack['mtime']);
                         $pack['size'] = filesize($file) . ' bytes';
                     }
                     unset($pack);*/
     $this->assign('list', $list);
     $title = '快捷操作';
     //渲染模板
     $this->assign('meta_title', $title);
     $this->display();
 }
开发者ID:fishling,项目名称:chatPro,代码行数:50,代码来源:UpdateController.class.php


示例10: confusion

 /**
  * 题目解析疑惑
  */
 public function confusion()
 {
     $map = array();
     $this->pageKeyList = array('id', 'paper_id', 'paper_section', 'topic_num', 'topic_content', 'content', 'answer', 'answer_time', 'DOACTION');
     $this->pageTab[] = array('title' => '解析疑惑列表', 'tabHash' => 'paperTestConfusion', 'url' => U('admin/PaperTest/confusion'));
     $list = M('paper_confusion')->where($map)->order('is_read desc,id')->findPage();
     foreach ($list['data'] as &$v) {
         $map['paper_id'] = $v['paper_id'];
         $map['paper_section'] = $v['paper_section'];
         $map['topic_num'] = $v['topic_num'];
         $v['topic_content'] = M('paper_article_test')->where($map)->getField('content');
         $v['answer_time'] = friendlyDate($v['answer_time'], 'full');
         $v['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.addAnswer(' . $v['id'] . ')">回答</a>';
     }
     $this->assign('pageTitle', '解析疑惑');
     $this->displayList($list);
 }
开发者ID:317703064,项目名称:ssat,代码行数:20,代码来源:PaperTestAction.class.php


示例11: getComment

 /**
  * getComment
  * 获取评论数据
  * @access public
  * @return void
  */
 public function getComment()
 {
     $map['appid'] = intval($_REQUEST['appid']);
     $map['type'] = t($_REQUEST['type']);
     $list = model('GlobalComment')->where($map)->order('id ASC')->findpage(10);
     $appUid = $this->getInterFaceUid($map['type'], $map['appid']);
     foreach ($list['data'] as $key => $value) {
         $list['data'][$key]['uavatar'] = getUserSpace($value['uid'], 'null', '_blank', '{uavatar}');
         $list['data'][$key]['uspace'] = getUserSpace($value['uid'], 'null', '_blank', '{uname}');
         $list['data'][$key]['ctime'] = friendlyDate($value['cTime']);
         $list['data'][$key]['comment'] = formatComment($value['comment']);
         $list['data'][$key]['uname'] = getUserName($value['uid']);
         $list['data'][$key]['del_state'] = $appUid == $this->mid || $value['uid'] == $this->mid ? 1 : 0;
         $list['data'][$key]['userGroupIcon'] = getUserGroupIcon($value['uid']);
     }
     exit(json_encode($list));
 }
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:23,代码来源:CommentAction.class.php


示例12: report_list

 function report_list()
 {
     $dao = D("Report");
     $data = $dao->order("cTime desc")->findPage(10);
     //dump($data["data"]);
     echo "<table>";
     echo "<tr>";
     echo "<td>举报人</td>";
     echo "<td>链接</td>";
     echo "<td>原因</td>";
     echo "<td>举报时间</td>";
     echo "</tr>";
     foreach ($data["data"] as $key => $v) {
         echo "<tr>";
         echo "<td>" . getUserName($v["uid"]) . "</td>";
         echo "<td><a href='" . $v["url"] . "'>" . getShort($v["info"], 30) . "</a></td>";
         echo "<td>" . $v["reason"] . "</td>";
         echo "<td>" . friendlyDate($v["cTime"]) . "</td>";
         echo "</tr>";
     }
     echo "</table>";
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:22,代码来源:PublicAction.class.php


示例13: getTopicList

 /**
  * 当指定pid时,查询该父分类的所有子分类;否则查询所有分类
  * @param integer $pid 父分类ID
  * @return array 相应的分类列表
  */
 public function getTopicList($limit = 20, $map = array())
 {
     if (isset($_POST)) {
         /*	//搜索时用到
         			$_POST['weiba_id'] && $map['weiba_id']=intval($_POST['weiba_id']);
         			$_POST['weiba_name'] && $map['weiba_name']=array('like','%'.$_POST['weiba_name'].'%');
         			$_POST['uid'] && $map['uid']=intval($_POST['uid']);
         			$_POST['admin_uid'] && $map['admin_uid']=intval($_POST['admin_uid']);
         			$_POST['recommend'] && $map['recommend']=$_POST['recommend']==1?1:0;*/
     }
     // 查询数据
     $list = $this->where($map)->order('topic_id desc,topic_time desc')->findPage($limit);
     // 数据组装
     foreach ($list['data'] as $k => $v) {
         $list['data'][$k]['weiba_name'] = '<a target="_blank" href="' . U('weiba/Index/detail', array('weiba_id' => $v['weiba_id'])) . '">' . $v['weiba_name'] . '</a>';
         $create_uid = model('User')->getUserInfoByUids($v['topic_uid']);
         $list['data'][$k]['topic_uid'] = $create_uid[$v['topic_uid']]['space_link'];
         $list['data'][$k]['topic_time'] = friendlyDate($v['topic_time']);
         $list['data'][$k]['DOACTION'] = '<a href="' . U('bboard/Admin/editTopic', array('topic_id' => $v['topic_id'], 'tabHash' => 'editTopic')) . '">编辑</a>|<a onclick="admin.delTopic(' . $v['topic_id'] . ');" href="javascript:void(0)">删除</a>';
     }
     return $list;
 }
开发者ID:lyhiving,项目名称:icampus,代码行数:27,代码来源:TopicModel.class.php


示例14: getPostList

 /**
  * 获取帖子列表,后台可以根据条件查询
  * @param integer $limit 结果集数目,默认为20
  * @param array $map 查询条件
  * @return array 微吧列表信息
  */
 public function getPostList($limit = 20, $map = array())
 {
     if (isset($_POST)) {
         //搜索时用到
         $_POST['post_id'] && ($map['post_id'] = intval($_POST['post_id']));
         $_POST['title'] && ($map['title'] = array('like', '%' . $_POST['title'] . '%'));
         $_POST['post_uid'] && ($map['post_uid'] = intval($_POST['post_uid']));
         $_POST['recommend'] && ($map['recommend'] = $_POST['recommend'] == 1 ? 1 : 0);
         $_POST['digest'] && ($map['digest'] = $_POST['digest'] == 1 ? 1 : 0);
         $_POST['top'] && ($map['top'] = $_POST['top'] == 1 ? 1 : 0);
         $_POST['weiba_id'] && ($map['weiba_id'] = intval($_POST['weiba_id']));
     }
     // 查询数据
     $list = D('weiba_post')->where($map)->order('last_reply_time desc,post_time desc')->findPage($limit);
     // 数据组装
     foreach ($list['data'] as $k => $v) {
         $list['data'][$k]['title'] = '<a target="_blank" href="' . U('weiba/Index/postDetail', array('post_id' => $v['post_id'])) . '">' . $v['title'] . '</a>';
         $author = model('User')->getUserInfoByUids($v['post_uid']);
         $list['data'][$k]['post_uid'] = $author[$v['post_uid']]['space_link'];
         $list['data'][$k]['post_time'] = friendlyDate($v['post_time']);
         $list['data'][$k]['last_reply_time'] = friendlyDate($v['last_reply_time']);
         $list['data'][$k]['read_count/reply_count'] = $v['read_count'] . '/' . $v['reply_count'];
         $list['data'][$k]['weiba_id'] = $this->where('weiba_id=' . $v['weiba_id'])->getField('weiba_name');
         if ($v['is_del'] == 0) {
             $isRecommend = $v['recommend'] ? '取消推荐' : '推荐到首页';
             $isDigest = $v['digest'] ? '取消精华' : '设为精华';
             $isGlobalTop = $v['top'] == 2 ? '取消全局置顶' : '设为全局置顶';
             $isLocalTop = $v['top'] == 1 ? '取消吧内置顶' : '设为吧内置顶';
             $list['data'][$k]['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',1,' . $v['recommend'] . ');">' . $isRecommend . '</a>|<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',2,' . $v['digest'] . ')">' . $isDigest . '</a>|<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',3,' . $v['top'] . ',2)">' . $isGlobalTop . '</a>|<a href="javascript:void(0)" onclick="admin.setPost(' . $v['post_id'] . ',3,' . $v['top'] . ',1)">' . $isLocalTop . '</a>|<a href="' . U('weiba/Admin/editPost', array('post_id' => $v['post_id'], 'tabHash' => 'editPost')) . '">编辑</a>|<a href="javascript:void(0)" onclick="admin.doStorey(' . $v['post_id'] . ')">调整回复楼层</a>|<a href="javascript:void(0)" onclick="admin.delPost(' . $v['post_id'] . ')">删除</a>';
         } else {
             $list['data'][$k]['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.recoverPost(' . $v['post_id'] . ')">还原</a>|<a href="javascript:void(0)" onclick="admin.deletePost(' . $v['post_id'] . ')">彻底删除</a>';
         }
     }
     return $list;
 }
开发者ID:naliduo,项目名称:ThinkSNS,代码行数:41,代码来源:WeibaModel.class.php


示例15: friendlyDate

								<div class='pf-description'>
										Issue Date:
								</div>
								<div class='pf-content'>
										<?php 
echo friendlyDate($res['issue_date']);
?>
								</div>
						</div>
						<div class="pf-element">
								<div class='pf-description'>
										Due Date:
								</div>
								<div class='pf-content'>
										<?php 
echo friendlyDate($res['due_date']);
?>
								</div>
						</div>
						<div class="pf-element">
								<div class='pf-description'>
										Description:
								</div>
								<div class='pf-content'>
										<?php 
echo $desc;
?>
								</div>
						</div>
						<div class="pf-element">
								<div class='pf-description'>
开发者ID:nhandyal,项目名称:Roski_Loaner,代码行数:31,代码来源:indexDetails.php


示例16: _getRelatedUserFromAge

 /**
  * 获取相同年龄的用户
  * @param integer $limit 查询个数,默认为1
  * @return array 相同地区的用户数据
  */
 private function _getRelatedUserFromAge($num = 1, $limit = 100)
 {
     // 获取用户的区信息
     $birthday = $this->_user_model->field('birthday')->where('uid=' . $this->_uid)->find();
     $ret = getNowMonth($birthday['birthday']);
     // 获取地区信息
     if (empty($birthday['birthday'])) {
         return array();
     }
     // 获取相同地区的用户
     $limit = $limit * 10;
     $map['birthday'] = array('BETWEEN', array($ret['sdate'], $ret['edate']));
     $user = $this->_user_model->field('uid')->where($map)->limit($limit)->findAll();
     $data = getSubByKey($user, 'uid');
     $data = array_diff($data, $this->_exclude_uids);
     $data = array_unique($data);
     $data && ($data = $this->_data_array_rand($data, $num));
     // 用户基本信息
     $userInfos = $this->_user_model->getUserInfoByUids($data);
     // 用户关注状态
     $userStates = $this->_user_follow->getFollowStateByFids($this->_uid, $data);
     // 设置去除用户
     $this->_getExcludeUids($data);
     foreach ($data as $key => $value) {
         if (!$userInfos[$value]) {
             unset($data[$key]);
             continue;
         }
         $data[$key] = array('userInfo' => $userInfos[$value]);
         $data[$key]['followState'] = $userStates[$value];
         // 获取地区信息
         $map['area_id'] = array('IN', array($areaInfo['city'], $areaInfo['area']));
         $areaName = model('Area')->where($map)->getAsFieldArray('title');
         $areaName = implode(' ', $areaName);
         $data[$key]['info']['msg'] = 'TA与你年龄相同';
         $data[$key]['info']['extendMsg'] = '你们的生日都在' . friendlyDate($birthday['birthday']);
         $data[$key]['uid'] = $value;
     }
     return $data;
 }
开发者ID:yang7hua,项目名称:hunshe,代码行数:45,代码来源:RelatedUserModel.class.php


示例17: getIssueComments

 public function getIssueComments()
 {
     $aPage = I('page', 1, 'intval');
     $aCount = I('count', 10, 'intval');
     $aRowId = I('row_id', 0, 'intval');
     if (!D('Issue/IssueContent')->where(array('id' => $aRowId))->find()) {
         exit($this->apiError('专辑不存在'));
     }
     $uid = D('Issue/IssueContent')->where(array('id' => $aRowId))->field('uid')->select();
     $uid = array_column($uid, 'uid');
     $arr = array();
     $IssueComments = D('Issue/LocalComment')->where(array('app' => 'issue', 'mod' => 'issueContent', 'row_id' => $aRowId, 'status' => 1))->page($aPage, $aCount)->order('create_time desc')->select();
     foreach ($IssueComments as &$v) {
         preg_match_all("/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/", $v['content'], $arr);
         //匹配所有的图片
         $v['imgList'] = $arr[1];
         $v['content'] = op_t($v['content']);
         $v['user'] = query_user(array('uid', 'username', 'nickname', 'avatar128'), $v['uid']);
         $v['create_time'] = friendlyDate($v['create_time']);
         if (in_array($v['uid'], $uid)) {
             $v['is_landlord'] = '1';
         } else {
             $v['is_landlord'] = '0';
         }
     }
     unset($v);
     $list = array('list' => $IssueComments);
     $this->apiSuccess('返回成功', $list);
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:29,代码来源:IssueController.class.php


示例18: ignoreReport

 /**
  * 管理员忽略举报操作
  */
 public function ignoreReport()
 {
     $ids = I('ids');
     //获取点击的ids
     $map['id'] = array('in', $ids);
     $time = time();
     //获取当前时间
     $data['handle_time'] = $time;
     $data['handle_result'] = '忽略处理';
     $handlepeople = is_login();
     //操作人的ID
     $data['status'] = '2';
     $data['handle_uid'] = $handlepeople;
     $uid = D('Common/Report')->where($map)->field('uid')->select();
     $uid = array_column($uid, 'uid');
     $name = query_user(array('uid', 'nickname'));
     //获取用户名
     $result = D('Addons://Report/Report')->where($map)->save($data);
     if ($result) {
         for ($i = 0; $i < count($uid); $i++) {
             //根据用户ID,发送系统消息
             D('Message')->sendMessageWithoutCheckSelf($uid[$i], '处理时间:' . friendlyDate($data['handle_time']) . '。' . '处理状态:' . '已处理' . '。' . '处理结果:' . $data['handle_result'] . '。' . '处理人:' . $name['nickname'], '您有新的系统消息', '', is_login(), 0);
         }
         $this->success('处理成功', 0);
     } else {
         $this->error('处理失败');
     }
 }
开发者ID:xiaolw,项目名称:wacms,代码行数:31,代码来源:AdminController.class.php


示例19: getTipoffDetail

 public function getTipoffDetail()
 {
     $tipoff_id = intval($_POST['tipoff_id']);
     $tipoff_detail = D('tipoff')->where('deleted=0 and archived=0 and tipoff_id=' . $tipoff_id)->find();
     if ($tipoff_detail) {
         $tipoff_detail['tipoff_url'] = U('tipoff/Index/detail', array('id' => $tipoff_id));
         $author = model('User')->getUserInfo($tipoff_detail['uid']);
         $tipoff_detail['author'] = $author['space_link'];
         $tipoff_detail['publish_time'] = friendlyDate($tipoff_detail['publish_time']);
         $tipoff_detail['from_category'] = D('tipoff_category')->where('tipoff_category_id=' . $tipoff_detail['category_id'])->getField('title');
         $tipoff_detail['category_url'] = U('tipoff/Index/index', array('cid' => $tipoff_detail['category_id']));
         return json_encode($tipoff_detail);
     } else {
         echo 0;
     }
 }
开发者ID:boxshadow,项目名称:ThinkSNS-4,代码行数:16,代码来源:FeedListWidget.class.php


示例20: feedback

 /**
  * APP反馈管理
  *
  * @return void
  * @author Medz Seven <[email protected]>
  **/
 public function feedback()
 {
     $this->pageKeyList = array('user', 'content', 'time', 'doaction');
     array_push($this->pageTab, array('title' => 'APP反馈管理', 'hash' => 'feedback', 'url' => U('admin/Application/feedback')));
     $this->allSelected = false;
     /* # 每页显示的条数 */
     $number = 20;
     /* # 反馈类型,app反馈为1 */
     $type = 1;
     /* # 是否按照时间正序排列 */
     $asc = false;
     $list = model('Feedback')->findDataToPageByType($type, $number, $asc);
     foreach ($list['data'] as $key => $value) {
         $data = array();
         $data['content'] = $value['content'];
         $data['user'] = getUserName($value['uid']);
         $data['time'] = friendlyDate($value['cTime']);
         $data['doaction'] = '<a href="' . U('admin/Application/deleteFeedback', array('fid' => $value['id'])) . '">[删除反馈]</a>';
         $list['data'][$key] = $data;
     }
     unset($data, $key, $value);
     $this->displayList($list);
 }
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:29,代码来源:ApplicationAction.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP friendly_date函数代码示例发布时间:2022-05-15
下一篇:
PHP friend_list函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap