本文整理汇总了PHP中get_abs_img_root函数的典型用法代码示例。如果您正苦于以下问题:PHP get_abs_img_root函数的具体用法?PHP get_abs_img_root怎么用?PHP get_abs_img_root使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_abs_img_root函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$root = array();
$root['return'] = 1;
$cate_list = $GLOBALS['cache']->get("MOBILE_SEARCHCATE_CATELIST");
if ($cate_list === false) {
//取出标签分类
$cate_list_data = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_tag_cate where showin_mobile = 1 order by sort desc");
$cate_list = array();
foreach ($cate_list_data as $k => $v) {
$cate_list[$k]['id'] = $v['id'];
$cate_list[$k]['name'] = $v['name'];
$cate_list[$k]['bg'] = get_abs_img_root($v['mobile_title_bg']);
//查询分类下的标签
$txt_tags_data = $GLOBALS['db']->getAll("select t.* from " . DB_PREFIX . "topic_tag as t left join " . DB_PREFIX . "topic_tag_cate_link as l on l.tag_id = t.id where l.cate_id =" . $v['id'] . " order by t.sort desc limit 12");
$txt_tags = array();
foreach ($txt_tags_data as $kk => $vv) {
$txt_tags[$kk]['tag_name'] = $vv['name'];
$txt_tags[$kk]['color'] = $vv['color'];
}
$cate_list[$k]['tags'] = $txt_tags;
}
$GLOBALS['cache']->set("MOBILE_SEARCHCATE_CATELIST", $cate_list, CACHE_TIME);
}
$root['item'] = $cate_list;
output($root);
}
示例2: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$root = array();
$page = intval($GLOBALS['request']['page']);
if ($page == 0) {
$page = 1;
}
$uid = intval($GLOBALS['request']['uid']);
$user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $uid . " and is_effect = 1 and is_delete = 0");
if (!$user_info) {
$root['info'] = "非法的会员";
output($root);
}
$limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
$image_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_image where user_id = " . $user_info['id'] . " and topic_id > 0 order by create_time desc limit " . $limit);
$image_total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_image where user_id = " . $user_info['id'] . " and topic_id > 0 ");
$images = array();
foreach ($image_list as $k => $v) {
$images[$k]['photo_id'] = $v['id'];
$images[$k]['share_id'] = $v['topic_id'];
$images[$k]['img'] = get_abs_img_root(get_spec_image($v['o_path'], 200, 0, 0));
$images[$k]['height'] = floor($v['height'] * (200 / $v['width']));
}
$root['page'] = array("page" => $page, "page_total" => ceil($image_total / PAGE_SIZE));
$root['item'] = $images;
$root['return'] = 1;
output($root);
}
示例3: index
public function index()
{
$page = intval($GLOBALS['request']['page']);
//分页
$page = $page == 0 ? 1 : $page;
$cate_id = intval($GLOBALS['request']['cate_id']);
$city_id = intval($GLOBALS['request']['city_id']);
$page_size = PAGE_SIZE;
$limit = ($page - 1) * $page_size . "," . $page_size;
/*输出分类*/
$bigcate_list = $GLOBALS['db']->getAll("select id,name from " . DB_PREFIX . "topic_group_cate where is_effect=1 order by sort asc");
if ($cate_id > 0) {
$cate_condition = " and cate_id = " . $cate_id;
}
$sql = " select * from " . DB_PREFIX . "topic_group where is_effect = 1 {$cate_condition} order by sort desc limit " . $limit;
$sql_count = "select count(*) from " . DB_PREFIX . "topic_group where is_effect = 1 {$cate_condition} ";
$list = $GLOBALS['db']->getAll($sql);
$count = $GLOBALS['db']->getOne($sql_count);
foreach ($list as $k => $v) {
$list[$k]['icon'] = get_abs_img_root(get_spec_image($v['icon'], 300, 181, 0));
}
$page_total = ceil($count / $page_size);
$root = array();
$root['bigcate_list'] = $bigcate_list;
$root['return'] = 1;
$root['email'] = $email;
$root['f_link_data'] = get_link_list();
$root['item'] = $list;
$root['page'] = array("page" => $page, "page_total" => ceil($res['count'] / $page_size), "page_size" => $page_size);
$root['page_title'] = "小组";
output($root);
}
示例4: index
public function index()
{
$root = array();
$root['return'] = 1;
//首页菜单列表
$indexs_list = $GLOBALS['cache']->get("WAP_INDEXS_MORE_" . intval($GLOBALS['city_id']));
if ($indexs_list === false) {
$indexs = $GLOBALS['db']->getAll(" select * from " . DB_PREFIX . "m_index where status = 1 and mobile_type = 1 and city_id in (0," . intval($GLOBALS['city_id']) . ") order by sort desc ");
$indexs_list = array();
foreach ($indexs as $k => $v) {
$indexs_list[$k]['id'] = $v['id'];
$indexs_list[$k]['name'] = $v['name'];
$indexs_list[$k]['icon_name'] = $v['vice_name'];
//图标名 http://fontawesome.io/icon/bars/
$indexs_list[$k]['color'] = $v['desc'];
//颜色
$indexs_list[$k]['img'] = get_abs_img_root($v['img']);
/*
$indexs_list[$k]['is_hot'] = $v['is_hot'];
$indexs_list[$k]['is_new'] = $v['is_new'];
$indexs_list[$k]['type'] = $v['type'];
$indexs_list[$k]['data'] = $v['data'] = unserialize($v['data']);
*/
$indexs_list[$k]['url'] = getWebAdsUrl($v['type'], unserialize($v['data']));
}
$GLOBALS['cache']->set("WAP_INDEXS_MORE_" . intval($GLOBALS['city_id']), $indexs_list, 300);
}
$root['indexs'] = $indexs_list;
$root['page_title'] = "更多分类";
output($root);
}
示例5: index
public function index()
{
require_once APP_ROOT_PATH . 'app/Lib/deal.php';
/**
* has_attr: 0:无属性; 1:有属性
* 有商品属性在要购买时,要选择属性后,才能购买
* change_cart_request_server:
* 编辑购买车商品时,需要提交到服务器端,让服务器端通过一些判断返回一些信息回来(如:满多少钱,可以免运费等一些提示)
* 0:提交,1:不提交;
* image_attr_a_id_{$attr_a_id} 图片列表,可以根据属性ID值,来切换图片列表;默认为:0
* limit_num: 库存数量
*/
$id = intval($GLOBALS['request']['id']);
//商品ID
$item = get_deal($id);
$root = getGoodsArray($item);
$root['return'] = 1;
$root['attr'] = getAttrArray($id);
$images = array();
//image_attr_1_id_{$attr_1_id} 图片列表,可以根据属性ID值,来切换图片列表
$sql = "select img from " . DB_PREFIX . "deal_gallery where deal_id = " . intval($id);
$list = $GLOBALS['db']->getAll($sql);
$gallery = array();
$big_gallery = array();
foreach ($list as $k => $image) {
$gallery[] = get_abs_img_root(get_spec_image($image['img'], 320, 320, 0));
$big_gallery[] = get_abs_img_root(get_spec_image($image['img'], 0, 0, 0));
}
$root['gallery'] = $gallery;
$root['big_gallery'] = $big_gallery;
output($root);
}
示例6: index
public function index()
{
$page = intval($GLOBALS['request']['page']);
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
if ($page == 0) {
$page = 1;
}
$page_size = PAGE_SIZE;
$limit = ($page - 1) * $page_size . "," . $page_size;
$event_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_event order by sort desc limit " . $limit);
$count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_event");
foreach ($event_list as $k => $v) {
$now = get_gmtime();
$event_list[$k]['end_time'] = $v['event_end_time'];
$event_list[$k]['url'] = url("shop", "deal_event#show", array("id" => $v['id']));
$event_list[$k]['event_end_time'] = to_date($v['event_end_time'], 'Y-m-d');
$event_list[$k]['icon'] = get_abs_img_root(make_img($v['icon'], 592, 215, 1));
$event_list[$k]['sheng_time_format'] = to_date($v['event_end_time'] - $now, "d天h小时i分");
}
$page_total = ceil($count / $page_size);
$root = array();
$root['return'] = 1;
$root['item'] = $event_list;
$root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
$root['page_title'] = "活动专题";
$root['city_name'] = $city_name;
output($root);
}
示例7: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$email = strim($GLOBALS['request']['email']);
$pwd = strim($GLOBALS['request']['pwd']);
$result = do_login_user($email, $pwd);
$GLOBALS['user_info'] = $user_data = es_session::get('user_info');
$page = intval($GLOBALS['request']['page']) > 0 ? intval($GLOBALS['request']['page']) : 1;
$page_size = 20;
$limit = ($page - 1) * $page_size . "," . $page_size;
$user_id = intval($GLOBALS['user_info']['id']);
$sql = "select group_key,count(group_key) as total from " . DB_PREFIX . "msg_box \r\n\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1)) \r\n\t\t\t\tgroup by group_key \r\n\t\t\t\torder by system_msg_id desc,max(create_time) desc limit " . $limit;
$sql_count = "select count(distinct(group_key)) from " . DB_PREFIX . "msg_box \r\n\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1))";
$list = $GLOBALS['db']->getAll($sql);
foreach ($list as $k => $v) {
$list[$k] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_box where group_key = '" . $v['group_key'] . "' and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1)) order by create_time desc limit 1");
$list[$k]['total'] = $v['total'];
if ($list[$k]['system_msg_id'] > 0) {
$sys_msgs[] = array("mid" => $list[$k]['group_key'], "uid" => $list[$k]['to_user_id'], "status" => 1, "title" => $list[$k]['title'], "time" => pass_date($list[$k]['create_time']));
} else {
$msg_list[] = array("content" => $list[$k]['content'], "uid" => $list[$k]['from_user_id'], "user_name" => $list[$k]['from_user_id'] == $user_data['id'] ? "我" : $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . intval($list[$k]['from_user_id'])), "user_avatar" => get_abs_img_root(get_muser_avatar($list[$k]['from_user_id'], "big")), "tuid" => $list[$k]['to_user_id'], "tuser_name" => $list[$k]['to_user_id'] == $user_data['id'] ? "我" : $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . intval($list[$k]['to_user_id'])), "tuser_avatar" => get_abs_img_root(get_muser_avatar($list[$k]['to_user_id'], "big")), "time" => pass_date($list[$k]['create_time']), "msg_count" => $list[$k]['total'], "mlid" => $list[$k]['group_key']);
}
}
$count = $GLOBALS['db']->getOne($sql_count);
$root['return'] = 1;
$root['sys_msgs'] = $sys_msgs;
$root['msg_list'] = $msg_list;
//分页
$page_info['page'] = $page;
$page_info['page_total'] = ceil($count / $page_size);
$root['page'] = $page_info;
output($root);
}
示例8: index
public function index()
{
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
$root = array();
$user_data = $GLOBALS['user_info'];
//logUtils::log_obj($user_data);
$user_id = intval($user_data['id']);
if ($user_id == 0) {
$root['user_login_status'] = 0;
$root['info'] = "请先登陆";
$root['page_title'] = "登陆";
} else {
$root['user_login_status'] = 1;
$root['info'] = "用户中心";
$root['page_title'] = "用户中心";
$root['uid'] = $user_data['id'];
$root['user_name'] = $user_data['user_name'];
$root['user_email'] = $user_data['email'];
$root['user_money'] = $user_data['money'];
$root['user_money_format'] = format_price($user_data['money']);
//用户金额
$root['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
}
$root['mana_page_title'] = '经理中心';
$root['user'] = $user_data;
$root['city_name'] = $city_name;
output($root);
}
示例9: index
public function index()
{
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
$root = array();
$root['page_title'] = '预约技师';
//检查用户,用户密码
$user = $GLOBALS['user_info'];
$user_id = intval($user['id']);
$root['return'] = 1;
if ($user_id > 0) {
$root['user_login_status'] = 1;
$sql = 'SELECT * FROM ' . DB_PREFIX . 'user WHERE is_effect = 1 AND is_delete = 0 AND service_type_id = 2';
$tech_list = $GLOBALS['db']->getAll($sql);
foreach ($tech_list as $key => $value) {
$p = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['province_id']);
$c = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['city_id']);
for ($i = 0; $i < $value['service_level_id']; $i++) {
$value['tech_level'][] = $i;
}
$value['addr'] = $p['name'] . '-' . $c['name'] . '-' . $value['addr_detail'];
$value['user_avatar'] = get_abs_img_root(get_muser_avatar($value['id'], "big"));
$tech_list[$key] = $value;
}
$root['tech_list'] = $tech_list;
} else {
$root['user_login_status'] = 0;
}
$root['user'] = $user;
$root['city_name'] = $city_name;
output($root);
}
示例10: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$root = array();
$user_data = $GLOBALS['user_info'];
if (intval($user_data['id']) == 0) {
$root['return'] = 0;
$root['info'] = "请先登录";
output($root);
}
if (isset($_FILES['image_1'])) {
//开始上传
//创建avatar临时目录
if (!is_dir(APP_ROOT_PATH . "public/avatar")) {
@mkdir(APP_ROOT_PATH . "public/avatar");
@chmod(APP_ROOT_PATH . "public/avatar", 0777);
}
if (!is_dir(APP_ROOT_PATH . "public/avatar/temp")) {
@mkdir(APP_ROOT_PATH . "public/avatar/temp");
@chmod(APP_ROOT_PATH . "public/avatar/temp", 0777);
}
$img_result = save_image_upload($_FILES, "image_1", "avatar/temp", $whs = array('small' => array(48, 48, 1, 0), 'middle' => array(120, 120, 1, 0), 'big' => array(200, 200, 1, 0)));
//开始移动图片到相应位置
$id = intval($user_data['id']);
$uid = sprintf("%09d", $id);
$dir1 = substr($uid, 0, 3);
$dir2 = substr($uid, 3, 2);
$dir3 = substr($uid, 5, 2);
$path = $dir1 . '/' . $dir2 . '/' . $dir3;
//创建相应的目录
if (!is_dir(APP_ROOT_PATH . "public/avatar/" . $dir1)) {
@mkdir(APP_ROOT_PATH . "public/avatar/" . $dir1);
@chmod(APP_ROOT_PATH . "public/avatar/" . $dir1, 0777);
}
if (!is_dir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2)) {
@mkdir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2);
@chmod(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2, 0777);
}
if (!is_dir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2 . '/' . $dir3)) {
@mkdir(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2 . '/' . $dir3);
@chmod(APP_ROOT_PATH . "public/avatar/" . $dir1 . '/' . $dir2 . '/' . $dir3, 0777);
}
$id = str_pad($id, 2, "0", STR_PAD_LEFT);
$id = substr($id, -2);
$avatar_file_big = APP_ROOT_PATH . "public/avatar/" . $path . "/" . $id . "virtual_avatar_big.jpg";
$avatar_file_middle = APP_ROOT_PATH . "public/avatar/" . $path . "/" . $id . "virtual_avatar_middle.jpg";
$avatar_file_small = APP_ROOT_PATH . "public/avatar/" . $path . "/" . $id . "virtual_avatar_small.jpg";
@file_put_contents($avatar_file_big, file_get_contents($img_result['image_1']['thumb']['big']['path']));
@file_put_contents($avatar_file_middle, file_get_contents($img_result['image_1']['thumb']['middle']['path']));
@file_put_contents($avatar_file_small, file_get_contents($img_result['image_1']['thumb']['small']['path']));
@unlink($img_result['image_1']['thumb']['big']['path']);
@unlink($img_result['image_1']['thumb']['middle']['path']);
@unlink($img_result['image_1']['thumb']['small']['path']);
@unlink($img_result['image_1']['path']);
//end 上传
}
$root['return'] = 1;
$root['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
output($root);
}
示例11: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$root = array();
$email = strim($GLOBALS['request']['email']);
$pwd = strim($GLOBALS['request']['pwd']);
$result = do_login_user($email, $pwd);
$GLOBALS['user_info'] = $user_data = es_session::get('user_info');
$user_data['id'] = intval($user_data['id']);
$page = intval($GLOBALS['request']['page']);
if ($page == 0) {
$page = 1;
}
$home_uid = intval($GLOBALS['request']['uid']);
$home_user_info_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $home_uid . " and is_effect = 1 and is_delete = 0");
if (!$home_user_info_data) {
$root['info'] = "非法的会员";
output($root);
}
$user_info['uid'] = $user_data['id'];
$user_info['email'] = $user_data['email'];
$user_info['user_name'] = $user_data['user_name'];
$user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
$root['user'] = $user_info;
$home_user_info['uid'] = $home_user_info_data['id'];
$home_user_info['email'] = $home_user_info_data['email'];
$home_user_info['user_name'] = $home_user_info_data['user_name'];
$home_user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($home_user_info_data['id'], "big"));
$home_user_info['fans'] = $home_user_info_data['focused_count'];
$home_user_info['follows'] = $home_user_info_data['focus_count'];
$home_user_info['photos'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_image where user_id = " . $home_user_info_data['id']);
$home_user_info['favs'] = $GLOBALS['db']->getOne("select sum(fav_count) from " . DB_PREFIX . "topic where user_id = " . $home_user_info_data['id']);
$root['home_user'] = $home_user_info;
$limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
$follow_list = $GLOBALS['db']->getAll("select focused_user_id as id,focused_user_name as user_name from " . DB_PREFIX . "user_focus where focus_user_id = " . $home_user_info_data['id'] . " order by id desc limit " . $limit);
$total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focus_user_id = " . $home_user_info_data['id']);
$follows = array();
foreach ($follow_list as $k => $v) {
$follows[$k]['uid'] = $v['id'];
$follows[$k]['user_name'] = $v['user_name'];
$follows[$k]['fans'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focused_user_id = " . $v['id']);
$follows[$k]['user_avatar'] = get_abs_img_root(get_muser_avatar($v['id'], "big"));
if ($v['id'] == $user_data['id']) {
$follows[$k]['is_follow'] = -1;
} else {
$focus_uid = intval($v['id']);
$focus_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_info['uid'] . " and focused_user_id = " . $focus_uid);
if ($focus_data) {
$follows[$k]['is_follow'] = 1;
} else {
$follows[$k]['is_follow'] = 0;
}
}
}
$root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
$root['item'] = $follows;
$root['return'] = 1;
$root['status'] = 1;
output($root);
}
示例12: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$user_data = $GLOBALS['user_info'];
$page = intval($GLOBALS['request']['page']) > 0 ? intval($GLOBALS['request']['page']) : 1;
$page_size = PAGE_SIZE;
$limit = ($page - 1) * $page_size . "," . $page_size;
$user_id = intval($GLOBALS['user_info']['id']);
$group_key = addslashes(trim($GLOBALS['request']['mid']));
$sql = "select count(*) as count,max(system_msg_id) as system_msg_id,max(id) as id from " . DB_PREFIX . "msg_box \n\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1)) \n\t\t\t\tand group_key = '" . $group_key . "'";
$row = $GLOBALS['db']->getRow($sql);
if ($row['count'] == 0) {
$root['return'] = 0;
} elseif ($row['system_msg_id'] > 0) {
//系统消息,仅查看
$data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "msg_box where id = " . $row['id'] . " and is_delete = 0");
$GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set is_read = 1 where id = " . $row['id']);
$root['return'] = 1;
$root['msg'] = array('mid' => $group_key, 'title' => $data['title'], 'message' => $data['content'], 'time' => pass_date($data['create_time']));
} else {
$root['return'] = 1;
$root['lid'] = $group_key;
//消息记录
$sql = "select * from " . DB_PREFIX . "msg_box \n\t\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1)) \n\t\t\t\t\tand group_key = '" . $group_key . "' \n\t\t\t\t\torder by create_time desc limit " . $limit;
$sql_count = "select count(*) from " . DB_PREFIX . "msg_box \n\t\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1)) and group_key = '" . $group_key . "'";
$upd_sql = "update " . DB_PREFIX . "msg_box set is_read = 1 \n\t\t\t\t\twhere is_delete = 0 and ((to_user_id = " . $user_id . " and `type` = 0) or (from_user_id = " . $user_id . " and `type` = 1)) \n\t\t\t\t\tand group_key = '" . $group_key . "' ";
$GLOBALS['db']->query($upd_sql);
$list = $GLOBALS['db']->getAll($sql);
foreach ($list as $k => $v) {
if ($v['to_user_id'] != $user_id) {
$dest_user_id = $v['to_user_id'];
break;
}
if ($v['from_user_id'] != $user_id) {
$dest_user_id = $v['from_user_id'];
break;
}
}
$dest_user_name = $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . $dest_user_id);
$root['title'] = "与" . $dest_user_name . "的交流";
$root['t_name'] = $dest_user_name;
$count = $GLOBALS['db']->getOne($sql_count);
$page_info['page'] = $page;
$page_info['page_total'] = ceil($count / $page_size);
$page_info['page_size'] = $page_size;
$root['page'] = $page_info;
$msg_list = array();
foreach ($list as $k => $v) {
$msg_list[] = array("miid" => $v['id'], "mlid" => $v['group_key'], "uid" => $v['from_user_id'], "message" => $v['content'], "time" => pass_date($v['create_time']), "tuid" => $v['to_user_id'], "tuser_name" => $v['to_user_id'] == $user_id ? "我" : $dest_user_name, "tuser_avatar" => get_abs_img_root(get_muser_avatar($v['to_user_id'], "big")), "content" => $v['content'], "user_name" => $v['from_user_id'] == $user_id ? "我" : $dest_user_name, "user_avatar" => get_abs_img_root(get_muser_avatar($v['from_user_id'], "big")));
}
$root['msg_list'] = $msg_list;
}
if (strim($GLOBALS['request']['from']) == "wap") {
$root['f_link_data'] = get_link_list();
$root['email'] = $email;
}
// fwb add 2014-08-27
output($root);
}
示例13: index
public function index()
{
$city_name = strim($GLOBALS['request']['city_name']);
//城市名称
$root = array();
$root['page_title'] = '名下技师';
//检查用户,用户密码
$user = $GLOBALS['user_info'];
$user_id = intval($user['id']);
$root['return'] = 1;
if ($user_id > 0) {
$root['user_login_status'] = 1;
//配置分页参数
require_once APP_ROOT_PATH . "wap/lib/page.php";
$page_size = 10;
$page = intval($GLOBALS['request']['page']);
if ($page == 0) {
$page = 1;
}
$limit = ($page - 1) * $page_size . "," . $page_size;
$sql = 'SELECT
*
FROM
' . DB_PREFIX . 'user
WHERE is_effect = 1
AND is_delete = 0
AND service_type_id = 2
AND p_id =' . $user_id . ' limit ' . $limit;
$sql_count = 'SELECT
count(*)
FROM
' . DB_PREFIX . 'user
WHERE is_effect = 1
AND is_delete = 0
AND service_type_id = 2
AND p_id =' . $user_id;
$tech_list = $GLOBALS['db']->getAll($sql);
foreach ($tech_list as $key => $value) {
$p = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['province_id']);
$c = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $value['city_id']);
for ($i = 0; $i < $value['service_level_id']; $i++) {
$value['tech_level'][] = $i;
}
$value['addr'] = $p['name'] . '-' . $c['name'] . '-' . $value['addr_detail'];
$value['user_avatar'] = get_abs_img_root(get_muser_avatar($value['id'], "big"));
$tech_list[$key] = $value;
}
//配置分页
$count = $GLOBALS['db']->getOne($sql_count);
$page_total = ceil($count / $page_size);
$root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
$root['tech_list'] = $tech_list;
} else {
$root['user_login_status'] = 0;
}
$root['user'] = $user;
$root['city_name'] = $city_name;
output($root);
}
示例14: index
public function index()
{
$root = array();
$id = intval($GLOBALS['request']['id']);
$sql = "select id, title, content from " . DB_PREFIX . "article where is_effect = 1 and is_delete = 0 and id =" . $id;
//echo $sql; exit;
$article = $GLOBALS['db']->getRow($sql);
$root['id'] = $article['id'];
$root['title'] = $article['title'];
$root['content'] = get_abs_img_root($article['content']);
$root['response_code'] = 1;
output($root);
}
示例15: index
public function index()
{
require_once APP_ROOT_PATH . "system/libs/user.php";
$root = array();
$email = strim($GLOBALS['request']['email']);
$pwd = strim($GLOBALS['request']['pwd']);
$result = do_login_user($email, $pwd);
$GLOBALS['user_info'] = $user_data = es_session::get('user_info');
$user_data['id'] = intval($user_data['id']);
$user_info['uid'] = $user_data['id'];
$user_info['email'] = $user_data['email'];
$user_info['user_name'] = $user_data['user_name'];
$user_info['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
$page = intval($GLOBALS['request']['page']);
if ($page == 0) {
$page = 1;
}
$limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
$list = $GLOBALS['db']->getAll("select id,user_name,daren_title from " . DB_PREFIX . "user where is_delete = 0 and is_effect = 1 and is_daren = 1 order by id desc limit " . $limit);
$total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user where is_delete = 0 and is_effect = 1 and is_daren = 1 ");
$darens = array();
foreach ($list as $k => $v) {
$darens[$k]['uid'] = $v['id'];
$darens[$k]['user_name'] = $v['user_name'];
if ($v['daren_title'] != '') {
$darens[$k]['user_name'] .= "[" . $v['daren_title'] . "]";
}
$darens[$k]['fans'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focused_user_id = " . $v['id']);
$darens[$k]['user_avatar'] = get_abs_img_root(get_muser_avatar($v['id'], "big"));
if ($v['id'] == $user_data['id']) {
$darens[$k]['is_follow'] = -1;
} else {
$focus_uid = intval($v['id']);
$focus_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_info['uid'] . " and focused_user_id = " . $focus_uid);
if ($focus_data) {
$darens[$k]['is_follow'] = 1;
} else {
$darens[$k]['is_follow'] = 0;
}
}
}
$root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
$root['item'] = $darens;
$root['return'] = 1;
$root['status'] = 1;
output($root);
}