当前位置: 首页>>代码示例>>PHP>>正文


PHP get_muser_avatar函数代码示例

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


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

示例1: 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);
 }
开发者ID:macall,项目名称:jishida,代码行数:32,代码来源:tech_list.action.php

示例2: 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);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:33,代码来源:message.action.php

示例3: 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);
 }
开发者ID:macall,项目名称:jishida,代码行数:29,代码来源:user_center.action.php

示例4: 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);
 }
开发者ID:macall,项目名称:jsd,代码行数:60,代码来源:avatar.action.php

示例5: 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);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:60,代码来源:followlist.action.php

示例6: 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);
 }
开发者ID:macall,项目名称:jishida,代码行数:59,代码来源:mana_tech_list.action.php

示例7: 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);
 }
开发者ID:macall,项目名称:jsd,代码行数:59,代码来源:msgview.action.php

示例8: index

 public function index()
 {
     require_once APP_ROOT_PATH . "system/model/user.php";
     $email = strim($GLOBALS['request']['email']);
     $pwd = strim($GLOBALS['request']['pwd']);
     $root = array();
     $user_data = $GLOBALS['user_info'];
     $user_data['id'] = intval($user_data['id']);
     $uid = intval($user_data['id']);
     if ($uid == 0) {
         $root['info'] = "请先登陆";
         $root['return'] = 2;
         output($root);
     }
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $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['home_user'] = $root['user'] = $user_info;
     //关注的用户ID
     $uids = $GLOBALS['db']->getOne("select group_concat(focused_user_id) from " . DB_PREFIX . "user_focus where focus_user_id = " . $user_data['id'] . " order by rand() limit 50");
     if ($uids) {
         $uids .= ",0";
     } else {
         $uids = "0";
     }
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $topic_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and user_id in (" . $uids . ") order by create_time desc limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and user_id in (" . $uids . ") ");
     foreach ($topic_list as $k => $v) {
         $topic_list[$k] = m_get_topic_item($v);
         if ($v['fav_id'] > 0 || $v['relay_id'] > 0) {
             $relay_share = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and id = " . $v['origin_id']);
         }
         if ($relay_share) {
             $topic_list[$k]['relay_share'] = m_get_topic_item($relay_share);
         }
     }
     $root['return'] = 1;
     $root['item'] = $topic_list;
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE), "page_size" => PAGE_SIZE);
     output($root);
 }
开发者ID:macall,项目名称:jsd,代码行数:47,代码来源:ufollow.action.php

示例9: 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);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:47,代码来源:darens.action.php

示例10: index

 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $root['page_title'] = '技师详情';
     $root['mana_page_title'] = '客户资料';
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root['return'] = 1;
     if ($user_id > 0) {
         $m_user_id = $GLOBALS['request']['m_user_id'];
         $root['user_login_status'] = 1;
         $sql = 'SELECT 
                     * 
                   FROM
                     ' . DB_PREFIX . 'user 
                   WHERE id =' . $m_user_id;
         $m_user = $GLOBALS['db']->getRow($sql);
         //地址
         $p = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $m_user['province_id']);
         $c = $GLOBALS['db']->getRow("select name from " . DB_PREFIX . "region_conf where id = " . $m_user['city_id']);
         $m_user['addr'] = $p['name'] . '-' . $c['name'] . '-' . $m_user['addr_detail'];
         //星级
         for ($i = 0; $i < $m_user['service_level_id']; $i++) {
             $m_user['tech_level'][] = $i;
         }
         //性别
         if ($m_user['sex'] == 1) {
             $m_user['sex'] = '男';
         } elseif ($m_user['sex'] == 0) {
             $m_user['sex'] = '女';
         } else {
             $m_user['sex'] = '保密';
         }
         //头像
         $m_user['user_avatar'] = get_abs_img_root(get_muser_avatar($m_user_id, "big"));
         $root['m_user'] = $m_user;
     } else {
         $root['user_login_status'] = 0;
     }
     $root['user'] = $user;
     $root['city_name'] = $city_name;
     output($root);
 }
开发者ID:macall,项目名称:jishida,代码行数:46,代码来源:mana_user_detail.action.php

示例11: index

 public function index()
 {
     /*
     	$email = strim($GLOBALS['request']['email']);//用户名或邮箱
     	if (isset($GLOBALS['request']['old_pwd'])){
     		$pwd = strim($GLOBALS['request']['old_pwd']);//密码
     	}else{
     		$pwd = strim($GLOBALS['request']['pwd']);//密码
     	}
     */
     $new_pwd = strim($GLOBALS['request']['newpassword']);
     //新密码
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     //检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root = array();
     $root['page_title'] = '修改密码';
     $root['user_name'] = $user['user_name'];
     $root['city_name'] = $city_name;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         if (strlen($GLOBALS['request']['newpassword']) < 4) {
             $root['return'] = 0;
             $root['info'] = "注册密码不能少于4位";
             output($root);
         }
         $new_pwd = md5($new_pwd);
         $sql = "update " . DB_PREFIX . "user set user_pwd = '" . $new_pwd . "' where id = {$user_id}";
         $GLOBALS['db']->query($sql);
         $root['return'] = 1;
         $root['uid'] = $user_id;
         $root['email'] = $user['email'];
         $root['user_name'] = $user['user_name'];
         $root['user_pwd'] = $new_pwd;
         $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user['id'], "big"));
         $root['info'] = "密码更新成功!";
     } else {
         $root['return'] = 0;
         $root['user_login_status'] = 0;
         $root['info'] = "原始密码不正确";
     }
     output($root);
 }
