function usesubmit()
 {
     global $_G;
     $list = $uids = array();
     $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10;
     $limit = $num + 20;
     $giftMagicID = C::t('common_magic')->fetch_by_identifier('gift');
     $mid = $giftMagicID['available'] ? intval($giftMagicID['magicid']) : 0;
     if ($mid) {
         foreach (C::t('common_magiclog')->fetch_all_by_magicid_action_uid($mid, 2, $_G['uid'], 0, $limit) as $value) {
             $uids[] = intval($value['uid']);
         }
     }
     if ($uids) {
         $counter = 0;
         $members = C::t('common_member')->fetch_all($uids);
         foreach (C::t('common_member_field_home')->fetch_all($uids) as $uid => $value) {
             $value = array_merge($members[$uid], $value);
             $info = !empty($value['magicgift']) ? unserialize($value['magicgift']) : array();
             if (!empty($info['left']) && (empty($info['receiver']) || !in_array($_G['uid'], $info['receiver']))) {
                 $value['avatar'] = addcslashes(avatar($uid, 'small'), "'");
                 $list[$uid] = $value;
                 $counter++;
                 if ($counter >= $num) {
                     break;
                 }
             }
         }
     }
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
     $op = 'show';
     include template('home/magic_detector');
 }
 /**
  * 显示评论列表
  */
 public function showlist()
 {
     global $G, $lang;
     $dataid = intval($_GET['dataid']);
     $idtype = trim($_GET['idtype']);
     if (!$dataid || !$idtype) {
         $this->showAppError(-1, 'parameter error', array('dataid' => $dataid, 'idtype' => $idtype));
     }
     $pagesize = isset($_GET['pagesize']) ? intval($_GET['pagesize']) : 20;
     $commentlist = $this->t('comment')->where(array('dataid' => $dataid, 'idtype' => $idtype))->order('cid DESC')->page($G['page'], $pagesize)->select();
     if ($commentlist) {
         $newlist = array();
         foreach ($commentlist as $list) {
             $list['dateline'] = @date('Y-m-d H:i', $list['dateline']);
             $list['userpic'] = avatar($list['uid']);
             $newlist[] = $list;
         }
         $commentlist = $newlist;
     } else {
         $commentlist = array();
     }
     if ($_GET['datatype'] == 'json') {
         $this->showAppData($commentlist);
     } else {
         include template('comment_list', 'app');
     }
 }
 function getdata($style, $parameter)
 {
     global $_G, $_lang;
     require_once DISCUZ_ROOT . './source/plugin/house/include/config.inc.php';
     $array = $list = array();
     $where = " GROUP BY member_uid ";
     if ($parameter['kind'] == 'new') {
         $where .= " ORDER BY post_time DESC ";
     } elseif ($parameter['kind'] == 'hot') {
         $where .= " ORDER BY post_view DESC ";
     }
     $sql = "SELECT *,count(post_id) as count FROM " . DB::table("house_post") . $where . " LIMIT " . $parameter['items'];
     $query = DB::query($sql);
     while ($tem = DB::fetch($query)) {
         $fields['id'] = $tem['post_id'];
         $fields['url'] = $house_config['root'] . "?mod=view&post_id=" . $tem['post_id'];
         $fields['title'] = $tem['post_title'];
         $fields['text'] = $tem['post_text'];
         $fields['img'] = avatar($tem['member_uid'], "big");
         $fields['uid'] = $tem['member_uid'];
         $fields['username'] = $tem['member_title'];
         $fields['time'] = date($parameter['dateformat'], $tem['post_time']);
         $fields['view'] = $tem['post_view'];
         $fields['count'] = $tem['count'];
         $picflag = !empty($fields['img']) ? 1 : 0;
         $list[] = array('id' => $fields['id'], 'idtype' => 'id', 'title' => $fields['title'], 'url' => $fields['url'], 'pic' => $fields['img'], 'picflag' => $picflag, 'summary' => $fields['text'], 'fields' => $fields);
     }
     return array('html' => '', 'data' => $list);
 }
 function usesubmit()
 {
     global $_G;
     $id = intval($_GET['id']);
     $idtype = $_GET['idtype'];
     $blog = magic_check_idtype($id, $idtype);
     $num = 10;
     $list = $ids = $note_inserts = array();
     $fusername = dimplode($_POST['fusername']);
     if ($fusername) {
         $query = C::t('home_friend')->fetch_all_by_uid_username($_G['uid'], $_POST['fusername'], 0, $num);
         $note = lang('spacecp', 'magic_call', array('url' => "home.php?mod=space&uid={$_G['uid']}&do=blog&id={$id}"));
         foreach ($query as $value) {
             $ids[] = $value['fuid'];
             $value['avatar'] = str_replace("'", "\\'", avatar($value[fuid], 'small'));
             $list[] = $value;
             $note_inserts[] = array('uid' => $value['fuid'], 'type' => $name, 'new' => 1, 'authorid' => $_G['uid'], 'author' => $_G['username'], 'note' => $note, 'dateline' => $_G['timestamp']);
         }
     }
     if (empty($ids)) {
         showmessage('magicuse_has_no_valid_friend');
     }
     foreach ($note_inserts as $note_insert) {
         C::t('home_notification')->insert($note_insert);
     }
     C::t('common_member')->increase($ids, array('newprompt' => 1));
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id);
     $op = 'show';
     include template('home/magic_call');
 }
