本文整理汇总了PHP中getImageUrlByAttachId函数的典型用法代码示例。如果您正苦于以下问题:PHP getImageUrlByAttachId函数的具体用法?PHP getImageUrlByAttachId怎么用?PHP getImageUrlByAttachId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getImageUrlByAttachId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: w3gSlideShow
/**
* 3G办广场轮播列表
*
* @author Medz Seven <[email protected]>
**/
public function w3gSlideShow()
{
// # 设置页面字段
$this->pageKeyList = array('image', 'url', 'doaction');
// # 添加tab
array_push($this->pageTab, array('title' => '轮播列表', 'tabHash' => 'w3gSlideShow', 'url' => U('admin/Mobile/w3gSlideShow')));
array_push($this->pageTab, array('title' => '添加轮播', 'tabHash' => 'addW3gSlideShow', 'url' => U('admin/Mobile/addW3gSlideShow')));
// # 分页获取数据,20条
$list = D('w3g_slide_show')->findPage(20);
// # 加入操作按钮
foreach ($list['data'] as $key => $value) {
// # 参数
$aid = $value['image'];
$id = $value['id'];
// # 添加图片
$value = '<a href="%s" target="_blank"><img src="%s" width="300px" height="140px"></a>';
$value = sprintf($value, getImageUrlByAttachId($aid), getImageUrlByAttachId($aid, 300, 140));
$list['data'][$key]['image'] = $value;
// # 添加操作按钮
$value = '[<a href="%s">编辑</a>] - [<a href="%s">删除</a>]';
$value = sprintf($value, U('admin/Mobile/addW3gSlideShow', array('id' => $id, 'tabHash' => 'addW3gSlideShow')), U('admin/Mobile/delW3gSlideShwo', array('id' => $id)));
$list['data'][$key]['doaction'] = $value;
}
// # 设置无选择按钮
$this->allSelected = false;
// # 显示列表,并注销list变量
$this->displayList($list);
unset($list);
}
开发者ID:medz,项目名称:thinksns-4,代码行数:34,代码来源:MobileAction.class.php
示例2: index
/**
* 频道首页页面
* @return void
*/
public function index()
{
// 添加样式
$this->appCssList[] = 'channel.css';
// 获取频道分类列表
$channelCategory = model('CategoryTree')->setTable('channel_category')->getCategoryList();
$this->assign('channelCategory', $channelCategory);
// 频道分类选中
$cid = intval($_GET['cid']);
$categoryIds = getSubByKey($channelCategory, 'channel_category_id');
if (!in_array($cid, $categoryIds) && !empty($cid)) {
$this->error('您请求的频道分类不存在');
return false;
}
$channelConf = model('Xdata')->get('channel_Admin:index');
if (empty($cid)) {
$cid = $channelConf['default_category'];
if (empty($cid)) {
$cid = array_shift($categoryIds);
}
}
$this->assign('cid', $cid);
// 获取用户与频道分类的关注状态
$followStatus = model('ChannelFollow')->getFollowStatus($this->mid, $cid);
$this->assign('followStatus', $followStatus);
// 获取模板样式
$templete = t($_GET['tpl']);
if (empty($templete) || !in_array($templete, array('load', 'list'))) {
$categoryConf = model('CategoryTree')->setTable('channel_category')->getCatgoryConf($cid);
$templete = empty($categoryConf) ? $channelConf['show_type'] == 1 ? 'list' : 'load' : ($categoryConf['show_type'] == 1 ? 'list' : 'load');
}
$templete = 'load';
$this->assign('tpl', $templete);
//获取频道信息
//广播数
$channel_count = model('Channel')->where('channel_category_id=' . $cid . ' AND status=1')->count();
$this->assign("channel_count", $channel_count);
//收听人数
$channel_follower_count = model("ChannelFollow")->where('channel_category_id=' . $cid)->count();
$this->assign("channel_follower_count", $channel_follower_count);
//banner,desc
$channel_category = D("channelCategory")->where('channel_category_id=' . $cid)->getField('ext');
$channel_category = unserialize($channel_category);
$channel_banner = getImageUrlByAttachId($channel_category['attach'], 1000);
$this->assign('channel_banner', $channel_banner);
$this->assign('channel_desc', $channel_category['desc']);
//排序
$order = $_GET['order'] == null ? 0 : $_GET['order'];
$this->assign("order", intval($order));
// 设置页面信息
$titleHash = model('CategoryTree')->setTable('channel_category')->getCategoryHash();
$title = empty($cid) ? '频道首页' : $titleHash[$cid];
$this->setTitle($title);
$this->setKeywords($title);
$this->setDescription(implode(',', getSubByKey($channelCategory, 'title')));
$this->display();
}
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:61,代码来源:IndexAction.class.php
示例3: getSlideShow
/**
* 获取application幻灯数据
*
* @return array
* @author Medz Seven <[email protected]>
**/
public function getSlideShow()
{
$list = D('application_slide')->field('`title`, `image`, `type`, `data`')->select();
foreach ($list as $key => $value) {
$value['image'] = getImageUrlByAttachId($value['image']);
$list[$key] = $value;
}
return $list;
}
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:15,代码来源:PublicApi.class.php
示例4: index
/**
* 微吧管理首页-修改微吧信息
* @return void
*/
public function index()
{
$weiba_id = intval($_GET['weiba_id']);
$this->assign('weiba_id', $weiba_id);
$weiba_detail = D('weiba')->where('weiba_id=' . $weiba_id)->find();
if ($weiba_detail['logo']) {
$weiba_detail['logo_url'] = getImageUrlByAttachId($weiba_detail['logo']);
}
$this->assign('weiba_detail', $weiba_detail);
$this->display();
}
开发者ID:lyhiving,项目名称:icampus,代码行数:15,代码来源:LogAction.class.php
示例5: getInfo
/**
* 获取礼物详细
*
* @request int $id 礼物ID
* @return array
* @author Seven Du <[email protected]>
**/
public function getInfo()
{
$id = intval(Common::getInput('id'));
$data = GiftModel::getInstance()->getById($id);
$data['image'] && ($data['image'] = getImageUrlByAttachId($data['image']));
$data['count'] = LogModel::getInstance()->getUserCount($id);
$data['info'] = preg_replace('/\\<img(.*?)src\\=\\"\\/(.*?)\\"(.*?)(\\/?)\\>/is', '<img\\1src="SITE_URL/\\2"\\3\\4>', $data['info']);
$data['info'] = str_replace('SITE_URL', parse_url(SITE_URL, PHP_URL_SCHEME) . '://' . parse_url(SITE_URL, PHP_URL_HOST) . '/', $data['info']);
/* # 剔除width和height和align,防止宽高溢出 */
$data['info'] = preg_replace('/(width|height|align)\\=\\"(.*?)\\"/is', '', $data['info']);
return $data;
}
开发者ID:medz,项目名称:thinksns-4,代码行数:19,代码来源:GiftApi.class.php
示例6: index
/**
* 微吧管理首页-修改微吧信息
* @return void
*/
public function index()
{
$weiba_id = intval($_GET['weiba_id']);
$weiba_detail = D('weiba')->where('weiba_id=' . $weiba_id)->find();
if ($weiba_detail['logo']) {
$weiba_detail['logo_url'] = getImageUrlByAttachId($weiba_detail['logo']);
}
$weiba_cates = D('WeibaCategory')->getAllWeibaCate();
$this->assign('weiba_cates', $weiba_cates);
$this->assign('weiba_detail', $weiba_detail);
$this->setTitle('基本信息 ' . $weiba_detail['weiba_name']);
$this->setKeywords('基本信息 ' . $weiba_detail['weiba_name']);
$this->display();
}
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:18,代码来源:ManageAction.class.php
示例7: index
/**
* 频道首页页面
* @return void
*/
public function index()
{
global $ts;
$xdata = M('Xdata');
$tip = $xdata->getConfig('tip', 'config', 'bboard_Admin');
$big_logo = $xdata->getConfig('big_logo', 'config', 'bboard_Admin');
$this->assign('tip', $tip);
$this->assign('big_logo', getImageUrlByAttachId($big_logo));
//$path=$attach['save_path'].$attach['save_name'];
// dump(getImageUrlByAttachId($big_logo));exit;
// 添加样式
$this->appCssList[] = 'bboard/bboard.css';
// 获取频道分类列表
$topic = D('topic')->getData(20);
$this->assign('topic', $topic);
$this->display();
}
开发者ID:lyhiving,项目名称:icampus,代码行数:21,代码来源:IndexAction.class.php
示例8: render
/**
* 渲染关注按钮模板
* @example
* $data['manage_uid'] integer 用户ID
* @param array $data 渲染的相关配置参数
* @return string 渲染后的模板数据
*/
public function render($data)
{
$var = array();
$manage = D('weiba_follow')->where(array('follower_uid' => $data['manage_uid'], 'level' => array('in', array(2, 3))))->findAll();
$map['weiba_id'] = array('in', getSubByKey($manage, 'weiba_id'));
$map['is_del'] = 0;
$var['manageWeibaList'] = D('weiba')->where($map)->findAll();
$var['manageWeibaListCount'] = D('weiba')->where($map)->count();
foreach ($var['manageWeibaList'] as $k => $v) {
$var['manageWeibaList'][$k]['logo'] = getImageUrlByAttachId($v['logo'], 50, 50);
}
is_array($data) && ($var = array_merge($var, $data));
// 渲染模版
$content = $this->renderFile(dirname(__FILE__) . '/manageWeibaList.html', $var);
unset($var, $data);
// 输出数据
return $content;
}
开发者ID:medz,项目名称:thinksns-4,代码行数:25,代码来源:ManageWeibaListWidget.class.php
示例9: render
/**
* 渲染关注按钮模板
* @example
* $data['follower_uid'] integer 用户ID
* @param array $data 渲染的相关配置参数
* @return string 渲染后的模板数据
*/
public function render($data)
{
$var = array();
$var['type'] = 'FollowWeibaList';
$follow = D('weiba_follow')->where('follower_uid=' . $data['follower_uid'])->findAll();
$map['weiba_id'] = array('in', getSubByKey($follow, 'weiba_id'));
$map['is_del'] = 0;
$var['weibaList'] = D('weiba')->where($map)->findAll();
$var['weibaListCount'] = D('weiba')->where($map)->count();
foreach ($var['weibaList'] as $k => $v) {
$var['weibaList'][$k]['logo'] = getImageUrlByAttachId($v['logo'], 30, 30);
}
is_array($data) && ($var = array_merge($var, $data));
// 渲染模版
$content = $this->renderFile(dirname(__FILE__) . "/followWeibaList.html", $var);
unset($var, $data);
// 输出数据
return $content;
}
开发者ID:yang7hua,项目名称:hunshe,代码行数:26,代码来源:FollowWeibaListWidget.class.php
示例10: login
/**
* 默认登录页
* @return void
*/
public function login()
{
// 添加样式
$this->appCssList[] = 'login.css';
if (model('Passport')->isLogged()) {
redirect($this->site['home_url']);
}
// 获取邮箱后缀
$registerConf = model('Xdata')->get('admin_Config:register');
$this->assign('emailSuffix', explode(',', $registerConf['email_suffix']));
$this->assign('register_type', $registerConf['register_type']);
$data = model('Xdata')->get("admin_Config:seo_login");
!empty($data['title']) && $this->setTitle($data['title']);
!empty($data['keywords']) && $this->setKeywords($data['keywords']);
!empty($data['des']) && $this->setDescription($data['des']);
$login_bg = getImageUrlByAttachId($this->site['login_bg']);
// if(empty($login_bg))
// $login_bg = APP_PUBLIC_URL . '/image/login/banner.png';
$this->assign('login_bg', $login_bg);
$this->display('login');
}
开发者ID:jianminglok,项目名称:thinksnsv4,代码行数:25,代码来源:PassportAction.class.php
示例11: login
/**
* 默认登录页
* @return void
*/
public function login()
{
// 添加样式
$this->appCssList[] = 'login.css';
if ($GLOBALS['ts']['mid'] > 0) {
U('public/Index/index', '', true);
}
// 获取邮箱后缀
$registerConf = model('Xdata')->get('admin_Config:register');
$this->assign('emailSuffix', explode(',', $registerConf['email_suffix']));
$this->assign('register_type', $registerConf['register_type']);
$data = model('Xdata')->get("admin_Config:seo_login");
!empty($data['title']) && $this->setTitle($data['title']);
!empty($data['keywords']) && $this->setKeywords($data['keywords']);
!empty($data['des']) && $this->setDescription($data['des']);
$login_bg = getImageUrlByAttachId($this->site['login_bg']);
if (empty($login_bg)) {
$login_bg = APP_PUBLIC_URL . '/image/body-bg2.jpg';
}
$this->assign('login_bg', $login_bg);
$this->display();
}
开发者ID:naliduo,项目名称:ThinkSNS,代码行数:26,代码来源:PassportAction.class.php
示例12: index
/**
* 轮播列表
*
* @return void
* @author Medz Seven <[email protected]>
**/
public function index()
{
$this->pageKeyList = array('title', 'image', 'type', 'data', 'doAction');
array_push($this->pageTab, array('title' => '轮播列表', 'tabHash' => 'index', 'url' => U('admin/Application/index')));
array_push($this->pageTab, array('title' => '添加轮播', 'tabHash' => 'addSlide', 'url' => U('admin/Application/addSlide')));
$list = D('application_slide')->findPage(20);
foreach ($list['data'] as $key => $value) {
// # 参数
$aid = $value['image'];
$id = $value['id'];
$list['data'][$key]['type'] = $this->type[$value['type']];
// # 添加图片
$value = '<a href="%s" target="_blank"><img src="%s" width="300px" height="140px"></a>';
$value = sprintf($value, getImageUrlByAttachId($aid), getImageUrlByAttachId($aid, 300, 140));
$list['data'][$key]['image'] = $value;
// # 添加操作按钮
$value = '[<a href="%s">编辑</a>] - [<a href="%s">删除</a>]';
$value = sprintf($value, U('admin/Application/addSlide', array('id' => $id, 'tabHash' => 'addSlide')), U('admin/Application/delSlide', array('id' => $id)));
$list['data'][$key]['doAction'] = $value;
}
$this->allSelected = false;
$this->displayList($list);
}
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:29,代码来源:ApplicationAction.class.php
示例13: core_display_tpl
public function core_display_tpl()
{
if (!$this->checkAvailability()) {
return;
}
$config = $config ? $config : model('AddonData')->lget('beautifyLogin');
if (!$config['template']) {
$config['template'] = 1;
}
if (!$config['color']) {
$config['color'] = "FFFFFF";
}
switch ($config['template']) {
case 1:
// By Zue
$templateFile = dirname(dirname(__FILE__)) . '/html/zue/login.html';
break;
case 2:
// By Cali
$templateFile = dirname(dirname(__FILE__)) . '/html/cali/login.html';
break;
}
$siteConf = model('Xdata')->get('admin_Config:site');
$config['login_bg'] = getImageUrlByAttachId($siteConf['login_bg']);
$config['_title'] = $siteConf['site_slogan'];
$config['_keywords'] = $siteConf['site_header_keywords'];
$config['_description'] = $siteConf['site_header_description'];
$config['site']['site_slogan'] = $siteConf['site_slogan'];
$config['site']['site_name'] = $siteConf['site_name'];
$config['site']['logo'] = getSiteLogo($siteConf['site_logo']);
$config['site']['sys_version'] = $siteConf['sys_version'];
// 获取当前Js语言包
$this->langJsList = setLangJavsScript();
$config['langJsList'] = $this->langJsList;
echo fetch($templateFile, $config, $param['charset'], $param['contentType']);
exit;
}
开发者ID:CaliProject,项目名称:thinksns,代码行数:37,代码来源:BeautifyLoginHooks.class.php
示例14: index
public function index()
{
$indexList = D('weiba_post')->where('is_del=0 AND top=2')->order('is_index_time desc')->findAll();
foreach ($indexList as &$v) {
$imgIds = explode(',', $_POST['imageIds']);
if ($imgIds) {
$v['index_img_url'] = getImageUrlByAttachId($imgIds[0]);
}
}
$this->assign('indexList', $indexList);
$order = '`top` desc,FIELD(recommend+digest,0,1,2) desc,last_reply_time desc';
$map['is_del'] = 0;
$map['is_index'] = 0;
$list = D('weiba_post')->where($map)->order($order)->limit(20)->select();
$this->assign('list', $list);
// 推荐微吧
if (!($weibalist = S('rec_weibalist'))) {
$weibalist = D('weiba')->where('is_del=0 and status=1')->order('recommend desc,follower_count desc,thread_count')->limit(4)->select();
S('rec_weibalist', $weibalist);
}
$this->assign('weibalist', $weibalist);
//dump($indexList);
$this->display();
}
开发者ID:jacyxie,项目名称:xindongfang,代码行数:24,代码来源:WeibaAction.class.php
示例15: weibaAudit
/**
* 微吧审核
* @return void
*/
public function weibaAudit()
{
$_REQUEST['tabHash'] = 'weibaAudit';
$this->_initWeibaListAdminMenu();
// 设置列表主键
$this->_listpk = 'weiba_id';
$this->pageButton[] = array('title' => '搜索', 'onclick' => "admin.fold('search_form')");
$this->pageButton[] = array('title' => '通过', 'onclick' => "admin.doWeibaAudit('', 1)");
$this->pageButton[] = array('title' => '驳回', 'onclick' => "admin.doWeibaAudit('', -1)");
$this->searchKey = array('weiba_name');
$this->pageKeyList = array('weiba_id', 'weiba_name', 'weiba_cate', 'info', 'uid', 'uinfo', 'live', 'ctime', 'DOACTION');
if (!empty($_POST['weiba_name'])) {
$maps['weiba_name'] = array('like', '%' . t($_POST['weiba_name']) . '%');
$map['weiba_id'] = array('in', getSubByKey(D('weiba')->where($maps)->field('weiba_id')->findAll(), 'weiba_id'));
}
$map['status'] = 0;
// 数据的格式化与listKey保持一致
$listData = D('weiba')->where($map)->order('ctime desc')->findPage(20);
$weibacate = D('weiba_category')->findAll();
$cids = array();
foreach ($weibacate as $c) {
$cids[$c['id']] = $c['name'];
}
foreach ($listData['data'] as $k => $v) {
$listData['data'][$k]['weiba_name'] = '<a target="_blank" href="' . U('weiba/Index/detail', array('weiba_id' => $v['weiba_id'])) . '">' . $v['weiba_name'] . '</a>';
$listData['data'][$k]['logo'] && ($listData['data'][$k]['logo'] = '<img src="' . getImageUrlByAttachId($v['logo']) . '" width="50" height="50">');
$create_uid = model('User')->getUserInfoByUids($v['uid']);
$listData['data'][$k]['uid'] = $create_uid[$v['uid']]['space_link'];
$listData['data'][$k]['uinfo'] = $create_uid[$v['uid']]['group_icon'];
$listData['data'][$k]['live'] = $create_uid[$v['uid']]['credit_info']['level']['name'];
$listData['data'][$k]['ctime'] = friendlyDate($v['ctime']);
$listData['data'][$k]['weiba_cate'] = $cids[$v['cid']];
$listData['data'][$k]['DOACTION'] = '<a href="javascript:void(0)" onclick="admin.doWeibaAudit(' . $v['weiba_id'] . ',1);">通过</a> - <a href="javascript:void(0)" onclick="admin.doWeibaAudit(' . $v['weiba_id'] . ',-1);">驳回</a>';
}
$this->displayList($listData);
}
开发者ID:ElijahLabs,项目名称:ThinkSNS-4,代码行数:40,代码来源:AdminAction.class.php
示例16: doPost
/**
* 执行发布帖子
*
* @return void
*/
public function doPost()
{
$this->need_login();
if (!CheckPermission('weiba_normal', 'weiba_post')) {
$this->error('对不起,您没有权限进行该操作!', true);
}
$weibaid = intval($_POST['weiba_id']);
if (!$weibaid) {
$this->error('请选择微吧!', true);
}
$weiba = D('weiba', 'weiba')->where('weiba_id=' . $weibaid)->find();
if (!CheckPermission('core_admin', 'admin_login')) {
switch ($weiba['who_can_post']) {
case 1:
$map['weiba_id'] = $weibaid;
$map['follower_uid'] = $this->mid;
$res = D('weiba_follow')->where($map)->find();
if (!$res && !CheckPermission('core_admin', 'admin_login')) {
$this->error('对不起,您没有发帖权限,请关注该微吧!', true);
}
break;
case 2:
$map['weiba_id'] = $weibaid;
$map['level'] = array('in', '2,3');
$weiba_admin = D('weiba_follow')->where($map)->order('level desc')->field('follower_uid')->findAll();
if (!in_array($this->mid, getSubByKey($weiba_admin, 'follower_uid')) && !CheckPermission('core_admin', 'admin_login')) {
$this->error('对不起,您没有发帖权限,仅限管理员发帖!', true);
}
break;
case 3:
$map['weiba_id'] = $weibaid;
$map['level'] = 3;
$weiba_admin = D('weiba_follow')->where($map)->order('level desc')->field('follower_uid')->find();
if ($this->mid != $weiba_admin['follower_uid'] && !CheckPermission('core_admin', 'admin_login')) {
$this->error('对不起,您没有发帖权限,仅限圈主发帖!', true);
}
break;
}
}
$checkContent = str_replace(' ', '', $_POST['content']);
$checkContent = str_replace('<br />', '', $checkContent);
$checkContent = str_replace('<p>', '', $checkContent);
$checkContent = str_replace('</p>', '', $checkContent);
$checkContents = preg_replace('/<img(.*?)src=/i', 'img', $checkContent);
$checkContents = preg_replace('/<embed(.*?)src=/i', 'img', $checkContents);
if (strlen(t($_POST['title'])) == 0) {
$this->error('帖子标题不能为空', true);
}
if (strlen(t($checkContents)) == 0) {
$this->error('帖子内容不能为空', true);
}
preg_match_all('/./us', t($_POST['title']), $match);
if (count($match[0]) > 30) {
// 汉字和字母都为一个字
$this->error('帖子标题不能超过30个字', true);
}
if ($_POST['attach_ids']) {
$attach = explode('|', $_POST['attach_ids']);
foreach ($attach as $k => $a) {
if (!$a) {
unset($attach[$k]);
}
}
$attach = array_map('intval', $attach);
$data['attach'] = serialize($attach);
}
$data['weiba_id'] = $weibaid;
$data['title'] = t($_POST['title']);
$data['content'] = h($_POST['content']);
$data['post_uid'] = $this->mid;
$data['post_time'] = time();
$data['last_reply_uid'] = $this->mid;
$data['last_reply_time'] = $data['post_time'];
$data['tag_id'] = intval($_POST['tag_id']);
$imgIds = explode(',', $_POST['imageIds']);
foreach ($imgIds as $imgId) {
$imgId = intval($imgId);
if ($imgId > 0) {
$imgsrc = getImageUrlByAttachId($imgId);
if ($imgsrc) {
$data['content'] .= '<p><img src="' . $imgsrc . '" /></p>';
}
}
}
$res = D('weiba_post')->add($data);
if ($res) {
refreshWeibaCount($data['weiba_id']);
// D('weiba')->where('weiba_id='.$data['weiba_id'])->setInc('thread_count');
// 同步到分享
$feed_id = D('weibaPost', 'weiba')->syncToFeed($res, $data['title'], t($checkContent), $this->mid);
D('weiba_post')->where('post_id=' . $res)->setField('feed_id', $feed_id);
// $this->assign('jumpUrl', U('weiba/Index/postDetail',array('post_id'=>$res)));
// $this->success('发布成功');
// 添加积分
model('Credit')->setUserCredit($this->mid, 'publish_topic');
//.........这里部分代码省略.........
开发者ID:lanhaitunyaojiejie,项目名称:xindongfang,代码行数:101,代码来源:WeibaAction.class.php
示例17: catCP
function catCP($name)
{
$conf = M('Xdata')->lget('mag_Admin');
foreach ($conf as $v) {
if (isset($v[$name])) {
return getImageUrlByAttachId($v[$name]);
}
}
}
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:9,代码来源:function.php
示例18: getTopEvent
/**
* 获取推荐活动
*
* @request int $num 获取的数量,默认5条
* @return array
* @author Seven Du <[email protected]>
**/
public function getTopEvent()
{
$num = Common::getInput('num');
$num or $num = 5;
$data = Event::getInstance()->getRightEvent($num);
foreach ($data as $key => $value) {
$value['area'] = model('Area')->getAreaById($value['area']);
$value['area'] = $value['area']['title'];
$value['city'] = model('Area')->getAreaById($value['city']);
$value['city'] = $value['city']['title'];
$value['image'] = getImageUrlByAttachId($value['image']);
$value['cate'] = Cate::getInstance()->getById($value['cid']);
$value['cate'] = $value['cate']['name'];
$data[$key] = $value;
}
return $data;
}
开发者ID:medz,项目名称:thinksns-4,代码行数:24,代码来源:EventApi.class.php
示例19: show
/**
* 用户个人主页 --using
*
* @param int $user_id
* 用户UID
* @param varchar $uname
* 用户名
* @return array 状态+提示 或 用户信息
*/
public function show()
{
$num = $_REQUEST['num'];
$num = intval($num);
$num or $num = 10;
if (empty($this->user_id) && empty($this->data['uname'])) {
$uid = $this->mid;
} else {
if ($this->user_id) {
$uid = intval($this->user_id);
} else {
$uid = model('User')->where(array('uname' => $this->data['uname']))->getField('uid');
}
}
if ($this->mid != $uid) {
$privacy = model('UserPrivacy')->getPrivacy($this->mid, $uid);
if ($privacy['space'] == 1) {
return array('status' => 0, 'msg' => '您没有权限进入TA的个人主页');
}
}
$userInfo = $this->get_user_info($uid);
if (!$userInfo['uname']) {
return array('status' => 0, 'msg' => '该用户不存在或已被删除');
}
// $userInfo['can_'] = CheckPermission('core_normal','feed_del');
$user_info['is_admin'] = CheckPermission('core_admin', 'feed_del') ? '1' : '0';
$user_info['uid'] = $userInfo['uid'];
$user_info['uname'] = $userInfo['uname'];
$user_info['remark'] = $userInfo['remark'];
$user_info['sex'] = $userInfo['sex'] == 1 ? '男' : '女';
$user_info['intro'] = $userInfo['intro'] ? formatEmoji(false, $userInfo['intro']) : '';
$user_info['location'] = $userInfo['location'] ? $userInfo['location'] : '';
$user_info['avatar'] = $userInfo['avatar']['avatar_big'];
$user_info['experience'] = t($userInfo['user_credit']['credit']['experience']['value']);
$user_info['charm'] = t($userInfo['user_credit']['credit']['charm']['value']);
$user_info['weibo_count'] = t(intval($userInfo['user_data']['weibo_count']));
$user_info['follower_count'] = t(intval($userInfo['user_data']['follower_count']));
$user_info['following_count'] = t(intval($userInfo['user_data']['following_count']));
$follower = model('Follow')->where('fid=' . $user_info['uid'])->order('follow_id DESC')->field('uid')->limit($num)->findAll();
$following = model('Follow')->where('uid=' . $user_info['uid'])->order('follow_id DESC')->field('fid')->limit($num)->findAll();
$follower_arr = $following_arr = array();
foreach ($follower as $k => $v) {
$follower_info = $this->get_user_info($v['uid']);
$follower_arr[$k]['uid'] = $follower_info['uid'];
$follower_arr[$k]['uname'] = $follower_info['uname'];
$follower_arr[$k]['remark'] = $follower_info['remark'];
$follower_arr[$k]['avatar'] = $follower_info['avatar']['avatar_big'];
}
foreach ($following as $k1 => $v1) {
$following_info = $this->get_user_info($v1['fid']);
$following_arr[$k1]['uid'] = $following_info['uid'];
$following_arr[$k1]['uname'] = $following_info['uname'];
$following_arr[$k1]['remark'] = $following_info['remark'];
$following_arr[$k1]['avatar'] = $following_info['avatar']['avatar_big'];
}
$user_info['follower'] = $follower_arr;
$user_info['following'] = $following_arr;
$user_info['follow_status'] = model('Follow')->getFollowState($this->mid, $uid);
$user_info['is_in_blacklist'] = t(D('user_blacklist')->where('uid=' . $this->mid . ' and fid=' . $uid)->count());
$user_info['photo_count'] = model('Attach')->where(array('is_del' => 0, 'attach_type' => 'feed_image', 'uid' => $uid))->count();
$user_info['photo'] = $this->user_photo($uid);
$map['uid'] = $uid;
$map['type'] = 'postvideo';
$map['is_del'] = 0;
$user_info['video_count'] = M('feed')->where($map)->count();
$user_info['video'] = $this->user_video($uid);
$user_info['level_src'] = $userInfo['user_credit']['level']['src'];
// 用户认证图标
$groupIcon = array();
$userGroup = model('UserGroupLink')->getUserGroupData($uid);
foreach ($userGroup[$uid] as $g) {
$g['is_authenticate'] == 1 && ($groupArr[] = $g['user_group_name']);
}
$user_info['authenticate'] = empty($groupArr) ? '无' : implode(' , ', $groupArr);
/* # 获取用户认证理由 */
$user_info['certInfo'] = D('user_verified')->where('verified=1 AND uid=' . $uid)->field('info')->getField('info');
/* # 获取用户封面 */
$user_info['cover'] = D('user_data')->where('`key` LIKE "application_user_cover" AND `uid` = ' . $uid)->field('value')->getField('value');
$user_info['cover'] = getImageUrlByAttachId($user_info['cover']);
// 用户组
$user_group = model('UserGroupLink')->where('uid=' . $uid)->field('user_group_id')->findAll();
foreach ($user_group as $v) {
$user_group_icon = D('user_group')->where('user_group_id=' . $v['user_group_id'])->getField('user_group_icon');
if ($user_group_icon != -1) {
$user_info['user_group'][] = THEME_PUBLIC_URL . '/image/usergroup/' . $user_group_icon;
}
}
// 勋章
$list = M()->query('select b.small_src from ' . C('DB_PREFIX') . 'medal_user a inner join ' . C('DB_PREFIX') . 'medal b on a.medal_id=b.id where a.uid=' . $uid . ' order by a.ctime desc limit 10');
foreach ($list as $v) {
$smallsrc = explode('|', $v['small_src']);
//.........这里部分代码省略.........
开发者ID:medz,项目名称:thinksns-4,代码行数:101,代码来源:UserApi.class.php
示例20: step4
/**
* 注册流程 - 第四步骤
*/
public function step4()
{
// 未登录
empty($_SESSION['mid']) && $this->redirect('public/Passport/login');
$this->appCssList[] = 'login.css';
$weiba_recommend = D('weiba')->where('recommend=1 and is_del=0')->limit(8)->findAll();
foreach ($weiba_recommend as $k => $v) {
$weiba_recommend[$k]['logo'] = getImageUrlByAttachId($v['logo'], 230, 296);
}
$this->assign('weiba_recommend', $weiba_recommend);
//dump($this->_config);exit;
//按推荐用户
/*
$related_recommend_user = model('RelatedUser')->getRelatedUserByType(5,8);
$this->assign('related_recommend_user',$related_recommend_user);
//按标签
if(in_array('tag', $this->_config['interester_rule'])){
$related_tag_user = model('RelatedUser')->getRelatedUserByType(4,8);
$this->assign('related_tag_user',$related_tag_user);
}
//按地区
if(in_array('area', $this->_config['interester_rule'])){
$related_city_user = model('RelatedUser')->getRelatedUserByType(3,8);
$this->assign('related_city_user',$related_city_user);
}
*/
$userInfo = model('User')->getUserInfo($this->mid);
$location = explode(' ', $userInfo['location']);
$this->assign('location', $location[0]);
$this->setTitle('关注感兴趣的话题');
$this->setKeywords('关注感兴趣的话题');
$this->display();
}
开发者ID:a349944418,项目名称:kaopu,代码行数:36,代码来源:RegisterAction.class.php
注:本文中的getImageUrlByAttachId函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论