本文整理汇总了PHP中is_base64函数的典型用法代码示例。如果您正苦于以下问题:PHP is_base64函数的具体用法?PHP is_base64怎么用?PHP is_base64使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_base64函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mc_fansinfo
function mc_fansinfo($openidOruid, $acid = 0, $uniacid = 0)
{
global $_W;
if (empty($openidOruid)) {
return array();
}
if (empty($acid)) {
$acid = $_W['acid'];
}
if (empty($uniacid)) {
$uniacid = $_W['uniacid'];
}
$params = array();
$params[':uniacid'] = $uniacid;
$params[':acid'] = $acid;
if (is_numeric($openidOruid)) {
$condition = 'AND `uid`=:uid';
$params[':uid'] = $openidOruid;
} else {
$condition = 'AND `openid`=:openid';
$params[':openid'] = $openidOruid;
}
$sql = 'SELECT * FROM ' . tablename('mc_mapping_fans') . " WHERE `uniacid`=:uniacid AND `acid`=:acid {$condition}";
$fan = pdo_fetch($sql, $params);
if (!empty($fan)) {
if (!empty($fan['tag']) && is_string($fan['tag'])) {
if (is_base64($fan['tag'])) {
$fan['tag'] = @base64_decode($fan['tag']);
}
if (is_serialized($fan['tag'])) {
$fan['tag'] = @iunserializer($fan['tag']);
}
if (!empty($fan['tag']['headimgurl'])) {
$fan['tag']['avatar'] = tomedia($fan['tag']['headimgurl']);
unset($fan['tag']['headimgurl']);
}
} else {
$fan['tag'] = array();
}
}
if (empty($fan) && !empty($_SESSION['userinfo'])) {
$fan['tag'] = unserialize(base64_decode($_SESSION['userinfo']));
$fan['uid'] = 0;
$fan['openid'] = $fan['tag']['openid'];
$fan['follow'] = 0;
$mc_oauth_fan = mc_oauth_fans($fan['openid']);
if (!empty($mc_oauth_fan)) {
$fan['uid'] = $mc_oauth_fan['uid'];
}
}
return $fan;
}
示例2: message
message('更新资料成功!', referer(), 'success');
}
$groups = mc_groups($_W['uniacid']);
$profile = pdo_get('mc_members', array('uniacid' => $_W['uniacid'], 'uid' => $uid));
if (!empty($profile)) {
if (empty($profile['email']) || !empty($profile['email']) && substr($profile['email'], -6) == '012wz.com' && strlen($profile['email']) == 39) {
$profile['email_effective'] = 1;
$profile['email'] = '';
} else {
$profile['email_effective'] = 2;
}
}
if (empty($uid)) {
$fanid = intval($_GPC['fanid']);
$tag = pdo_fetchcolumn('SELECT tag FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND fanid = :fanid', array(':uniacid' => $_W['uniacid'], ':fanid' => $fanid));
if (is_base64($tag)) {
$tag = base64_decode($tag);
}
if (is_serialized($tag)) {
$fan = iunserializer($tag);
}
if (!empty($tag)) {
if (!empty($fan['nickname'])) {
$profile['nickname'] = $fan['nickname'];
}
if (!empty($fan['sex'])) {
$profile['gender'] = $fan['sex'];
}
if (!empty($fan['city'])) {
$profile['residecity'] = $fan['city'] . '市';
}
示例3: defined
<?php
/**
* [WeEngine System] Copyright (c) 2014 WE7.CC
* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
*/
defined('IN_IA') or exit('Access Denied');
load()->model('app');
$title = $_W['account']['name'] . '微站';
$navs = app_navs('profile');
load()->func('tpl');
$profile = mc_fetch($_W['member']['uid']);
if (!empty($_W['openid'])) {
$map_fans = pdo_fetchcolumn('SELECT tag FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND openid = :openid', array(':uniacid' => $_W['uniacid'], ':openid' => $_W['openid']));
if (!empty($map_fans)) {
if (is_base64($map_fans)) {
$map_fans = base64_decode($map_fans);
}
if (is_serialized($map_fans)) {
$map_fans = iunserializer($map_fans);
}
if (!empty($map_fans) && is_array($map_fans)) {
empty($profile['nickname']) ? $data['nickname'] = $map_fans['nickname'] : '';
empty($profile['gender']) ? $data['gender'] = $map_fans['sex'] : '';
empty($profile['residecity']) ? $data['residecity'] = $map_fans['city'] ? $map_fans['city'] . '市' : '' : '';
empty($profile['resideprovince']) ? $data['resideprovince'] = $map_fans['province'] ? $map_fans['province'] . '省' : '' : '';
empty($profile['nationality']) ? $data['nationality'] = $map_fans['country'] : '';
empty($profile['avatar']) ? $data['avatar'] = rtrim($map_fans['headimgurl'], '0') . 132 : '';
if (!empty($data)) {
mc_update($_W['member']['uid'], $data);
}
示例4: template
}
}
if (!empty($fans['tag']['nickname'])) {
$nickname = $fans['tag']['nickname'];
} else {
$nickname = $fans['openid'];
}
template('mc/notice');
}
if ($do == 'log') {
$fanid = intval($_GPC['fanid']);
$id = intval($_GPC['id']);
$type = trim($_GPC['type']) ? trim($_GPC['type']) : 'asc';
$fans = pdo_fetch('SELECT fanid,acid,openid,tag FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND fanid = :id', array(':uniacid' => $_W['uniacid'], ':id' => $fanid));
if (!empty($fans)) {
if (is_base64($fans['tag'])) {
$fans['tag'] = base64_decode($fans['tag']);
}
if (is_serialized($fans['tag'])) {
$fans['tag'] = iunserializer($fans['tag']);
}
if (!empty($fans['tag']['headimgurl'])) {
$avatar = rtrim($fans['tag']['headimgurl'], '0') . 132;
} else {
$avatar = 'resource/images/noavatar_middle.gif';
}
}
if ($type == 'asc') {
$data = pdo_fetchall('SELECT * FROM ' . tablename('mc_chats_record') . ' WHERE acid=:acid AND openid = :openid AND id > :id ORDER BY id ASC LIMIT 5', array(':acid' => $fans['acid'], ':openid' => $fans['openid'], ':id' => $id), 'id');
} else {
$data = pdo_fetchall('SELECT * FROM ' . tablename('mc_chats_record') . ' WHERE acid=:acid AND openid = :openid AND id < :id ORDER BY id DESC LIMIT 5', array(':acid' => $fans['acid'], ':openid' => $fans['openid'], ':id' => $id), 'id');
示例5: max
$param[':keyword'] = "%{$_GPC['keyword']}%";
}
$psize = 10;
$pindex = max(1, intval($_GPC['page']));
$limit = ' ORDER BY followtime DESC LIMIT ' . ($pindex - 1) * $psize . ',' . $psize;
$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('mc_mapping_fans') . $condition, $param);
$data = pdo_fetchall('SELECT fanid,openid,nickname,followtime,tag FROM ' . tablename('mc_mapping_fans') . $condition . $limit, $param, 'fanid');
if (!empty($data)) {
foreach ($data as &$da) {
$da['selected'] = 0;
if (empty($da['nickname'])) {
$da['nickname'] = $da['openid'];
}
$da['avatar'] = './resource/images/noavatar_middle.gif';
if (!empty($da['tag']) && is_string($da['tag'])) {
if (is_base64($da['tag'])) {
$da['tag'] = base64_decode($da['tag']);
}
if (is_serialized($da['tag'])) {
$da['tag'] = @iunserializer($da['tag']);
}
if (!empty($da['tag']['headimgurl'])) {
$da['avatar'] = tomedia($da['tag']['headimgurl']);
}
unset($da['tag']);
}
$da['followtime'] = date('Y-m-d H:i', $da['followtime']);
}
}
$result = array('list' => $data, 'pager' => pagination($total, $pindex, $psize, '', array('before' => '2', 'after' => '3', 'ajaxcallback' => 'null')));
message($result, '', 'ajax');
示例6: foreach
foreach ($groups_data as $gr) {
$groups[$gr['acid']] = iunserializer($gr['groups']);
}
}
$total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('mc_mapping_fans') . $condition, $pars);
$list = pdo_fetchall("SELECT * FROM " . tablename('mc_mapping_fans') . $condition . $orderby . ' LIMIT ' . ($pindex - 1) * $psize . ',' . $psize, $pars);
if (!empty($list)) {
foreach ($list as &$v) {
if (!empty($v['uid'])) {
$user = mc_fetch($v['uid'], array('realname', 'nickname', 'mobile', 'email', 'avatar'));
if (!empty($user['avatar'])) {
$user['avatar'] = tomedia($user['avatar']);
}
}
if (!empty($v['tag']) && is_string($v['tag'])) {
if (is_base64($v['tag'])) {
$v['tag'] = base64_decode($v['tag']);
}
if (is_serialized($v['tag'])) {
$v['tag'] = @iunserializer($v['tag']);
}
if (!empty($v['tag']['headimgurl'])) {
$v['tag']['avatar'] = tomedia($v['tag']['headimgurl']);
unset($v['tag']['headimgurl']);
}
}
if (empty($v['tag'])) {
$v['tag'] = array();
}
if (!empty($user)) {
$niemmo = $user['realname'];
示例7: doMobileprofile
public function doMobileprofile()
{
global $_W, $_GPC;
$uniacid = $_W['uniacid'];
$title = '完善资料';
$op = $_GPC['op'] ? $_GPC['op'] : 'display';
$from_user = $this->getFromUser();
///28.查询用户的唯一身份ID。$state:参数0默认,参数1微信拉取用户详细信息。
$profile = $this->getProfile();
///34.获取wwx_fxxt_member表会员信。
$signPackage = $this->getSignPackage();
///35.转发分享信息、未关注信息、COOKIE等等设置。
$this->OverallSituation($from_user, $profile);
///1.全局统一调用
$carttotal = $this->getCartTotal();
///38.查询购物车内的商品数量。
if (empty($_W['openid'])) {
message('请先登录', $this->createMobileUrl('login'), 'error');
exit;
}
load()->model('app');
load()->model('mc');
load()->func('tpl');
if (!empty($_W['openid'])) {
$map_fans = pdo_fetchcolumn('SELECT tag FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND openid = :openid', array(':uniacid' => $_W['uniacid'], ':openid' => $_W['openid']));
if (!empty($map_fans)) {
if (is_base64($map_fans)) {
$map_fans = base64_decode($map_fans);
}
if (is_serialized($map_fans)) {
$map_fans = iunserializer($map_fans);
}
if (!empty($map_fans) && is_array($map_fans)) {
empty($profile['nickname']) ? $data['nickname'] = $map_fans['nickname'] : '';
empty($profile['gender']) ? $data['gender'] = $map_fans['sex'] : '';
empty($profile['residecity']) ? $data['residecity'] = $map_fans['city'] ? $map_fans['city'] . '市' : '' : '';
empty($profile['resideprovince']) ? $data['resideprovince'] = $map_fans['province'] ? $map_fans['province'] . '省' : '' : '';
empty($profile['nationality']) ? $data['nationality'] = $map_fans['country'] : '';
empty($profile['avatar']) ? $data['avatar'] = rtrim($map_fans['headimgurl'], '0') . 132 : '';
if (!empty($data)) {
mc_update($_W['member']['uid'], $data);
}
}
}
}
if (checksubmit('submit')) {
if (empty($_GPC['avatar'])) {
message('头像不能为空!', '', 'error');
}
if (empty($_GPC['nickname'])) {
message('昵称不能为空!', '', 'error');
}
if (empty($_GPC['realname'])) {
message('真实姓名不能为空!', '', 'error');
}
$data = array('realname' => $_GPC['realname'], 'nickname' => $_GPC['nickname'], 'bankcard' => $_GPC['bankcard'], 'banktype' => $_GPC['banktype'], 'alipay' => $_GPC['alipay'], 'wxhao' => $_GPC['wxhao']);
pdo_update('wwx_fxxt_member', $data, array('from_user' => $from_user));
mc_update($_W['member']['uid'], array('nickname' => $_GPC['nickname'], 'realname' => $_GPC['realname'], 'avatar' => $_GPC['avatar']));
pdo_update('mc_mapping_fans', array('nickname' => $_GPC['nickname']), array('openid' => $from_user));
message('更新资料成功!', referer(), 'success');
}
include $this->template('profile');
}
示例8: mc_fansinfo
function mc_fansinfo($openid, $acid = 0)
{
global $_W;
if (empty($openid)) {
return array();
}
if (empty($acid) && !empty($_W['acid'])) {
$acid = $_W['acid'];
}
$sql = 'SELECT * FROM ' . tablename('mc_mapping_fans') . ' WHERE openid = :openid AND acid = :acid LIMIT 1';
$params = array();
$params[':openid'] = $openid;
$params[':acid'] = $acid;
$fan = pdo_fetch($sql, $params);
if (!empty($fan)) {
if (!empty($fan['tag']) && is_string($fan['tag'])) {
if (is_base64($fan['tag'])) {
$fan['tag'] = @base64_decode($fan['tag']);
}
if (is_serialized($fan['tag'])) {
$fan['tag'] = @iunserializer($fan['tag']);
}
if (!empty($fan['tag']['headimgurl'])) {
$fan['tag']['avatar'] = tomedia($fan['tag']['headimgurl']);
unset($fan['tag']['headimgurl']);
}
}
if (empty($fan['tag'])) {
$fan['tag'] = array();
}
}
return $fan;
}