Exemple #5
0
 function getdata($style, $parameter)
 {
     global $_G;
     $parameter = $this->cookparameter($parameter);
     $uids = isset($parameter['uids']) && !in_array(0, (array) $parameter['uids']) ? $parameter['uids'] : '';
     $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0;
     $items = isset($parameter['items']) ? intval($parameter['items']) : 10;
     $titlelength = intval($parameter['titlelength']);
     $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'], array('dateline', 'replynum')) ? $parameter['orderby'] : 'dateline';
     $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
     $datalist = $list = array();
     $wheres = array();
     if ($uids) {
         $wheres[] = 'uid IN (' . dimplode($uids) . ')';
     }
     if ($bannedids) {
         $wheres[] = 'doid NOT IN (' . dimplode($bannedids) . ')';
     }
     $wheres[] = " status = '0'";
     $wheresql = $wheres ? implode(' AND ', $wheres) : '1';
     $query = DB::query("SELECT * FROM " . DB::table('home_doing') . " WHERE {$wheresql} ORDER BY {$orderby} DESC LIMIT {$startrow},{$items}");
     while ($data = DB::fetch($query)) {
         $datalist = array('id' => $data['doid'], 'idtype' => 'doid', 'title' => cutstr(strip_tags($data['message']), $titlelength, ''), 'url' => 'home.php?mod=space&uid=' . $data['uid'] . '&do=doing&doid=' . $data['doid'], 'pic' => '', 'summary' => '', 'fields' => array('fulltitle' => strip_tags($data['message']), 'uid' => $data['uid'], 'username' => $data['username'], 'avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']), 'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']), 'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']), 'dateline' => $data['dateline'], 'replynum' => $data['replynum']));
         if ($titlelength) {
             $datalist['title'] = cutstr(strip_tags($data['message']), $titlelength);
         } else {
             $datalist['title'] = strip_tags($data['message'], '<img>');
         }
         $list[] = $datalist;
     }
     return array('html' => '', 'data' => $list);
 }
 function usesubmit()
 {
     global $_G;
     $list = $uids = array();
     $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10;
     $limit = $num + 20;
     loadcache('magics');
     $mid = !empty($_G['magics']['gift']) ? intval($_G['magics']['gift']['magicid']) : 0;
     if ($mid) {
         $query = DB::query('SELECT * FROM ' . DB::table('common_magiclog') . " WHERE magicid = '{$mid}' AND action='2' AND uid != '{$_G['uid']}' ORDER BY dateline DESC LIMIT 0,{$limit}");
         while ($value = DB::fetch($query)) {
             $uids[] = intval($value['uid']);
         }
     }
     if ($uids) {
         $counter = 0;
         $query = DB::query('SELECT m.username, mfh.uid, mfh.magicgift FROM ' . DB::table('common_member') . " m LEFT JOIN " . DB::table('common_member_field_home') . " mfh USING(uid) WHERE m.uid IN (" . dimplode($uids) . ")");
         while ($value = DB::fetch($query)) {
             $info = !empty($value['magicgift']) ? unserialize($value['magicgift']) : array();
             if (!empty($info['left']) && (empty($info['receiver']) || !in_array($_G['uid'], $info['receiver']))) {
                 $value['avatar'] = addcslashes(avatar($value['uid'], 'small'), "'");
                 $list[$value['uid']] = $value;
                 $counter++;
                 if ($counter >= $num) {
                     break;
                 }
             }
         }
     }
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
     $op = 'show';
     include template('home/magic_detector');
 }
