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

PHP mc_fansinfo函数代码示例

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

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



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

示例1: doMobileIndex

 public function doMobileIndex()
 {
     global $_GPC, $_W;
     $tourl = true;
     load()->model('mc');
     $info = mc_oauth_userinfo($_W['acid']);
     $info2 = mc_fansinfo($info['openid'], $_W['acid']);
     if ($info2['follow'] == 1) {
         $tourl = false;
     }
     if (isset($_GPC['wd_code'])) {
         $title = '防伪测试';
         $footer_off = 1;
         $SecurityCode = $_GPC['wd_code'];
         $logs['code'] = $SecurityCode;
         $sql = "SELECT * FROM " . tablename($this->data) . " WHERE code='{$SecurityCode}' LIMIT 1";
         $member = pdo_fetch($sql);
         $states = 0;
         if (!empty($member)) {
             if ($tourl) {
                 if (empty($member['tourl'])) {
                     $member['tourl'] = "http://www.baidu.com";
                 }
                 header('Location:' . $member['tourl']);
             }
             include $this->template('index');
         } else {
             echo '您查询的防伪码不存在,请核对后重试!';
         }
     } else {
         echo '您查询的防伪码不存在,请核对后重试!';
     }
     exit;
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:34,代码来源:site.php


示例2: respond

 public function respond()
 {
     global $_W;
     load()->func('compat.biz');
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('bm_top_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($row['id'])) {
         return $this->respText("系统升级中,请稍候!");
     }
     $desc = $row['desc'];
     //描述
     $n = $row['n'];
     //粉丝基数
     $fromuser = $this->message['from'];
     $num = mc_fansinfo($fromuser);
     $numx = $n + $num['fanid'];
     $name = $_W['account']['name'];
     //公众号名称
     $str = str_replace('{name}', $name, $desc);
     $str = str_replace('{numx}', $numx, $str);
     if ($row['pictype'] == 1) {
         //$str = "嗨,欢迎关注【".$name."】,您是第".$numx."位关注人!\n".$desc."\n <a href='".$url."'>".$urltext."</a>";
         return $this->respText($str);
     } else {
         $response['FromUserName'] = $this->message['to'];
         $response['ToUserName'] = $this->message['from'];
         $response['MsgType'] = 'news';
         $response['ArticleCount'] = 1;
         $response['Articles'] = array();
         $response['Articles'][] = array('Title' => $row['title'], 'Description' => $str, 'PicUrl' => !strexists($row['picurl'], 'http://') ? $_W['attachurl'] . $row['picurl'] : $row['picurl'], 'Url' => $row['urlx'], 'TagName' => 'item');
         return $response;
     }
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:34,代码来源:processor.php


示例3: checkauth

function checkauth()
{
    global $_W, $engine;
    load()->model('mc');
    if (!empty($_W['member']) && (!empty($_W['member']['mobile']) || !empty($_W['member']['email']))) {
        return true;
    }
    if (!empty($_W['openid'])) {
        $fan = mc_fansinfo($_W['openid'], $_W['acid'], $_W['uniacid']);
        if (_mc_login(array('uid' => intval($fan['uid'])))) {
            return true;
        }
        if (defined('IN_API')) {
            $GLOBALS['engine']->died("抱歉,您需要先登录才能使用此功能,点击此处 <a href='" . __buildSiteUrl(url('auth/login')) . "'>【登录】</a>");
        }
    }
    $forward = base64_encode($_SERVER['QUERY_STRING']);
    if ($_W['isajax']) {
        $result = array();
        $result['url'] = url('auth/login', array('forward' => $forward), true);
        $result['act'] = 'redirect';
        exit(json_encode($result));
    } else {
        header("location: " . url('auth/login', array('forward' => $forward)), true);
    }
    exit;
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:27,代码来源:common.func.php


示例4: fetchFansInfo

 public function fetchFansInfo($openid)
 {
     global $_W;
     load()->model('mc');
     $uid = mc_openid2uid($openid);
     $user = mc_fansinfo($_W['member']['uid'], $_W['acid'], $_W['uniacid']);
     if (empty($user)) {
         return null;
     }
     $user['credit'] = $this->fetchUserCredit($openid);
     $user['score'] = intval($user['credit']['credit1']);
     $user['money'] = $user['credit']['credit2'];
     return $user;
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:14,代码来源:FlashUserService.php


示例5: respond

 public function respond()
 {
     global $_W;
     checkauth();
     if (!$this->inContext) {
         $number = pdo_fetchcolumn(" SELECT COUNT(*) FROM " . tablename('mc_mapping_fans') . " WHERE uniacid = '{$_W['uniacid']}' and follow = 1 ");
         $list = pdo_fetch("select * from " . tablename('eso_sale_share_history') . " WHERE from_user = '{$_W['openid']}' and uniacid = '{$_W['uniacid']}'");
         if (empty($list)) {
             $reply = "欢迎关注【" . $_W['account']['name'] . "】\n你是第【" . $number . "】个会员";
             // $reply ="欢迎关注【".$_W['account']['name']."】\n你是第【854】个会员";
         } else {
             $shangji = pdo_fetch("select from_user from " . tablename('eso_sale_member') . " where id = '{$list['sharemid']}' and uniacid = '{$_W['uniacid']}'");
             $member = mc_fansinfo($shangji['from_user']);
             $reply = "欢迎关注【" . $_W['account']['name'] . "】\n你是由【" . $member['nickname'] . "】推荐的第【" . $number . "】个会员";
         }
     }
     return $this->respText($reply);
 }
开发者ID:noikiy,项目名称:mygit,代码行数:18,代码来源:processor.php


示例6: requreSubscribe

function requreSubscribe()
{
    global $_W;
    $hasSubscribe = 1;
    if (isset($_W['fans']['from_user']) && !empty($_W['fans']['from_user'])) {
        $openid = $_W['fans']['from_user'];
        $userinfo = mc_fansinfo($openid);
        if (!$userinfo || $userinfo['follow'] == 0) {
            $hasSubscribe = 0;
        }
    } else {
        $oauthAccount = $_W['oauth_account'];
        if (empty($oauthAccount)) {
            message('未指定网页授权公众号, 无法获取用户信息.', '', 'error');
        }
        $userinfo = mc_oauth_userinfo();
        $level = pdo_fetchcolumn("SELECT `level` FROM " . tablename('account_wechats') . " WHERE `uniacid`=:uniacid", array(':uniacid' => $_W['uniacid']));
        if ($level == 4) {
            if ($userinfo['subscribe'] == 0) {
                $hasSubscribe = 0;
            }
        } else {
            $unionid = isset($userinfo['unionid']) ? $userinfo['unionid'] : '';
            if (empty($unionid)) {
                message('获取unionid失败,请确认公众号已接入微信开放平台', '', 'error');
            }
            $fieldsExist = pdo_fieldexists('mc_mapping_fans', 'unionid');
            if (!$fieldsExist) {
                pdo_query("ALTER TABLE " . tablename('mc_mapping_fans') . " ADD column unionid varchar(255) default null");
            }
            $openid = pdo_fetchcolumn("SELECT `openid` FROM " . tablename('mc_mapping_fans') . " WHERE `unionid`=:unionid AND `uniacid`=:uniacid ", array(':unionid' => $unionid, ':uniacid' => $_W['account']['uniacid']));
            if (empty($openid)) {
                $hasSubscribe = 0;
            } else {
                $userinfo = mc_fansinfo($openid);
                if (!$userinfo || $userinfo['follow'] == 0) {
                    $hasSubscribe = 0;
                }
            }
        }
    }
    return array('openid' => $openid, 'subscribe' => $hasSubscribe);
}
开发者ID:eduNeusoft,项目名称:weixin,代码行数:43,代码来源:zqgame.inc.php


示例7: _mc_login

function _mc_login($member)
{
    global $_W;
    if (!empty($member) && !empty($member['uid'])) {
        $sql = 'SELECT `uid`,`realname`,`mobile`,`email`,`groupid`,`credit1`,`credit2`,`credit6` FROM ' . tablename('mc_members') . ' WHERE `uid`=:uid AND `uniacid`=:uniacid';
        $member = pdo_fetch($sql, array(':uid' => $member['uid'], ':uniacid' => $_W['uniacid']));
        if (!empty($member) && (!empty($member['mobile']) || !empty($member['email']))) {
            $_W['member'] = $member;
            $_SESSION['uid'] = $member['uid'];
            mc_group_update();
            if (empty($_W['openid'])) {
                $fan = mc_fansinfo($member['uid']);
                if (!empty($fan)) {
                    $_SESSION['openid'] = $fan['openid'];
                    $_W['openid'] = $fan['openid'];
                    $_W['fans'] = $fan;
                    $_W['fans']['from_user'] = $_W['openid'];
                } else {
                    $_W['openid'] = $member['uid'];
                    $_W['fans'] = array('from_user' => $member['uid'], 'follow' => 0);
                }
            }
            isetcookie('logout', '', -60000);
            return true;
        }
    }
    return false;
}
开发者ID:wisemyth,项目名称:weizan,代码行数:28,代码来源:mc.mod.php


示例8: checkOpenid

 private function checkOpenid()
 {
     global $_W, $_GPC;
     $openid = $_W['openid'];
     $config = $this->module['config'];
     if (!empty($config['url'])) {
         if (!strexists($config['url'], 'http')) {
             $config['url'] = 'http://' . $config['url'];
         }
     }
     if (empty($openid)) {
         if (!empty($config['url'])) {
             message('..请先关注' . $_W['account']['name'] . '才能继续访问..', $config['url'], 'error');
         }
         message('..请先关注' . $_W['account']['name'] . '才能继续访问..', url('home', array('i' => $_W['uniacid'])), 'error');
     }
     load()->model('mc');
     //手机端用户的必要加载项
     $fans = mc_fansinfo($openid);
     $profile = mc_fetch($_W['member']['uid']);
     if ($fans['follow'] != 1) {
         if (empty($config['url'])) {
             message('..请先关注' . $_W['account']['name'] . '才能继续访问..', url('home', array('i' => $_W['uniacid'])), 'error');
         }
         message('..请先关注' . $_W['account']['name'] . '才能继续访问..', $config['url'], 'error');
     }
     $record = pdo_fetch('SELECT * FROM' . tablename($this->table_fans) . " WHERE uniacid = :uniacid AND openid = :openid", array(':uniacid' => $_W['uniacid'], ':openid' => $openid));
     if (empty($record)) {
         $user = $this->getUserInfo($openid);
         if (empty($user)) {
             if (empty($profile['nickname'])) {
                 $user['nickname'] = '匿名' . substr($openid, -4);
             } else {
                 $user['nickname'] = $profile['nickname'];
             }
             if (empty($profile['avatar'])) {
                 $user['headimgurl'] = $_W['siteroot'] . 'addons/luvwhispers/template/style/images/noheader.png';
             } else {
                 $user['headimgurl'] = $profile['avatar'];
             }
         }
         pdo_insert($this->table_fans, array('uniacid' => $_W['uniacid'], 'nickname' => $user['nickname'], 'headimgurl' => $user['headimgurl'], 'openid' => $openid, 'createtime' => TIMESTAMP));
     } else {
         if ($record['isblack'] == 1) {
             message('哎呦,已被管理员封禁了呦..', url('home', array('i' => $_W['uniacid'])), 'error');
         }
         if (TIMESTAMP - $record['createtime'] >= 604800) {
             $user = $this->getUserInfo($openid);
             if (!empty($user['nickname']) || empty($user['headimgurl'])) {
                 pdo_update($this->table_fans, array('nickname' => $user['nickname'], 'headimgurl' => $user['headimgurl'], 'createtime' => TIMESTAMP), array('uniacid' => $_W['uniacid'], 'openid' => $openid));
             }
         }
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:54,代码来源:site.php


示例9: exit

}
if (empty($_W['account'])) {
    exit('指定(子)公众号不存在。');
}
if (!empty($_SESSION['acid']) && $_W['acid'] != $_SESSION['acid'] || !empty($_SESSION['uniacid']) && $_W['uniacid'] != $_SESSION['uniacid']) {
    $keys = array_keys($_SESSION);
    foreach ($keys as $key) {
        unset($_SESSION[$key]);
    }
    unset($keys, $key);
}
$_SESSION['acid'] = $_W['acid'];
$_SESSION['uniacid'] = $_W['uniacid'];
if (!empty($_SESSION['openid'])) {
    $_W['openid'] = $_SESSION['openid'];
    $_W['fans'] = mc_fansinfo($_W['openid']);
    $_W['fans']['from_user'] = $_W['openid'];
}
if (!empty($_SESSION['uid']) || !empty($_W['fans']) && !empty($_W['fans']['uid'])) {
    $uid = intval($_SESSION['uid']);
    if (empty($uid)) {
        $uid = $_W['fans']['uid'];
    }
    _mc_login(array('uid' => $uid));
    unset($uid);
}
if (empty($_W['openid']) && !empty($_SESSION['oauth_openid'])) {
    $_W['openid'] = $_SESSION['oauth_openid'];
    $_W['fans'] = array('openid' => $_SESSION['oauth_openid'], 'from_user' => $_SESSION['oauth_openid'], 'follow' => 0);
}
$oauth_acc = $_W['account'];
开发者ID:6662680,项目名称:qday_wx,代码行数:31,代码来源:bootstrap.app.inc.php


示例10: strval

         if (empty($_SESSION['openid']) && !empty($mc_oauth_fan['openid'])) {
             $_SESSION['openid'] = strval($mc_oauth_fan['openid']);
         }
     }
 }
 if ($scope == 'userinfo') {
     $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$oauth['access_token']}&openid={$oauth['openid']}&lang=zh_CN";
     $response = ihttp_get($url);
     if (!is_error($response)) {
         $userinfo = array();
         $userinfo = @json_decode($response['content'], true);
         $userinfo['nickname'] = stripcslashes($userinfo['nickname']);
         $userinfo['avatar'] = $userinfo['headimgurl'];
         unset($userinfo['headimgurl']);
         $_SESSION['userinfo'] = base64_encode(iserializer($userinfo));
         $fan = mc_fansinfo($_SESSION['openid']);
         if (!empty($fan)) {
             $record = array();
             $record['updatetime'] = TIMESTAMP;
             $record['nickname'] = stripslashes($userinfo['nickname']);
             $record['tag'] = base64_encode(iserializer($userinfo));
             pdo_update('mc_mapping_fans', $record, array('openid' => $fan['openid'], 'acid' => $_W['acid'], 'uniacid' => $_W['uniacid']));
         }
         if (!empty($fan['uid']) || !empty($_SESSION['uid'])) {
             $uid = $fan['uid'];
             if (empty($uid)) {
                 $uid = $_SESSION['uid'];
             }
             $user = mc_fetch($uid, array('nickname', 'gender', 'residecity', 'resideprovince', 'nationality', 'avatar'));
             $record = array();
             if (empty($user['nickname']) && !empty($userinfo['nickname'])) {
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:oauth.ctrl.php


示例11: pdo_fetch

<?php

/**
 * 提交分数
 * 
 * @version     $Id: billboard.inc.php 1 10:47 2015年09月16日Z lions $
 * @copyright   Copyright (c) 2013 - 2020, haobama.net, Inc.
 * @link        http://www.haobama.net
 */
global $_GPC, $_W;
$hasExists = pdo_fetch("SELECT * FROM " . tablename('lions_zq_billboard') . " WHERE `uniacid`=:uniacid AND `openid`=:openid", array(':uniacid' => $_W['uniacid'], ':openid' => $_GPC['openid']));
if ($hasExists && $hasExists['score'] < $_GPC['score']) {
    pdo_update('lions_zq_billboard', array('score' => $_GPC['score']), array('uniacid' => $_W['uniacid'], 'openid' => $_GPC['openid']));
} else {
    pdo_insert('lions_zq_billboard', array('uniacid' => $_W['uniacid'], 'openid' => $_GPC['openid'], 'score' => $_GPC['score']));
}
$record = pdo_fetch("SELECT * FROM " . tablename('lions_zq_billboard') . " WHERE `uniacid`=:uniacid AND `openid`=:openid", array(':uniacid' => $_W['uniacid'], ':openid' => $_GPC['openid']));
$record['cur_score'] = $_GPC['score'];
$record['top_score'] = pdo_fetchcolumn("SELECT `score` FROM " . tablename('lions_zq_billboard') . " WHERE `uniacid`=:uniacid ORDER BY `score` DESC LIMIT 1", array('uniacid' => $_W['uniacid']));
$records = pdo_fetchall("SELECT * FROM " . tablename('lions_zq_billboard') . " WHERE `uniacid`=:uniacid ORDER BY `score` DESC LIMIT 10", array(':uniacid' => $_W['uniacid']));
$str = '';
if ($records) {
    foreach ($records as $key => $item) {
        $userinfo = mc_fansinfo($item['openid']);
        $nickname = empty($userinfo) ? '匿名' : $userinfo['nickname'];
        $str .= '<tr  style="height:30px;"><td>' . $nickname . '</td><td>' . $item['score'] . '</td></tr>';
    }
}
$record['billboard'] = $str;
echo json_encode($record);
exit;
开发者ID:eduNeusoft,项目名称:weixin,代码行数:31,代码来源:billboard.inc.php


示例12: doMobileDetail

 public function doMobileDetail()
 {
     global $_W, $_GPC;
     $id = intval($_GPC['id']);
     $detail = pdo_fetch("SELECT * FROM" . tablename($this->table_goods) . "WHERE id='{$id}'");
     $size = 1;
     if (empty($detail['thumb1'])) {
         $size = 1;
     }
     if (!empty($detail['thumb2'])) {
         $size += 1;
     }
     if (!empty($detail['thumb3'])) {
         $size += 1;
     }
     $user = mc_fansinfo($_W['openid'], $_W['acid']);
     $url = "http://virtual.paipai.com/extinfo/GetMobileProductInfo?mobile={$detail['mobile']}&amount=10000";
     $curl = curl_init();
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($curl, CURLOPT_TIMEOUT, 500);
     curl_setopt($curl, CURLOPT_URL, $url);
     $res = curl_exec($curl);
     curl_close($curl);
     $a = explode(')', substr($res, 1));
     $c = '"' . iconv("gbk", "UTF-8", $a[0]) . '"';
     $mobile = json_decode($c, true);
     $title = $detail['title'];
     $_share_img = $_W['attachurl'] . $detail['thumb1'];
     $_share = array('title' => $title, 'link' => '', 'imgUrl' => $_share_img, 'content' => $title);
     include $this->template('detail');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:site.php


示例13: strval

        }
        if (empty($_SESSION['openid']) && !empty($mc_oauth_fan['openid'])) {
            $_SESSION['openid'] = strval($mc_oauth_fan['openid']);
        }
    }
}
if ($scope == 'userinfo') {
    $userinfo = $oauth_account->getOauthUserInfo($oauth['access_token'], $oauth['openid']);
    if (!is_error($userinfo)) {
        $userinfo['nickname'] = stripcslashes($userinfo['nickname']);
        if (!empty($userinfo['headimgurl'])) {
            $userinfo['headimgurl'] = rtrim($userinfo['headimgurl'], '0') . 132;
        }
        $userinfo['avatar'] = $userinfo['headimgurl'];
        $_SESSION['userinfo'] = base64_encode(iserializer($userinfo));
        $fan = mc_fansinfo($oauth['openid']);
        if (!empty($fan)) {
            $record = array();
            $record['updatetime'] = TIMESTAMP;
            $record['nickname'] = stripslashes($userinfo['nickname']);
            $record['tag'] = base64_encode(iserializer($userinfo));
            pdo_update('mc_mapping_fans', $record, array('openid' => $fan['openid'], 'acid' => $_W['acid'], 'uniacid' => $_W['uniacid']));
        } else {
            $record = array();
            $record['updatetime'] = TIMESTAMP;
            $record['nickname'] = stripslashes($userinfo['nickname']);
            $record['tag'] = base64_encode(iserializer($userinfo));
            $record['openid'] = $oauth['openid'];
            $record['acid'] = $_W['acid'];
            $record['uniacid'] = $_W['uniacid'];
            pdo_insert('mc_mapping_fans', $record);
开发者ID:aspnmy,项目名称:weizan,代码行数:31,代码来源:oauth.ctrl.php


示例14: doMobileShare

 public function doMobileShare()
 {
     global $_W, $_GPC;
     $pid = $_GPC['pid'];
     $rid = $_GPC['rid'];
     $rule = pdo_fetch('select * from ' . tablename($this->modulename . '_rule') . " where rid='{$rid}'");
     if (empty($rule)) {
         message('该活动不存在!');
     }
     load()->model('mc');
     $info = mc_oauth_userinfo();
     $openid = $info['openid'];
     $fans = mc_fansinfo($openid, $_W['acid'], $_W['uniacid']);
     $follow = $fans['follow'];
     $player = pdo_fetch('select * from ' . tablename($this->modulename . '_player') . " where rid='{$rule['rid']}' and openid='{$openid}'");
     if (!empty($player)) {
         header('location:' . $this->createMobileUrl('index', array('rid' => $rid)));
         exit;
     }
     $player = pdo_fetch('select * from ' . tablename($this->modulename . '_player') . " where rid='{$rule['rid']}' and openid='{$pid}'");
     if (!empty($player)) {
         $count = pdo_fetchcolumn('select sum(birds_num) from ' . tablename($this->modulename . "_share") . " where pid='{$player['id']}'");
         $rate = $count / $rule['birds_success'];
         if ($count >= $rule['birds_success']) {
             $rate = 1;
         }
     }
     $share = pdo_fetch('select * from ' . tablename($this->modulename . '_share') . " where rid='{$rule['rid']}' and openid='{$openid}' and pid='{$player['id']}'");
     if (empty($share) && $rule['describe_limit2']) {
         //记录下痕迹   用于助力者关注后 点击活动链接时 还能回到分享页面
         $record = pdo_fetch('select * from ' . tablename($this->modulename . "_record") . " where openid='{$openid}' and pid='{$player['id']}' ");
         if (empty($record)) {
             pdo_insert($this->modulename . "_record", array('openid' => $openid, 'pid' => $player['id']));
         }
     }
     //因说话气泡分两段位移,以rate=0.65为界
     $edge = 0.65;
     //说话气泡的移动边界(当rate为0.65时,气泡前一段位移的rate相当于1)
     $rate = 0;
     if (!empty($player)) {
         $count = pdo_fetchcolumn('select sum(birds_num) from ' . tablename($this->modulename . "_share") . " where pid='{$player['id']}'");
         $rate = $count / $rule['birds_success'];
         if ($count >= $rule['birds_success']) {
             $rate = 1;
         }
     }
     include $this->template('share');
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:48,代码来源:site.php


示例15: doMobileMobile

 public function doMobileMobile()
 {
     //这个操作被定义用来呈现 许愿手机首页
     global $_W, $_GPC;
     $openid = $_W['openid'];
     $id = intval($_GPC['id']);
     if (!empty($id)) {
         $reply = pdo_fetch("SElECT * FROM" . tablename($this->tablename) . "WHERE rid=:rid LIMIT 1", array(':rid' => $id));
         //增加浏览人数
         pdo_update($this->tablename, array('viewnum' => $reply['viewnum'] + 1), array('id' => $reply['id']));
     }
     if (!empty($openid)) {
         $member = mc_fansinfo($openid);
         $follow = intval($member['follow']);
         if ($follow == 1) {
             include $this->template('mobile');
         } else {
             echo "<script> alert('请先关注我们的官方微信!');parent.location.href='{$reply['gzurl']}'; </script>";
         }
     }
     $signPackage = $this->getSignPackage();
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:22,代码来源:site.php


示例16: doMobileOauthuserinfo

 public function doMobileOauthuserinfo()
 {
     global $_W, $_GPC;
     load()->model('mc');
     // 假设当前应用必需会员头像
     $avatar = '';
     // 1 如果是会员(存在 uid),从会员信息中获取
     if (!empty($_W['member']['uid'])) {
         $member = mc_fetch($_W['member']['uid']);
         if (!empty($member)) {
             $avatar = $member['avatar'];
         }
     }
     // 2 如果存在 fans 记录, 从 fans 中获取
     if (empty($avatar)) {
         $fan = mc_fansinfo($_W['openid']);
         if (!empty($fan) && !empty($fan['tag'])) {
             $avatar = $fan['tag']['avatar'];
         }
     }
     //3 最后调用网页授权, 如果有权限
     if (empty($avatar)) {
         if (!empty($_W['oauth_account'])) {
             $userinfo = mc_oauth_userinfo();
             if (is_error($userinfo)) {
                 // you code here
                 message($ret['message']);
             } else {
                 $avatar = $userinfo['tag']['avatar'];
             }
         } else {
             mc_require($_W['uid'], array('avatar'));
         }
     }
     echo "<img src='{$avatar}'>";
 }
开发者ID:lrf1999,项目名称:we7_store,代码行数:36,代码来源:site.php


示例17: checkauth

 public function checkauth()
 {
     global $_W;
     load()->model('mc');
     if (empty($_W['member']['uid'])) {
         if (!empty($_W['openid'])) {
             $fan = mc_fansinfo($_W['openid'], $_W['acid'], $_W['uniacid']);
             _mc_login(array('uid' => intval($fan['uid'])));
         }
     }
     if (empty($_W['member']['uid'])) {
         $sql = "SELECT * FROM " . tablename('mc_mapping_fans') . " WHERE uniacid = :uniacid AND openid = :openid";
         $params = array(':uniacid' => $_W['uniacid'], ':openid' => $_W['openid']);
         $fans = pdo_fetch($sql, $params);
         if (!empty($fans)) {
             if (!empty($fans['uid'])) {
                 _mc_login(array('uid' => intval($fans['uid'])));
                 if (empty($_W['member']['uid'])) {
                     return false;
                 } else {
                     return $_W['member']['uid'];
                 }
             } else {
                 return $this->doMobileRegistMember();
             }
         } else {
             return $this->doMobileRegistFans();
         }
     } else {
         load()->func('communication');
         if (empty($_W['acid'])) {
             $_W['acid'] = pdo_fetchcolumn("SELECT acid FROM " . tablename('mc_mapping_fans') . " WHERE uniacid='{$_W['uniacid']}' AND openid = '{$_W['openid']}'");
         }
         $account = account_fetch($_W['acid']);
         load()->classs('weixin.account');
         $accObj = WeixinAccount::create($_W['account']['acid']);
         $account['access_token']['token'] = $accObj->fetch_token();
         if (empty($account['access_token']['token'])) {
             return false;
         }
         $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $account['access_token']['token'] . "&openid=" . $_W['openid'] . "&lang=zh_CN";
         $re = ihttp_get($url);
         if ($re['code'] == 200) {
             $userinfo = json_decode($re['content'], true);
             if ($userinfo['errcode'] == '41001') {
             }
         }
         $data = array('nickname' => stripslashes($userinfo['nickname']), 'avatar' => trim($userinfo['headimgurl']), 'gender' => $userinfo['sex'], 'nationality' => $userinfo['country'], 'resideprovince' => $userinfo['province'] . '省', 'residecity' => $userinfo['city'] . '市');
         pdo_update('mc_members', $data, array('uid' => $_W['member']['uid']));
         return $_W['member']['uid'];
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:52,代码来源:site.php


示例18: doMobilePtjperfect

 public function doMobilePtjperfect()
 {
     //这个操作被定义用户  呈现用户完善信息的页面
     global $_W, $_GPC;
     require_once 'sms.php';
     load()->model('mc');
     load()->func('tpl');
     $avatar = '';
     $openid = $_W['openid'];
     $count = 0;
     $uid = $_W['member']['uid'];
     if (!empty($_W['member']['uid'])) {
         $member = mc_fetch(intval($_W['member']['uid']), array('avatar', 'nickname'));
         if (!empty($member)) {
             $avatar = $member['avatar'];
             $nickname = $member['nickname'];
         }
     }
     if (empty($avatar)) {
         $fan = mc_fansinfo($_W['openid']);
         if (!empty($fan)) {
             $avatar = $fan['avatar'];
         }
     }
     if (empty($avatar)) {
         $userinfo = mc_oauth_userinfo();
         if (!is_error($userinfo) && !empty($userinfo) && is_array($userinfo) && !empty($userinfo['avatar'])) {
             $avatar = $userinfo['avatar'];
             $nickname = $userinfo['nickname'];
         }
     }
     if (empty($avatar) && !empty($_W['member']['uid'])) {
         $avatar = mc_require($_W['member']['uid'], array('avatar'));
     }
     if (empty($avatar)) {
         // 提示用户关注公众号。;
         //echo "最终没有获取到头像,follow: {$_W['fans']['follow']}";
     } else {
         $src = $avatar;
     }
     //////////////////////////////////////mc调用结束////////////////////////////
     $sms = json_decode($sms, true);
     if ($_GPC['tel'] and $_GPC['verify'] !== 'ing') {
         //对TEL进行动态正则匹配
         $tel = $_GPC['tel'];
         $t = preg_match('/^1[34578]\\d{9}$/', $tel);
         if ($t) {
             //给前端号码
             $tel = $_GPC['tel'];
             message('tel_success');
         } else {
             message('tel_fail');
         }
     }
     if ($_GPC['verify'] === 'ing') {
         //开始构造短信信息
         $statusStr = array("0" => "POSTED", "-1" => "参数不全", "-2" => "服务器空间不支持,请确认支持curl或者fsocket,联系您的空间商解决或者更换空间!", "30" => "密码错误", "40" => "账号不存在", "41" => "余额不足", "42" => "帐户已过期", "43" => "IP地址限制", "50" => "内容含有敏感词");
         $smsapi = "http://api.smsbao.com/";
         //$user = "sevenplus2016"; //短信平台帐号
         $user = $sms['sms_account'];
         //$pass = md5("wa7plus"); //短信平台密码
         $pass = md5($sms['sms_password']);
         $m_content = substr(time(), -4, 4);
         //要发送的短信内容
         $time = 1;
         $content = "【老司机】" . "您的验证码为: {$m_content}," . "在{$time}分钟内有效---{$_W['account']['name']}";
         $phone = $_GPC['tel'];
         //要发送短信的手机号码
         $sendurl = $smsapi . "sms?u=" . $user . "&p=" . $pass . "&m=" . $phone . "&c=" . urlencode($content);
         $result = file_get_contents($sendurl);
         $msg = $statusStr[$result];
         $resarr = array("msg" => $msg, "content" => $m_content);
         $res = json_encode($resarr);
         message($res);
     }
     $name = $_GPC['name'];
     $phone = $_GPC['phone'];
     $openid = $_W['openid'];
     if (isset($name) && isset($phone)) {
         pdo_insert('ptj_profile', array('name' => $name, 'phone' => $phone, 'sure' => 1, 'openid' => $openid));
     }
     include $this->template('perfect');
 }
开发者ID:scbizu,项目名称:Wechat_we7Job,代码行数:83,代码来源:site.php


示例19: Mobile_GetMember

function Mobile_GetMember($theThis, $uniacid, $id, $openid)
{
    global $_W, $_GPC;
    $rd = new ReturnData("");
    load()->model('account');
    $account = uni_fetch();
    load()->model('mc');
    $fans = mc_fansinfo($openid, $uniacid);
    $member = mc_fetch($fans['uid'], array('realname', 'mobile', 'qq', 'msn'));
    if (empty($member)) {
        $rd->setMsg("无法识别您的身份,请发送关键字到公众号 “" . $account['name'] . "” 参加活动");
        $rd->setCode(200);
    }
    $rd->addData('fans', $fans);
    $rd->addData('member', $member);
    return $rd;
}
开发者ID:6662680,项目名称:qday_wx,代码行数:17,代码来源:vote.inc.php


示例20: _auser

 public function _auser($rid, $afrom_user, $uniacid = '')
 {
     global $_GPC, $_W;
     load()->model('mc');
     if (empty($uniacid)) {
         $uniacid = !empty($_W['uniacid']) ? $_W['uniacid'] : $_W['acid'];
     }
     $auser = pdo_fetch("SELECT avatar, nickname FROM " . tablename($this->table_users) . " WHERE uniacid = :uniacid and  rid = :rid and from_user = :afrom_user ", array(':uniacid' => $uniacid, ':rid' => $rid, ':afrom_user' => $afrom_user));
     if (empty($auser)) {
         $auser = pdo_fetch("SELECT avatar, nickname FROM " . tablename($this->table_data) . " WHERE uniacid = :uniacid and  rid = :rid and from_user = :afrom_user ", array(':uniacid' => $uniacid, ':rid' => $rid, ':afrom_user' => $afrom_user));
         if (empty($auser)) {
             $auser = mc_fansinfo($row['afrom_user']);
         }
     }
     return $auser;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:16,代码来源:site.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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