开发者ID:macall,项目名称:jsd,代码行数:45,代码来源:pwd.action.php

示例12: 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);
     $user_data = es_session::get('user_info');
     $user_data['id'] = intval($user_data['id']);
     $uid = intval($user_data['id']);
     if ($uid == 0) {
         $root['return'] = 0;
         $root['info'] = "请先登陆";
         output($root);
     }
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     //输出回复
     $sql = "select r.* from " . DB_PREFIX . "topic_reply as r left join " . DB_PREFIX . "topic as t on r.topic_id = t.id \r\n\t\t\t\twhere (t.user_id = " . $uid . " or r.user_id = " . $uid . ") and r.is_effect = 1 and r.is_delete = 0 \r\n\t\t\t\torder by r.create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "topic_reply as r left join " . DB_PREFIX . "topic as t on r.topic_id = t.id \r\n\t\t\t\twhere (t.user_id = " . $uid . " or r.user_id = " . $uid . ") and r.is_effect = 1 and r.is_delete = 0";
     $list = $GLOBALS['db']->getAll($sql);
     $total = $GLOBALS['db']->getOne($sql_count);
     $comment_list = array();
     foreach ($list as $k => $v) {
         $comment_list[$k]['comment_id'] = $v['id'];
         $comment_list[$k]['share_id'] = $v['topic_id'];
         $comment_list[$k]['uid'] = $v['user_id'];
         $comment_list[$k]['parent_id'] = $v['reply_id'];
         $comment_list[$k]['content'] = $v['content'];
         $comment_list[$k]['create_time'] = $v['create_time'];
         $topic = $GLOBALS['db']->getRow("select user_name,content from " . DB_PREFIX . "topic where id = " . $v['topic_id']);
         $comment_list[$k]['scontent'] = "//@" . $topic['user_name'] . ":" . $topic['content'];
         $comment_list[$k]['user_name'] = $v['user_name'];
         $comment_list[$k]['user_avatar'] = get_abs_img_root(get_muser_avatar($v['user_id'], "big"));
         $comment_list[$k]['time'] = pass_date($v['create_time']);
         $comment_list[$k]['parse_expres'] = get_parse_expres($comment_list[$k]['content'] . $comment_list[$k]['scontent']);
         $comment_list[$k]['parse_user'] = get_parse_user($comment_list[$k]['content'] . $comment_list[$k]['scontent']);
     }
     $root['item'] = $comment_list;
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
     $root['return'] = 1;
     output($root);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:45,代码来源:ucommentlist.action.php

示例13: index

 public function index()
 {
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $new_pwd = strim($GLOBALS['request']['newpassword']);
     //新密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     $root = array();
     if ($user_id > 0) {
         $root['user_login_status'] = 0;
         if (strlen($GLOBALS['request']['newpassword']) < 4) {
             $root['return'] = 0;
             $root['info'] = "注册密码不能少于4位";
             output($root);
         }
         if ($new_pwd != $pwd) {
             $sql = "update " . DB_PREFIX . "user set user_pwd = '" . md5($new_pwd) . "' where id = {$user_id}";
             $GLOBALS['db']->query($sql);
             $rs = $GLOBALS['db']->affected_rows();
         } else {
             $rs = 1;
         }
         if ($rs > 0) {
             $root['return'] = 1;
             $root['uid'] = $user_id;
             $root['email'] = $user['email'];
             $root['user_name'] = $user['user_name'];
             $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user['id'], "big"));
             $root['info'] = "密码更新成功!";
         } else {
             $root['return'] = 0;
             $root['info'] = "密码更新失败!";
         }
     } else {
         $root['return'] = 0;
         $root['user_login_status'] = 1;
         $root['info'] = "原始密码不正确";
     }
     output($root);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:44,代码来源:pwd.action.php

