本文整理汇总了PHP中FU函数的典型用法代码示例。如果您正苦于以下问题:PHP FU函数的具体用法?PHP FU怎么用?PHP FU使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FU函数的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: run
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);
}
示例3: bindCacheAsk
function bindCacheAsk()
{
$asks = array();
$res = FDB::query("SELECT a.* FROM " . FDB::table('ask') . " as a \r\n\t\t\t\tWHERE status = 1");
while ($data = FDB::fetch($res)) {
$data['url'] = FU('ask/forum', array('aid' => $data['aid']));
$asks[$data['aid']] = $data;
}
FanweService::instance()->cache->saveCache('asks', $asks);
}
示例4: success
public function success()
{
global $_FANWE;
$cache_file = getTplCache('page/collection/collection_success', $_FANWE['uid']);
if (!@(include $cache_file)) {
$go_url = FU('u/index', array("uid" => $_FANWE['uid']));
include template('page/collection/collection_success');
}
display($cache_file);
}
示例5: 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'));
}
示例6: 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();
}
示例7: getUserRefer
/**
* 获取登陆后的转向
*/
function getUserRefer()
{
global $_FANWE;
$refer = $_FANWE['request']['refer'];
$redir_url = getCookie('redir_url');
if ($redir_url) {
$refer = $redir_url;
}
if (empty($refer)) {
$refer = FU('u/index');
}
return $refer;
}
示例8: getUserRefer
/**
* 获取登陆后的转向
*/
function getUserRefer()
{
global $_FANWE;
if (intval($_FANWE['setting']['regresult_to_bind']) == 1) {
$refer = FU("settings/bind");
} else {
$refer = $_FANWE['request']['refer'];
if (empty($refer)) {
$refer = FU('u/index');
}
}
return $refer;
}
示例9: 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);
}
示例10: getHotTags
/**
*
* @param $cids 分类ID数组
* @param $limit
*/
function getHotTags($cids = array(), $cate_code, $limit)
{
$hot_tags = array();
$sql = 'SELECT gt.tag_name,gt.tag_code,gt.count,gt.is_hot
FROM ' . FDB::table('goods_tags') . ' as gt
INNER JOIN ' . FDB::table("goods_category_tags") . ' AS gct ON gct.tag_id = gt.tag_id
WHERE gct.cate_id IN (' . implode(',', $cids) . ')
ORDER BY gt.count DESC,gt.sort ASC LIMIT 0,' . $limit;
$res = FDB::query($sql);
while ($data = FDB::fetch($res)) {
$data['url'] = FU("book/cate", array('cate' => $cate_code, 'tag' => urlencode($data['tag_name'])));
$hot_tags[] = $data;
}
return $hot_tags;
}
示例11: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 0;
$uid = $_FANWE['uid'];
if ($uid == 0) {
$root['info'] = "请先登陆";
m_display($root);
}
$root['home_user'] = $_FANWE['user'];
FDB::query("DELETE FROM " . FDB::table('user_notice') . " WHERE uid='{$uid}' AND type=3");
$page = (int) $_FANWE['requestData']['page'];
$page = max(1, $page);
$sql = 'SELECT COUNT(sc.comment_id)
FROM ' . FDB::table("share") . ' AS s
INNER JOIN ' . FDB::table("share_comment") . ' AS sc ON sc.share_id = s.share_id
WHERE s.uid = ' . $uid;
$total = FDB::resultFirst($sql);
$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;
$comment_list = array();
$sql = 'SELECT sc.*,s.content as scontent,u.user_name,u.server_code
FROM ' . FDB::table("share") . ' AS s
INNER JOIN ' . FDB::table("share_comment") . ' AS sc ON sc.share_id = s.share_id
INNER JOIN ' . FDB::table("user") . ' AS u ON u.uid = sc.uid
WHERE s.uid = ' . $uid . '
ORDER BY comment_id DESC LIMIT ' . $limit;
$res = FDB::query($sql);
while ($data = FDB::fetch($res)) {
$data['user_avatar'] = FS("Image")->getImageUrl('.' . avatar($data['uid'], 'm', 1), 2);
$data['time'] = getBeforeTimelag($data['create_time']);
$data['url'] = FU('note/index', array('sid' => $data['share_id']), true);
m_express(&$data, $data['content'] . $data['scontent']);
$comment_list[] = $data;
}
$root['return'] = 1;
$root['item'] = $comment_list;
$root['page'] = array("page" => $page, "page_total" => $page_total);
m_display($root);
}
示例12: 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();
}
示例13: bindCacheShop
function bindCacheShop()
{
$list = array();
$res = FDB::query("SELECT * FROM " . FDB::table('shop_category') . " \r\n\t\tORDER BY sort ASC,id ASC");
while ($data = FDB::fetch($res)) {
$data['url'] = FU('shop/index', array('cid' => $data['id']));
$list['all'][$data['id']] = $data;
}
$list['root'] = array();
foreach ($list['all'] as $cate) {
if ($cate['parent_id'] > 0) {
$list['all'][$cate['parent_id']]['childs'][] = $cate['id'];
} else {
$list['root'][] = $cate['id'];
}
}
FanweService::instance()->cache->saveCache('shops', $list);
}
示例14: bindCacheAlbum
function bindCacheAlbum()
{
$list = array();
$res = FDB::query("SELECT * FROM " . FDB::table('album_category') . " WHERE status = 1 ORDER BY sort ASC,id ASC");
while ($data = FDB::fetch($res)) {
$data['url'] = FU('album/category', array('id' => $data['id']));
$list['category'][$data['id']] = $data;
}
$res = FDB::query("SELECT name,val FROM " . FDB::table('sys_conf') . " WHERE group_id = 8");
while ($data = FDB::fetch($res)) {
if ($data['name'] == 'ALBUM_DEFAULT_TAGS') {
$data['val'] = unserialize($data['val']);
}
$data['name'] = strtolower($data['name']);
$list['setting'][$data['name']] = $data['val'];
}
FanweService::instance()->cache->saveCache('albums', $list);
}
示例15: bindCacheForum
function bindCacheForum()
{
$list = array();
$res = FDB::query("SELECT * FROM " . FDB::table('forum') . " AS f \r\n\t\t LEFT JOIN " . FDB::table('forum_fields') . " AS ff USING(fid) \r\n\t\t WHERE f.status = 1 ORDER BY f.sort ASC");
while ($data = FDB::fetch($res)) {
$data['url'] = FU('club/forum', array('fid' => $data['fid']));
$list['all'][$data['fid']] = $data;
}
$list['root'] = array();
foreach ($list['all'] as $cate) {
if ($cate['parent_id'] > 0) {
$list['all'][$cate['parent_id']]['childs'][] = $cate['fid'];
} else {
$list['root'][] = $cate['fid'];
}
}
FanweService::instance()->cache->saveCache('forums', $list);
}