本文整理汇总了PHP中fHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP fHeader函数的具体用法?PHP fHeader怎么用?PHP fHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unBind
public function unBind()
{
global $_FANWE;
if ($_FANWE['uid'] > 0) {
FDB::delete('user_bind', "uid = " . $_FANWE['uid'] . " AND type = 'sina'");
}
fHeader("location: " . FU('settings/bind'));
}
示例2: cate
public function cate()
{
global $_FANWE;
$category = urldecode($_FANWE['request']['cate']);
if (!isset($_FANWE['cache']['goods_category']['cate_code'][$category])) {
fHeader('location: ' . FU('book/shopping'));
}
BookModule::getList();
}
示例3: jumpUserBindReg
public function jumpUserBindReg($data, $user_name)
{
do {
$max_count = FDB::resultFirst('SELECT COUNT(*) FROM ' . FDB::table("user") . " WHERE user_name = '" . $user_name . "'");
if ($max_count > 0) {
$user_name = $user_name . '_' . random(3);
}
} while ($max_count > 0);
$data['user_name'] = $user_name;
$data = serialize($data);
fSetCookie('bind_user_info', authcode($data, 'ENCODE'));
fHeader("location:" . FU('user/bind'));
}
示例4: all
public function all()
{
define("ACTION_NAME", "all");
require fimport('function/user');
require fimport("function/share");
if (intval($GLOBALS['fanwe']->var['uid']) == 0) {
fHeader("location: " . FU('user/login'));
}
global $_FANWE;
$list_html = getAllList();
include template('page/home');
display();
}
示例5: unBind
public function unBind()
{
global $_FANWE;
if ($_FANWE['uid'] > 0) {
FDB::delete('user_bind', "uid = " . $_FANWE['uid'] . " AND type = 'taobao'");
$update = array();
$update['buyer_level'] = 0;
$update['seller_level'] = 0;
$update['is_buyer'] = 0;
FDB::update('user', $update, 'uid = ' . $_FANWE['uid']);
}
$redirect_uri = urlencode($_FANWE['site_url'] . substr(FU('settings/bind'), 1));
$url = "https://oauth.taobao.com/logoff?client_id=" . $this->config['app_key'] . "&redirect_uri=" . $redirect_uri;
fHeader("location: " . $url);
}
示例6: show
public function show()
{
global $_FANWE;
$adv_id = intval($_FANWE['request']['id']);
$adv = FDB::fetchFirst('SELECT url FROM ' . FDB::table('adv') . ' WHERE id = ' . $adv_id . ' AND status = 1');
if ($adv) {
if (!empty($adv['url'])) {
fHeader('Location:' . $adv['url']);
} else {
fHeader('Location:./');
}
} else {
fHeader('Location:./');
}
}
示例7: show
public function show()
{
global $_FANWE;
$id = (int) $_FANWE['request']['id'];
if (!$id) {
exit;
}
$shop = FDB::fetchFirst('SELECT * FROM ' . FDB::table('shop') . ' WHERE shop_id = ' . $id);
if (!$shop) {
fHeader("location: " . FU('shop/index'));
}
$_FANWE['nav_title'] = $shop['shop_name'] . ' - ' . $_FANWE['nav_title'];
$cache_data = fStripslashes(unserialize($shop['data']));
$shop['tags'] = $cache_data['tags'];
if (empty($shop['taoke_url'])) {
$shop['to_url'] = FU('tgo', array('url' => $shop['shop_url']));
} else {
$shop['to_url'] = FU('tgo', array('url' => $shop['taoke_url']));
}
$page_args['id'] = $id;
$sql = 'SELECT COUNT(DISTINCT sg.share_id) FROM ' . FDB::table('share_goods') . ' AS sg
INNER JOIN ' . FDB::table('share') . ' AS s ON s.share_id = sg.share_id
WHERE s.status = 1 AND sg.shop_id = ' . $id;
$share_count = FDB::resultFirst($sql);
$page_size = 20;
$pager = buildPage('shop/show', $page_args, $share_count, $_FANWE['page'], $page_size);
$share_ids = array();
$sql = 'SELECT DISTINCT sg.share_id FROM ' . FDB::table('share_goods') . ' AS sg
INNER JOIN ' . FDB::table('share') . ' AS s ON s.share_id = sg.share_id
WHERE s.status = 1 AND sg.shop_id = ' . $id . ' ORDER BY sg.share_id DESC LIMIT ' . $pager['limit'];
$res = FDB::query($sql);
while ($data = FDB::fetch($res)) {
$share_ids[] = $data['share_id'];
}
$share_list = array();
if (count($share_ids) > 0) {
$share_ids = implode(',', $share_ids);
$sql = 'SELECT * FROM ' . FDB::table('share') . ' WHERE share_id IN (' . $share_ids . ') ORDER BY share_id DESC';
$share_list = FDB::fetchAll($sql);
$share_list = FS('Share')->getShareDetailList($share_list, false, true, true, false, 0, 10);
}
$shops_tags = FS('Shop')->getUserOtherShopAndTags($id);
include template('page/shop/shop_show');
display();
}
示例8: u
public function u()
{
global $_FANWE;
$_FANWE['nav_title'] = lang('common', 'user_medal');
$medal_uid = (int) $_FANWE['request']['uid'];
if ($medal_uid > 0) {
$medal_names = FS('User')->getUserShowName($medal_uid);
} else {
fHeader("location: " . FU('medal/index'));
}
$medal_list = array();
$award_list = FS('Medal')->getAwardsByUid($medal_uid);
foreach ($award_list as $mid => $award) {
$medal_list[] = $_FANWE['cache']['medals']['all'][$mid];
}
if ($_FANWE['uid'] > 0 && count($medal_list) > 0) {
FS('Medal')->medalFormat($_FANWE['uid'], $medal_list);
}
include template('page/medal/medal_index');
display();
}
示例9: index
public function index()
{
global $_FANWE;
if ($_FANWE['uid'] == 0) {
fHeader("location: " . FU('user/login', array('refer' => FU('invite/index'))));
}
FanweService::instance()->cache->loadCache('medals');
$medal_list = array();
foreach ($_FANWE['cache']['medals']['referrals'] as $id) {
$medal = $_FANWE['cache']['medals']['all'][$id];
$medal_list[] = $medal;
}
$invite_title = $_FANWE['setting']['site_title'];
$invite_content = lang('invite', 'invite_content');
$invite_content = sprintf($invite_content, $_FANWE['setting']['site_name']);
$invite_url = $_FANWE['site_url'] . '?invite=' . $_FANWE['uid'];
$invite_types = array('kaixin', 'renren', 'sina', 'tqq', 'douban', 'qzone', 'baidu');
$invite_pic = $_FANWE['site_url'] . $_FANWE['setting']['site_logo'];
$sns_links = getSnsLink($invite_types, $invite_title, $invite_url, $invite_content, $invite_pic);
include template('page/invite/invite_index');
display();
}
示例10: show
private function show($current_type = '')
{
global $_FANWE;
$share_id = intval($_FANWE['request']['sid']);
$id = intval($_FANWE['request']['id']);
$share_detail = FS('Share')->getShareDetail($share_id);
include fimport('dynamic/u');
if ($share_detail === false) {
fHeader("location: " . FU('index'));
}
$page_title = preg_replace("/\\[[^\\]]+\\]/i", "", $share_detail['content']);
$_FANWE['nav_title'] = $page_title . ' - ' . lang('common', 'share');
$_FANWE['seo_description'] = $page_title;
$_FANWE['setting']['site_description'] = '';
$current_img = FDB::resultFirst("select img from " . FDB::table("share_photo") . " where share_id = " . $share_id . " and img <> '' ");
if ($current_img['img_width'] > 468) {
$current_img['img_width'] = 468;
}
$current_img_arr = FDB::fetchFirst("select * from " . FDB::table("share_photo") . " where share_id = " . $share_id . " and img <> '' ");
//var_dump($current_img_arr);
FDB::query('UPDATE ' . FDB::table('share') . ' SET click_count = click_count + 1 WHERE share_id = ' . $share_id);
//上一个,下一个分享
$pns = FS('Share')->getSameAlbumNextShares($share_detail['uid'], $share_id);
$other_album_share = FS('share')->getSameAlbumShares($share_id);
$current_location = $other_album_share['location'];
unset($other_album_share['location']);
$same_album_count = $other_album_share['count'];
unset($other_album_share['count']);
$aid = FDB::resultFirst("select album_id from " . FDB::table('album_share') . " where share_id = " . $share_id);
$album_sql = 'select al.id as id,al.title as title from ' . FDB::table('album') . ' as al
left join ' . FDB::table('album_share') . ' as als on al.id = als.album_id
where als.share_id = ' . $share_id;
$album_data = FDB::fetchFirst($album_sql);
$is_follow_album = FS('album')->getIsFollow($aid, $_FANWE['uid']);
//发布分享的会员
$share_user = FS('User')->getUserById($share_detail['uid']);
//喜欢分享的会员
$share_detail['collects'] = FS('Share')->getShareCollectUser($share_id);
if (!isset($share_detail['collects'][$_FANWE['uid']])) {
if (FS('Share')->getIsCollectByUid($share_id, $_FANWE['uid'])) {
$share_detail['collects'][$_FANWE['uid']] = $_FANWE['uid'];
}
}
//会员显示名称
$user_show_name = FS('User')->getUserShowName($share_detail['uid']);
//会员勋章
$user_medals = FS('User')->getUserMedal($share_detail['uid']);
//分享标签
$share_tags = $share_detail['cache_data']['tags']['user'];
FS('Share')->tagsFormat($share_tags);
foreach ($share_tags as $seo_tag) {
$_FANWE['seo_keywords'] .= $seo_tag['tag_name'] . ',';
}
//是否可编辑标签
$is_eidt_tag = FS('Share')->getIsEditTag($share_detail);
//喜欢分享的会员还喜欢
$fav_user_fav_share = FS('Share')->getCollectShareByShare($share_id);
//发布分享的会员喜欢的分享
$user_collect_share = FS('Share')->getCollectShareByUser($share_user['uid']);
//是否可删除标签
$is_remove_comment = FS('Share')->getIsRemoveComment($share_detail);
//分享评论
$share_detail['comments'] = FS('Share')->getShareCommentList($share_id, '0,10');
//分享评论分页
$pager = buildPage('', array(), $share_detail['comment_count'], $_FANWE['page'], 10);
unset($share_detail['cache_data']);
$current_obj = NULL;
if ($current_type == '' || $id == 0) {
if (!empty($share_detail['imgs'])) {
$current_obj = current($share_detail['imgs']);
if ($current_obj['type'] == 'g') {
$current_type = 'bao';
} else {
$current_type = 'photo';
}
}
} else {
switch ($current_type) {
case 'bao':
foreach ($share_detail['imgs'] as $img) {
$current_obj = $img;
if ($img['type'] == 'g' && $img['id'] == $id) {
break;
}
}
break;
case 'photo':
foreach ($share_detail['imgs'] as $img) {
$current_obj = $img;
if ($img['type'] == 'm' && $img['id'] == $id) {
break;
}
}
break;
}
}
if (!empty($current_obj['name'])) {
$_FANWE['nav_title'] = $current_obj['name'] . ' - ' . lang('common', 'share');
}
$current_img_id = FDB::resultFirst("select photo_id from " . FDB::table("share_photo") . " where share_id = " . $share_id);
//.........这里部分代码省略.........
示例11: getQqAccessToken
<?php
include "base.php";
require_once FANWE_ROOT . "sdks/qq/qq.func.php";
$appid = $_FANWE['cache']['logins']['qq']['app_key'];
$appkey = $_FANWE['cache']['logins']['qq']['app_secret'];
$access_token = getQqAccessToken($appid, $appkey);
$openid = getQqOpenid($access_token);
require_once FANWE_ROOT . "core/class/user/qq.class.php";
$qq = new QqUser();
switch ($callback_type) {
case 'login':
$qq->loginHandler($access_token, $openid);
$url = FU('u/index');
break;
case 'bind':
$qq->bindHandler($access_token, $openid);
$url = FU('settings/bind');
break;
}
fSetCookie('callback_type', '');
fHeader("location:" . $url);
示例12: unBuyerverifier
public function unBuyerverifier()
{
global $_FANWE;
$uid = $_FANWE['uid'];
$data['is_buyer'] = -1;
FDB::update('user', $data, "uid = {$uid}");
fHeader("location: " . FU('settings/buyerverifier'));
}
示例13: elseif
} elseif (in_array($action, array('exchange'))) {
if ($home_uid != $_FANWE['uid']) {
fHeader("location: " . FU('u/exchange', array('uid' => $_FANWE['uid'])));
}
} elseif (in_array($action, array('atme'))) {
if ($home_uid != $_FANWE['uid']) {
fHeader("location: " . FU('u/atme', array('uid' => $_FANWE['uid'])));
}
} elseif (in_array($action, array('message', 'sendmsg', 'msgview', 'exchange'))) {
if ($home_uid != $_FANWE['uid']) {
fHeader("location: " . FU('u/message', array('uid' => $_FANWE['uid'])));
}
}
$_FANWE['home_uid'] = $home_uid;
$_FANWE['home_user_names'] = FS('User')->getUserShowName($home_uid);
$home_user = FS('User')->getUserById($home_uid);
if (empty($home_user)) {
fHeader("location: " . FU('index/index'));
}
$_FANWE['nav_title'] = $home_user['user_name'] . lang('common', 'space');
require fimport('module/u');
if (class_exists("UModule")) {
$module = new UModule();
if (method_exists($module, $action)) {
call_user_method($action, $module);
} else {
die("error access");
}
} else {
die("error access");
}
示例14: logout
public function logout()
{
global $_FANWE;
$_FANWE['nav_title'] = lang('common', 'user_logout');
FS('User')->clearSession();
//====add by chenfq 2011-10-14=========
$syslogout_js = FS("Integrate")->synLogout();
//js 需要在前台执行
//echo $syslogout_js; exit;
if (!empty($syslogout_js)) {
fSetCookie("dynamic_script", $syslogout_js);
}
fHeader("location: " . FU('index/index'));
}
示例15: show
private function show($current_type = '')
{
global $_FANWE;
$share_id = intval($_FANWE['request']['sid']);
$id = intval($_FANWE['request']['id']);
$share_detail = FS('Share')->getShareDetail($share_id);
include fimport('dynamic/u');
if ($share_detail === false) {
fHeader("location: " . FU('index'));
}
$page_title = preg_replace("/\\[[^\\]]+\\]/i", "", $share_detail['content']);
$_FANWE['nav_title'] = $page_title . ' - ' . lang('common', 'share');
$_FANWE['seo_description'] = $page_title;
$_FANWE['setting']['site_description'] = '';
FDB::query('UPDATE ' . FDB::table('share') . ' SET click_count = click_count + 1 WHERE share_id = ' . $share_id);
//上一个,下一个分享
//$pns = FS('Share')->getPrevNextShares($share_detail['uid'],$share_id);
//发布分享的会员
$share_user = FS('User')->getUserById($share_detail['uid']);
//喜欢分享的会员
$share_detail['collects'] = FS('Share')->getShareCollectUser($share_id);
if (!isset($share_detail['collects'][$_FANWE['uid']])) {
if (FS('Share')->getIsCollectByUid($share_id, $_FANWE['uid'])) {
$share_detail['collects'][$_FANWE['uid']] = $_FANWE['uid'];
}
}
//会员显示名称
$user_show_name = FS('User')->getUserShowName($share_detail['uid']);
//会员勋章
$user_medals = FS('User')->getUserMedal($share_detail['uid']);
//分享标签
$share_tags = $share_detail['cache_data']['tags']['user'];
FS('Share')->tagsFormat($share_tags);
foreach ($share_tags as $seo_tag) {
$_FANWE['seo_keywords'] .= $seo_tag['tag_name'] . ',';
}
//是否可编辑标签
$is_eidt_tag = FS('Share')->getIsEditTag($share_detail);
//喜欢分享的会员还喜欢
$fav_user_fav_share = FS('Share')->getCollectShareByShare($share_id);
//发布分享的会员喜欢的分享
$user_collect_share = FS('Share')->getCollectShareByUser($share_user['uid']);
//是否可删除标签
$is_remove_comment = FS('Share')->getIsRemoveComment($share_detail);
//分享评论
$share_detail['comments'] = FS('Share')->getShareCommentList($share_id, '0,10');
//分享评论分页
$pager = buildPage('', array(), $share_detail['comment_count'], $_FANWE['page'], 10);
unset($share_detail['cache_data']);
$current_obj = NULL;
if ($current_type == '' || $id == 0) {
if (!empty($share_detail['imgs'])) {
$current_obj = current($share_detail['imgs']);
if ($current_obj['type'] == 'g') {
$current_type = 'bao';
} else {
$current_type = 'photo';
}
}
} else {
switch ($current_type) {
case 'bao':
foreach ($share_detail['imgs'] as $img) {
$current_obj = $img;
if ($img['type'] == 'g' && $img['id'] == $id) {
break;
}
}
break;
case 'photo':
foreach ($share_detail['imgs'] as $img) {
$current_obj = $img;
if ($img['type'] == 'm' && $img['id'] == $id) {
break;
}
}
break;
}
}
if (!empty($current_obj['name'])) {
$_FANWE['nav_title'] = $current_obj['name'] . ' - ' . lang('common', 'share');
}
switch ($current_type) {
case 'bao':
//会员最被喜欢的宝贝
$best_goods_share = FS('Share')->getBestCollectGoodsShareByUser($share_user['uid']);
//会员分享店铺信息
$shop_percent_html = FS('Shop')->getUserShareShopHtml($share_user['uid']);
break;
case 'photo':
//会员最被喜欢的照片
$best_photo_share = FS('Share')->getBestCollectPhotoShareByUser($share_user['uid']);
//会员喜欢的照片
$user_fav_photo = FS('Share')->getUserFavPhotoShare($share_user['uid']);
break;
default:
//获取原文分享
$share_detail['is_relay'] = false;
$share_detail['is_rec'] = false;
if ($share_detail['parent_id'] > 0 && $share_detail['base_id'] > 0) {
//.........这里部分代码省略.........