示例14: 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);
     $user_data = es_session::get('user_info');
     $uid = intval($user_data['id']);
     if ($uid == 0) {
         $root['info'] = "请先登陆";
         output($root);
     }
     $page = intval($GLOBALS['request']['page']);
     if ($page == 0) {
         $page = 1;
     }
     $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['home_user'] = $root['user'] = $user_info;
     $limit = ($page - 1) * PAGE_SIZE . "," . PAGE_SIZE;
     $user_name = $user_data['user_name'];
     $user_name_unicode = str_to_unicode_string($user_name);
     $condition = " match(user_name_match) against('" . $user_name_unicode . "' IN BOOLEAN MODE) ";
     $topic_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and " . $condition . " order by create_time desc limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and " . $condition);
     foreach ($topic_list as $k => $v) {
         $topic_list[$k] = m_get_topic_item($v);
         if ($v['fav_id'] > 0 || $v['relay_id'] > 0) {
             $relay_share = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and id = " . $v['origin_id']);
         }
         if ($relay_share) {
             $topic_list[$k]['relay_share'] = m_get_topic_item($relay_share);
         }
     }
     $root = array();
     $root['return'] = 1;
     $root['item'] = $topic_list;
     $root['page'] = array("page" => $page, "page_total" => ceil($total / PAGE_SIZE));
     output($root);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:42,代码来源:atmelist.action.php

示例15: index

 public function index()
 {
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $root = array();
     $root['return'] = 1;
     $city_id = intval($GLOBALS['request']['city_id']);
     $user_data = $GLOBALS['user_info'];
     $ytop = $latitude_top = floatval($GLOBALS['request']['latitude_top']);
     //最上边纬线值 ypoint
     $ybottom = $latitude_bottom = floatval($GLOBALS['request']['latitude_bottom']);
     //最下边纬线值 ypoint
     $xleft = $longitude_left = floatval($GLOBALS['request']['longitude_left']);
     //最左边经度值  xpoint
     $xright = $longitude_right = floatval($GLOBALS['request']['longitude_right']);
     //最右边经度值 xpoint
     $m_distance = doubleval($GLOBALS['request']['m_distance']);
     //范围(米)
     $ypoint = $m_latitude = doubleval($GLOBALS['request']['m_latitude']);
     //ypoint
     $xpoint = $m_longitude = doubleval($GLOBALS['request']['m_longitude']);
     //xpoint
     $page = intval($GLOBALS['request']['page']);
     //分页
     $page = $page == 0 ? 1 : $page;
     $page_size = PAGE_SIZE;
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $pi = 3.14159265;
     //圆周率
     $r = 6378137;
     //地球平均半径(米)
     $sql_count = "select count(*) from " . DB_PREFIX . "user ";
     $sql = "select id,xpoint,ypoint,locate_time,user_name,daren_title, sex,\n\t\t\t\t(ACOS(SIN(({$ypoint} * {$pi}) / 180 ) *SIN((ypoint * {$pi}) / 180 ) +COS(({$ypoint} * {$pi}) / 180 ) * COS((ypoint * {$pi}) / 180 ) *COS(({$xpoint} * {$pi}) / 180 - (xpoint * {$pi}) / 180 ) ) * {$r}) as distance  \n\t\t\t\tfrom " . DB_PREFIX . "user ";
     if ($ybottom != 0 && $ytop != 0 && $xleft != 0 && $xright != 0) {
         $where = " ypoint > {$ybottom} and ypoint < {$ytop} and xpoint > {$xleft} and xpoint < {$xright}  and is_effect = 1 and is_delete = 0 ";
     } else {
         $where = " is_effect = 1 and is_delete = 0 ";
     }
     $sql .= " where " . $where;
     $sql .= " order by distance asc ";
     $sql_count .= " where " . $where;
     $sql .= " limit " . $limit;
     $total = $GLOBALS['db']->getOne($sql_count);
     $page_total = ceil($total / $page_size);
     $list = $GLOBALS['db']->getAll($sql);
     foreach ($list as $k => $item) {
         $item['uid'] = $item['id'];
         if ($item['daren_title'] != '') {
             $item['user_name'] .= "[" . $item['daren_title'] . "]";
         }
         $item['fans'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_focus where focused_user_id = " . $item['id']);
         $item['user_avatar'] = get_abs_img_root(get_muser_avatar($item['id'], "big"));
         if ($item['id'] == $user_data['id']) {
             $item['is_follow'] = -1;
         } else {
             $focus_uid = intval($item['id']);
             $focus_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_focus where focus_user_id = " . intval($user_data['id']) . " and focused_user_id = " . intval($focus_uid));
             if ($focus_data) {
                 $item['is_follow'] = 1;
             } else {
                 $item['is_follow'] = 0;
             }
         }
         $item['locate_time_format'] = pass_date($item['locate_time']);
         $item['distance'] = round($item['distance']);
         $list[$k] = $item;
     }
     $root['email'] = $email;
     //fwb add 2014-08-27
     $root['item'] = $list;
     $root['page'] = array("page" => $page, "page_total" => $page_total, "page_size" => $page_size);
     output($root);
 }
开发者ID:macall,项目名称:jsd,代码行数:72,代码来源:nearbyuser.action.php


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