Exemple #7
0
 public function index()
 {
     if ($this->uri->segment(2)) {
         redirect('/');
     }
     if ($this->session->userdata('logged_in')) {
         define('INGAME', TRUE);
         $this->output->enable_profiler($this->config->item('debug'));
         $this->lang->load('ingame');
         $user = $this->user->data($this->session->userdata('user_id'));
         $country = $this->user->data($user->country, 'countries');
         date_default_timezone_set($user->timezone);
         $panel['avatar'] = avatar($user, $this->lang->lang());
         $panel['user'] = $user;
         $panel['exp_prcnt'] = exp_percent($user);
         $panel['l18n'] = l18n($this->lang->lang());
         $panel['currency'] = $country->currency;
         $head['help'] = lang('ingame.help');
         $head['menu'] = $this->load->view('menu_ingame', '', TRUE);
         $head['panel'] = $this->load->view('panel', $panel, TRUE);
         $data['user'] = $user;
         $data['head'] = $this->load->view('head', $head, TRUE);
         $data['footer'] = $this->load->view('footer', '', TRUE);
         $data['country'] = $country;
         $this->load->view('ingame', $data);
     } else {
         $this->output->enable_profiler($this->config->item('debug'));
         $this->lang->load('login');
         $head['menu'] = $this->load->view('menu_outgame', '', TRUE);
         $data['head'] = $this->load->view('head', $head, TRUE);
         $data['footer'] = $this->load->view('footer', '', TRUE);
         $this->load->view('login', $data);
     }
 }
 /**
  * 新用户注册
  */
 public function register()
 {
     global $G;
     $username = htmlspecialchars(trim($_GET['username']));
     $mobile = trim($_GET['mobile']);
     $password = trim($_GET['password']);
     if (!$username) {
         $this->showAppError(-1, '用户名输入错误', array('username' => $username));
     }
     if ($this->_verifyUsername($username)) {
         $this->showAppError(-2, '用户名已被人使用', array('username' => $username));
     }
     if (!ismobile($mobile)) {
         $this->showAppError(-3, '手机号输入错误', array('mobile' => $mobile));
     }
     if ($this->_verifyMobile($mobile)) {
         $this->showAppError(-4, '手机号已被注册', array('mobile' => $mobile));
     }
     if (strlen($password) < 6) {
         $this->showAppError(-5, '密码输入错误', array('password' => $password));
     }
     $member = new Member();
     $returns = $member->register($username, $password, $mobile, 'mobile');
     if ($member->uid > 0) {
         $returns['userpic'] = avatar($member->uid);
         $this->showAppData($returns);
     } else {
         $this->showAppError(-6, '注册失败', array('info' => 'system error'));
     }
 }
    public function run()
    {
        global $_FANWE;
        $root = array();
        $root['return'] = 1;
        $share_id = (int) $_FANWE['requestData']['share_id'];
        $page = (int) $_FANWE['requestData']['page'];
        $page = max(1, $page);
        $sql_count = "SELECT COUNT(DISTINCT comment_id) FROM " . FDB::table("share_comment") . " WHERE share_id = " . $share_id;
        $total = FDB::resultFirst($sql_count);
        $page_size = PAGE_SIZE;
        $page_total = ceil($total / $page_size);
        if ($page > $page_total) {
            $page = $page_total;
        }
        $limit = ($page - 1) * $page_size . "," . $page_size;
        $sql = 'SELECT c.*,u.user_name,u.server_code FROM ' . FDB::table('share_comment') . ' AS c 
			INNER JOIN ' . FDB::table('user') . ' AS u ON u.uid = c.uid 
			WHERE c.share_id = ' . $share_id . ' ORDER BY c.comment_id DESC LIMIT ' . $limit;
        $res = FDB::query($sql);
        $list = array();
        while ($item = FDB::fetch($res)) {
            $item['user_avatar'] = avatar($item['uid'], 'm', $item['server_code'], 1, true);
            $item['time'] = getBeforeTimelag($item['create_time']);
            m_express(&$item, $item['content']);
            $list[] = $item;
        }
        $root['item'] = $list;
        $root['page'] = array("page" => $page, "page_total" => $page_total);
        m_display($root);
    }
Exemple #10
0
 public function output()
 {
     global $_G;
     if (true === BigAppConf::$debug) {
         $_G['trace'][] = __CLASS__ . '::' . __FUNCTION__;
     }
     loadcache('forums');
     foreach ($GLOBALS['data']['hot']['threadlist'] as $tid => &$thread) {
         if (!isset($_G['cache']['stamps'][$thread['icon']]['url'])) {
             $thread['icon'] = -1;
         }
         $thread['forum_name'] = $_G['cache']['forums'][$thread['fid']]['name'];
     }
     //echo json_encode($GLOBALS['data']['hot']['threadlist']);
     //die(0);
     unset($thread);
     $GLOBALS['data']['hot']['threadlist'] = bigapp_core::getvalues($GLOBALS['data']['hot']['threadlist'], array('/^\\d+$/'), array('tid', 'attachment', 'avatar', 'subject', 'author', 'views', 'replies', 'forum_name', 'authorid', 'dateline'));
     if (is_null($GLOBALS['data']['hot']['threadlist']) || !is_array($GLOBALS['data']['hot']['threadlist'])) {
         $GLOBALS['data']['hot']['threadlist'] = array();
     }
     foreach ($GLOBALS['data']['hot']['threadlist'] as $tid => $thread) {
         $GLOBALS['data']['hot']['threadlist'][$tid]['avatar'] = avatar($thread['authorid'], 'big', true);
         $GLOBALS['data']['hot']['threadlist'][$tid]['dateline'] = str_replace('&nbsp;', '', $GLOBALS['data']['hot']['threadlist'][$tid]['dateline']);
     }
     /////////////////////////////////////////////////////////////////
     BigAppAPI::_getDetails($GLOBALS['data']['hot']['threadlist']);
     /////////////////////////////////////////////////////////////////
     $variable = array('data' => array_values($GLOBALS['data']['hot']['threadlist']), 'perpage' => $GLOBALS['perpage']);
     bigapp_core::result(bigapp_core::variable($variable));
 }
Exemple #11
0
 function usesubmit()
 {
     global $_G;
     $id = intval($_G['gp_id']);
     $idtype = $_G['gp_idtype'];
     $blog = magic_check_idtype($id, $idtype);
     $num = 10;
     $list = $ids = $note_inserts = array();
     $fusername = dimplode($_POST['fusername']);
     if ($fusername) {
         $query = DB::query('SELECT * FROM ' . DB::table('home_friend') . " WHERE uid='{$_G['uid']}' AND fusername IN (" . $fusername . ") LIMIT {$num}");
         $note = lang('spacecp', 'magic_call', array('url' => "home.php?mod=space&uid={$_G['uid']}&do=blog&id={$id}"));
         while ($value = DB::fetch($query)) {
             $ids[] = $value['fuid'];
             $value['avatar'] = str_replace("'", "\\'", avatar($value[fuid], 'small'));
             $list[] = $value;
             $note_inserts[] = "('{$value['fuid']}', '{$name}', '1', '{$_G['uid']}', '{$_G['username']}', '{$note}', '{$_G['timestamp']}')";
         }
     }
     if (empty($ids)) {
         showmessage('magicuse_has_no_valid_friend');
     }
     DB::query('INSERT INTO ' . DB::table('home_notification') . '(uid, type, new, authorid, author, note, dateline) VALUES ' . implode(',', $note_inserts));
     DB::query('UPDATE ' . DB::table('common_member') . ' SET newprompt = newprompt + 1 WHERE uid IN (' . dimplode($ids) . ')');
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', $idtype, $id);
     $op = 'show';
     include template('home/magic_call');
 }
