本文整理汇总了PHP中mc_fansinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP mc_fansinfo函数的具体用法?PHP mc_fansinfo怎么用?PHP mc_fansinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mc_fansinfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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));
}
}
}
}
示例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'];
示例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'])) {
示例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;
示例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');
}
示例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);
示例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');
}
示例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();
}