Exemple #12
0
 public function index()
 {
     if ($this->uri->segment(3)) {
         redirect('market');
     }
     if ($this->session->userdata('logged_in')) {
         define('INGAME', TRUE);
         define('AJAX', TRUE);
         $this->output->enable_profiler($this->config->item('debug'));
         $this->lang->load('market');
         $this->lang->load('ingame');
         $user = $this->user->data($this->session->userdata('user_id'));
         $country = $this->user->data($user->country, 'countries');
         date_default_timezone_set($user->timezone);
         $panel['avatar'] = avatar($user, $this->lang->lang());
         $panel['user'] = $user;
         $panel['exp_prcnt'] = exp_percent($user);
         $panel['l18n'] = l18n($this->lang->lang());
         $panel['currency'] = $country->currency;
         $script['img'] = loading(lang('overal.loading'));
         $head['panel'] = $this->load->view('panel', $panel, TRUE);
         $head['help'] = lang('ingame.help');
         $head['menu'] = $this->load->view('menu_ingame', '', TRUE);
         $head['script'] = $this->load->view('market/market_ajax', $script, TRUE);
         $data['head'] = $this->load->view('head', $head, TRUE);
         $data['footer'] = $this->load->view('footer', '', TRUE);
         $data['is_society'] = $this->user->has_company();
         $this->load->view('market/market', $data);
     } else {
         log_message('error', 'User with IP ' . $this->input->ip_address() . ' has tried to enter /market without loggin in.');
         redirect('/');
     }
 }
 public function run()
 {
     global $_FANWE;
     $root = array();
     $root['return'] = 0;
     $data = array('email' => $_FANWE['requestData']['email'], 'user_name' => $_FANWE['requestData']['user_name'], 'password' => $_FANWE['requestData']['password'], 'gender' => intval($_FANWE['requestData']['gender']));
     $vservice = FS('Validate');
     $validate = array(array('email', 'required', lang('user', 'register_email_require')), array('email', 'email', lang('user', 'register_email_error')), array('user_name', 'required', lang('user', 'register_user_name_require')), array('user_name', 'range_length', lang('user', 'register_user_name_len'), 2, 20), array('user_name', '/^[\\x{4e00}-\\x{9fa5}a-zA-Z][\\x{4e00}-\\x{9fa5}a-zA-Z0-9]+$/u', lang('user', 'register_user_name_error')), array('password', 'range_length', lang('user', 'register_password_range'), 6, 20));
     if (!$vservice->validation($validate, $data)) {
         $root['info'] = "注册失败:" . $vservice->getError();
         m_display($root);
     }
     $uservice = FS('User');
     if ($uservice->getEmailExists($data['email'])) {
         $root['info'] = "注册失败:" . lang('user', 'register_email_exist');
         m_display($root);
     }
     if ($uservice->getUserNameExists($data['user_name'])) {
         $root['info'] = "注册失败:" . lang('user', 'register_user_name_exist');
         m_display($root);
     }
     //================add by chenfq 2011-10-14 =======================
     $user_field = $_FANWE['setting']['integrate_field_id'];
     $integrate_id = FS("Integrate")->addUser($data['user_name'], $data['password'], $data['email']);
     if ($integrate_id < 0) {
         $info = FS("Integrate")->getInfo();
         $root['info'] = "注册失败:" . $info;
         m_display($root);
     }
     //================add by chenfq 2011-10-14=======================
     $user = array('email' => $data['email'], 'user_name' => $data['user_name'], 'user_name_match' => segmentToUnicode($data['user_name']), 'password' => md5($data['password']), 'status' => 1, 'email_status' => 0, 'avatar_status' => 0, 'gid' => 7, 'invite_id' => FS('User')->getReferrals(), 'reg_time' => TIME_UTC, $user_field => $integrate_id);
     $uid = FDB::insert('user', $user, true);
     if ($uid > 0) {
         $_FANWE['uid'] = $uid;
         FDB::insert('user_count', array('uid' => $uid));
         if ($user['invite_id'] > 0) {
             FS('User')->insertReferral($uid, $user['invite_id'], $user['user_name']);
         }
         FS("User")->updateUserScore($uid, 'user', 'register');
         unset($user);
         $user_profile = array('uid' => $uid, 'gender' => $data['gender']);
         FDB::insert('user_profile', $user_profile);
         unset($user_profile);
         $user_status = array('uid' => $uid, 'reg_ip' => $_FANWE['client_ip'], 'last_ip' => $_FANWE['client_ip'], 'last_time' => TIME_UTC, 'last_activity' => TIME_UTC);
         FDB::insert('user_status', $user_status);
         $root['return'] = 1;
         $root['info'] = "用户注册成功";
         $root['uid'] = $uid;
         $root['user_name'] = $data['user_name'];
         $root['user_avatar'] = avatar($uid, 'm', '', 1, true);
         $root['user_email'] = $data['email'];
         $deviceuid = addslashes(trim($_FANWE['requestData']['deviceuid']));
         $sql = "update " . FDB::table('apns_devices') . " set clientid = " . $uid . " where clientid = 0 and deviceuid = '" . $deviceuid . "'";
         FDB::query($sql);
     } else {
         $root['info'] = lang('user', 'register_error');
     }
     m_display($root);
 }
 public function index()
 {
     global $G, $lang;
     $avatarsmall = avatar($this->uid, 'small');
     $avatarmiddle = avatar($this->uid, 'middle');
     $avatarbig = avatar($this->uid, 'big');
     include template('avatar');
 }
function getuserpic($user)
{
    if ($user[picurl]) {
        return $user[picurl];
    }
    $picurl = avatar($user[username], $user['uid']);
    return $picurl;
}
Exemple #16
0
 function output()
 {
     global $_G;
     foreach ($GLOBALS['data']['hot']['threadlist'] as $tid => $thread) {
         $GLOBALS['data']['hot']['threadlist'][$tid]['avatar'] = avatar($thread['authorid'], 'big', true);
     }
     $variable = array('data' => array_values($GLOBALS['data']['hot']['threadlist']), 'perpage' => $GLOBALS['perpage']);
     mobile_core::result(mobile_core::variable($variable));
 }
 function main()
 {
     global $_G;
     $type = trim($_GET[type]);
     $id = intval($_GET[id]);
     if (!$_G[setting][say_status]) {
         json(array('msg' => '系统已关闭评论', 'data' => -1));
     }
     if (!$id) {
         json(array('msg' => '分类id不存在'));
     }
     if (!$type) {
         json(array('msg' => '获取的类型不存在'));
     }
     if (!preg_match("/^[a-z_]+\$/", $type)) {
         json(array('msg' => '类型格式不正确'));
     }
     if (!array_key_exists($type, $_G[setting][comment_types])) {
         json(array('msg' => '当前模块不允许评论或留言'));
     }
     $page_size = $_G[setting][comment_page_size];
     $and = " AND  type_id = {$id} AND type = '{$type}'  AND  `check` = 1   AND is_reply = 0 ";
     if ($_GET['num_iid']) {
         $and .= " AND num_iid = " . trim_html($_GET['num_iid']);
     }
     $rs = D(array('and' => $and, 'order' => ' id DESC  ', 'table' => 'comment'), array('size' => $page_size, 'url' => ''));
     $comment = array();
     foreach ($rs[goods] as $k => $v) {
         //$tmp = array('id'=>$v['id'],'uid'=>$v[uid],'username'=>$v[username],'content'=>$v[content],'ip'=>$v[ip],'user_pic'=> $v['user_pic'],'dateline'=>$v[dateline]);
         //$user_picurl = DB::fetch_first("SELECT picurl FROM ".DB::table('member')." WHERE uid = ".$v['uid']);
         $v['user_pic'] = avatar($v['username'], $v['uid']);
         //if($user_picurl['picurl'])$v['user_pic'] = $user_picurl['picurl'];
         $and2 = "AND type = '{$type}' AND type_id = " . $v[type_id] . "  AND  `check` = 1   AND is_reply=1 AND reply_id = " . $v[id];
         if ($_GET['num_iid']) {
             $and2 .= " AND num_iid = " . trim_html($_GET['num_iid']);
         }
         $v[comment_list] = D(array('table' => 'comment', 'and' => $and2, 'order' => ' id DESC ', 'limit' => 30));
         $comment[] = $v;
     }
     $max_page = ceil($rs[count] / $page_size);
     if ($_G['uid'] > 0) {
         if ($_G['member']['picurl']) {
             $picurl = $_G['member']['picurl'];
         } else {
             $picurl = avatar($_G['username'], $_G['uid']);
         }
     } else {
         $picurl = '/assets/global/images/avatar.png';
     }
     $comment_msg = $_G[setting][comment_msg] ? trim($_G[setting][comment_msg]) : '';
     $data = array('user_pic' => $picurl, 'max_page' => $max_page, 'comment_msg' => $comment_msg, 'data' => $comment);
     $rt = array('status' => 'success', 'data' => $data);
     if (defined('APP')) {
         return $rt;
     }
     json($rt);
 }
 function output()
 {
     $comments = mobile_core::getvalues($GLOBALS['comments'], array('/^\\d+$/'), array('id', 'tid', 'pid', 'author', 'authorid', 'dateline', 'comment', 'avatar'));
     foreach ($GLOBALS['comments'] as $k => $c) {
         $comments[$k]['avatar'] = avatar($c['authorid'], 'small', true);
     }
     $variables = array('tid' => $_GET['tid'], 'pid' => $_GET['pid'], 'comments' => array($_GET['pid'] => $comments), 'totalcomment' => $GLOBALS['totalcomment'], 'count' => $GLOBALS['count']);
     mobile_core::result(mobile_core::variable($variables));
 }
 function output()
 {
     $comments = array();
     foreach ($GLOBALS['comments'] as $comment) {
         $comments[] = array('author' => $comment['author'], 'authorid' => $comment['authorid'], 'avatar' => avatar($comment['authorid'], 'small', 1), 'message' => $comment['comment'], 'dateline' => strip_tags($comment['dateline']));
     }
     $variable = array('tid' => $_GET['tid'], 'pid' => $_GET['pid'], 'postlist' => $comments);
     mobile_core::result(mobile_core::variable($variable));
 }
    public function run()
    {
        global $_FANWE;
        $root = array();
        $root['return'] = 0;
        $uid = (int) $_FANWE['requestData']['uid'];
        if ($uid > 0) {
            if (!FS('User')->getUserExists($uid)) {
                $uid = 0;
            }
        }
        if ($uid == 0) {
            $uid = $_FANWE['uid'];
            $root['home_user'] = $_FANWE['user'];
        }
        if ($uid == 0) {
            $root['info'] = "请选择要查看的会员";
            m_display($root);
        }
        if (!isset($root['home_user'])) {
            $root['home_user'] = FS("User")->getUserById($uid);
            unset($root['home_user']['user_name_match'], $root['home_user']['password'], $root['home_user']['active_hash'], $root['home_user']['reset_hash']);
            $root['home_user']['user_avatar'] = avatar($uid, 'm', $root['home_user']['server_code'], 1, true);
        }
        $page = (int) $_FANWE['requestData']['page'];
        $page = max(1, $page);
        $is_spare_flow = (int) $_FANWE['requestData']['is_spare_flow'];
        $img_size = 200;
        $scale = 2;
        if ($is_spare_flow == 1) {
            $img_size = 100;
            $scale = 1;
        }
        $total = FDB::resultFirst('SELECT COUNT(photo_id) FROM ' . FDB::table('share_photo') . ' WHERE uid = ' . $uid);
        $page_size = 20;
        //PAGE_SIZE;
        $page_total = max(1, ceil($total / $page_size));
        if ($page > $page_total) {
            $page = $page_total;
        }
        $limit = ($page - 1) * $page_size . "," . $page_size;
        $photo_list = array();
        $res = FDB::query('SELECT photo_id,share_id,img 
			FROM ' . FDB::table('share_photo') . ' 
			WHERE uid = ' . $uid . ' ORDER BY photo_id DESC LIMIT ' . $limit);
        while ($photo = FDB::fetch($res)) {
            $photo['img'] = getImgName($photo['img'], $img_size, $img_size, 1, true);
            $photo['height'] = round($img_size / $scale);
            $photo['url'] = FU('note/m', array('sid' => $photo['share_id'], 'id' => $photo['photo_id']), true);
            $photo_list[] = $photo;
        }
        $root['return'] = 1;
        $root['item'] = $photo_list;
        $root['page'] = array("page" => $page, "page_total" => $page_total);
        m_display($root);
    }
 public function run()
 {
     global $_FANWE;
     $root = array();
     $root['return'] = 0;
     if ($_FANWE['uid'] == 0) {
         $root['info'] = "请先登陆";
         m_display($root);
     }
     if (isset($_FILES['image_1'])) {
         if ($img = FS("Image")->save('image_1')) {
             if (FS("Image")->getIsServer()) {
                 $server = FS("Image")->getServer();
                 $args = array();
                 $args['pic_url'] = FS("Image")->getImageUrl($img['url'], 2);
                 $server = FS("Image")->getImageUrlToken($args, $server, 1);
                 $body = FS("Image")->sendRequest($server, 'uploadtemp', true);
                 if (!empty($body)) {
                     $img = unserialize($body);
                     $server = FS("Image")->getServer($img['server_code']);
                     if (!empty($server)) {
                         $args = array();
                         $args['pic_url'] = $img['path'];
                         $args['types'] = array('small' => '32', 'middle' => '64', 'big' => '160');
                         $server = FS("Image")->getImageUrlToken($args, $server, 1);
                         $body = FS("Image")->sendRequest($server, 'saveavatar', true);
                         if (!empty($body)) {
                             $avatar = unserialize($body);
                             FS("Image")->setServerUploadCount($avatar['server_code']);
                             FS('User')->updateAvatar($_FANWE['uid'], $avatar['server_code']);
                         }
                     }
                     $root['user_avatar'] = avatar($_FANWE['uid'], 'm', $avatar['server_code'], 1, true);
                 } else {
                     $root['info'] = "上传图片失败";
                     m_display($root);
                 }
             } else {
                 FS('User')->saveAvatar($_FANWE['uid'], $img['path']);
                 $root['user_avatar'] = avatar($_FANWE['uid'], 'm', '', 1, true);
             }
         } else {
             $root['info'] = "上传图片失败";
             m_display($root);
         }
     } else {
         $root['info'] = "请上传图片";
         m_display($root);
     }
     $root['return'] = 1;
     m_display($root);
 }
Exemple #22
0
 function usesubmit()
 {
     global $_G;
     $uid = $_G['uid'];
     $_G['uid'] = 0;
     $avatar = avatar($uid, 'middle', true);
     include_once libfile('function/feed');
     feed_add('thunder', 'magicuse_thunder_announce_title', array('uid' => $uid, 'username' => "<a href=\"home.php?mod=space&uid={$uid}\">{$_G['username']}</a>"), 'magicuse_thunder_announce_body', array('uid' => $uid, 'magic_thunder' => 1), '', array($avatar), array("home.php?mod=space&uid={$uid}"));
     $_G['uid'] = $uid;
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
     showmessage('magics_thunder_message', '', array('magicname' => $_G['setting']['magics']['thunder']), array('showdialog' => 1));
 }
    public function run()
    {
        global $_FANWE;
        $root = array();
        $root['return'] = 1;
        $page = (int) $_FANWE['requestData']['page'];
        $page = max(1, $page);
        $total = FDB::resultFirst('SELECT COUNT(id) FROM ' . FDB::table('user_daren') . ' WHERE status = 1');
        $page_size = PAGE_SIZE;
        $page_total = max(1, ceil($total / $page_size));
        if ($page > $page_total) {
            $page = $page_total;
        }
        $limit = ($page - 1) * $page_size . "," . $page_size;
        $user_follows = array();
        $res = FDB::query('SELECT u.uid,u.user_name,u.server_code,uc.fans,ud.reason,up.introduce 
				FROM ' . FDB::table('user_daren') . ' AS ud
				INNER JOIN ' . FDB::table('user') . ' AS u ON u.uid = ud.uid
				INNER JOIN ' . FDB::table('user_count') . ' AS uc ON uc.uid = ud.uid
				INNER JOIN ' . FDB::table('user_profile') . ' AS up ON up.uid = ud.uid 
				WHERE ud.status = 1 ORDER BY ud.id DESC LIMIT ' . $limit);
        while ($data = FDB::fetch($res)) {
            $data['user_avatar'] = avatar($data['uid'], 'm', $data['server_code'], 1, true);
            $data['desc'] = $data['introduce'];
            if (!empty($data['reason'])) {
                $data['desc'] = $data['reason'];
            }
            unset($data['server_code'], $data['introduce'], $data['reason']);
            if ($data['uid'] == $_FANWE['uid']) {
                $data['is_follow'] = -1;
            } else {
                $user_follows[$data['uid']] = 0;
                $data['is_follow'] = 0;
            }
            $user_list[$data['uid']] = $data;
        }
        $uids = array_keys($user_follows);
        $uids = implode(',', $uids);
        $uids = str_replace(',,', ',', $uids);
        if (!empty($uids)) {
            $res = FDB::query("SELECT uid FROM " . FDB::table('user_follow') . ' 
				WHERE f_uid = ' . $_FANWE['uid'] . ' AND uid IN (' . $uids . ')');
            while ($item = FDB::fetch($res)) {
                $user_list[$item['uid']]['is_follow'] = 1;
            }
        }
        $root['item'] = array_slice($user_list, 0);
        $root['page'] = array("page" => $page, "page_total" => $page_total);
        m_display($root);
    }
Exemple #24
0
 function output()
 {
     global $_G;
     $GLOBALS['space']['avatar'] = '';
     if (isset($GLOBALS['space']['uid']) && !empty($GLOBALS['space']['uid'])) {
         $GLOBALS['space']['avatar'] = avatar($GLOBALS['space']['uid'], 'big', true);
         $GLOBALS['space']['avatar'] = str_replace("\r", '', $GLOBALS['space']['avatar']);
         $GLOBALS['space']['avatar'] = str_replace("\n", '', $GLOBALS['space']['avatar']);
     }
     $tmp = bigapp_core::getvalues($GLOBALS['space'], array('uid', 'username', 'regdate', 'avatar', 'credits', 'gender', 'posts', 'threads', 'constellation', 'realname', 'group', 'self', 'friends', 'feedfriend'));
     $tmp['self'] = strval($tmp['self']);
     foreach ($_G['setting']['extcredits'] as $idx => $detail) {
         if (isset($GLOBALS['space']['extcredits' . $idx])) {
             $tmp['extcredits'][] = array('value' => $GLOBALS['space']['extcredits' . $idx], 'name' => $detail['title']);
         }
     }
     if (!isset($tmp['posts'])) {
         $tmp['posts'] = 0;
     }
     if (!isset($tmp['threads'])) {
         $tmp['threads'] = 0;
     }
     $tmp['posts'] = $tmp['posts'] - $tmp['threads'];
     if ($tmp['posts'] < 0) {
         $tmp['posts'] = 0;
     }
     $GLOBALS['space'] = $tmp;
     $GLOBALS['space']['group'] = bigapp_core::getvalues($GLOBALS['space']['group'], array('grouptitle'));
     if (empty($GLOBALS['space']['group'])) {
         unset($GLOBALS['space']['group']);
     } else {
         $GLOBALS['space']['group']['grouptitle'] = preg_replace('/<.*?\\>/', '', $GLOBALS['space']['group']['grouptitle']);
     }
     if (!isset($GLOBALS['space']['constellation'])) {
         $GLOBALS['space']['constellation'] = '';
     }
     $GLOBALS['space']['is_my_friend'] = 0;
     if (isset($GLOBALS['space']['feedfriend']) && $GLOBALS['space']['feedfriend'] != "") {
         $member_uid = $_G['uid'];
         $feedfriend = $GLOBALS['space']['feedfriend'];
         if ($member_uid == $feedfriend) {
             $GLOBALS['space']['is_my_friend'] = 1;
         } else {
             $arr = explode(",", $feedfriend);
             if (count($arr) > 0 && in_array($member_uid, $arr)) {
                 $GLOBALS['space']['is_my_friend'] = 1;
             }
         }
     }
 }
Exemple #25
0
function show_comment($comment, $lvl = 0)
{
    $style = 'style="margin-left: ' . $lvl * 20 . 'px"';
    ?>
    <div class="comment" id="comment-<?php 
    echo $comment['id'];
    ?>
" <?php 
    echo $style;
    ?>
>
        <a name="com<?php 
    echo $comment['id'];
    ?>
"></a>
        <?php 
    echo avatar($comment);
    ?>
        <div class="author">Написал: <a href="<?php 
    echo site_url('user/profile/' . $comment['login']);
    ?>
"><?php 
    echo $comment['login'];
    ?>
</a> <?php 
    echo human_read_date($comment['added_at']);
    ?>
</div>
        <p><?php 
    echo $comment['deleted'] == 1 ? '[комментарий был удалён администратором]' : $comment['text'];
    ?>
</p>
        <?php 
    if (user_is('admin')) {
        ?>
<a href="#" class="delcomment ctrl" id="destroy-<?php 
        echo $comment['id'];
        ?>
"><span class="ui-icon ui-icon-trash"></span> удал.</a><?php 
    }
    ?>
        
        <a href="#comment_form" id="reply-<?php 
    echo $comment['id'];
    ?>
" class="reply">ответить</a>
    </div>
    <?php 
}
 public function getReputationMembers()
 {
     $result = ET::SQL()->select("username")->select("memberId")->select("reputationPoints")->from("member")->orderBy("reputationPoints DESC")->exec()->allRows();
     //Assign ranks to all members based on reputation points
     $rank = 1;
     foreach ($result as $k => $v) {
         $results[$k]["rank"] = $rank;
         $results[$k]["avatar"] = avatar($v, "thumb");
         $results[$k]["username"] = $result[$k]["username"];
         $results[$k]["memberId"] = $result[$k]["memberId"];
         $results[$k]["reputationPoints"] = $result[$k]["reputationPoints"];
         $rank++;
     }
     return $results;
 }
 function forumdisplay_thread_output()
 {
     $plbeautify = array();
     if ($this->isopen == self::SHOW_LEFT_SIDE_AVATAR) {
         global $_G;
         foreach ($_G['forum_threadlist'] as $member) {
             if (!empty($member['author'])) {
                 $theAvatar = avatar($member['authorid'], 'small');
             }
             $isAnonymous = !empty($member['author']) ? false : true;
             $plbeautify[] = tpl_plbeautify_forumdisplay_author_output($member['authorid'], $theAvatar, $isAnonymous, 'left');
         }
     }
     return $plbeautify;
 }
Exemple #28
0
function print_lateral($nick, $cargo_ID = false, $time, $siglas = '', $user_ID = '', $avatar = '', $votos = 0, $voto = false, $tipo = 'msg', $item_ID = 0)
{
    global $pol;
    if ($cargo_ID == 99) {
        $cargo = 'Extranjero';
    }
    return '<table border="0" width="100%"><tr>
<td width="40" valign="top">' . ($avatar == 'true' ? '<span>' . avatar($user_ID, 40) . '</span>' : '') . '</td>
<td align="right" valign="top" nowrap="nowrap">
<b>' . ($cargo_ID ? '<img src="' . IMG . 'cargos/' . $cargo_ID . '.gif" /> ' : '') . crear_link($nick) . '</b><br />
<span class="min">' . timer($time) . ' ' . $siglas . '</span> 
<span id="' . $tipo . $item_ID . '">' . confianza($votos) . '</span>' . ($pol['pais'] == PAIS && $item_ID != 0 && $user_ID != $pol['user_ID'] ? '<br />
<span id="data_' . $tipo . $item_ID . '" class="votar" type="' . $tipo . '" name="' . $item_ID . '" value="' . $voto . '"></span>' : '') . '
</td></tr></table>';
}
Exemple #29
0
 function sc_avatar()
 {
     if ($this->postInfo['post_user']) {
         if (!($avatar = getcachedvars('forum_avatar_' . $this->postInfo['post_user']))) {
             if ($this->postInfo['user_image']) {
                 require_once e_HANDLER . 'avatar_handler.php';
                 $avatar = "<div class='spacer'><img src='" . avatar($this->postInfo['user_image']) . "' alt='' /></div><br />";
             } else {
                 $avatar = '';
             }
             cachevars('forum_avatar_' . $this->postInfo['post_user'], $avatar);
         }
         return $avatar;
     }
     return '';
 }
Exemple #30
0
 /**
  * 获取用户信息
  */
 public function get_user_info()
 {
     $callback = $this->input->get('callback');
     if (!is_login()) {
         exit($callback . "(" . json_encode(array('is_login' => 0)) . ")");
     } else {
         $data = current_user();
         $info['user_id'] = $data['uid'];
         $info['nickname'] = $data['username'];
         $info['img_url'] = $this->config->item('img3_url') . avatar($data['uid']);
         $info['profile_url'] = $this->config->item('q_url') . build_uri('u', array('id' => $data['uid']));
         $str = 'img_url=' . $info['img_url'] . '&nickname=' . $info['nickname'] . '&profile_url=' . $info['profile_url'] . '&user_id=' . $info['user_id'];
         $info['user']['sign'] = $this->get_signature($str, '4f7b47c758a7e071f0225035c44cd5a4');
         exit($callback . "(" . json_encode(array('is_login' => 1, 'user' => $info)) . ")");
     }
 }