本文整理汇总了PHP中tplFetch函数的典型用法代码示例。如果您正苦于以下问题:PHP tplFetch函数的具体用法?PHP tplFetch怎么用?PHP tplFetch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tplFetch函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getImageServer
public function getImageServer($server = '', $request = array())
{
global $_FANWE;
$result = array();
$result['status'] = 0;
if ($_FANWE['uid'] == 0) {
return $result;
}
$type = $request['type'];
switch ($type) {
case 'uploadphoto':
$server = FS("Image")->formatServer($server, 'DE');
break;
case 'uploadavatar':
$server = FS("Image")->getServer($_FANWE['user']['server_code']);
break;
}
$server = FS("Image")->getImageUrlToken($request['args'], $server);
if ($server === false) {
return $result;
}
switch ($type) {
case 'uploadphoto':
$cache_file = getTplCache('services/image/pic_item');
$args = array();
$result['html'] = base64_encode(tplFetch("services/image/pic_item", $args, '', $cache_file));
break;
}
$result['status'] = 1;
$result['max_upload'] = (int) $_FANWE['setting']['max_upload'];
$result['url'] = $server['url'];
$result['token'] = $server['token'];
$result['image_server'] = $server['image_server'];
return $result;
}
示例2: getHomeNav
/**
* 右侧会员空间导航模块
* @param $uid
*/
function getHomeNav($args)
{
list($uid, $active) = explode(',', $args);
unset($args);
$args = array('uid' => $uid, 'active' => $active, 'user' => FS('User')->getUserById($uid), 'user_show_name' => FS('User')->getUserShowName($uid));
return tplFetch('inc/u/home_nav', $args);
}
示例3: getShareByUserClickShareID
function getShareByUserClickShareID()
{
global $_FANWE;
$share_id = (int) $_FANWE['user_click_share_id'];
if ($share_id > 0) {
$share = FS('Share')->getShareById($share_id);
if ($share) {
$temp_share[] = $share;
$temp_share = FS('Share')->getShareDetailList($temp_share, false, false, false, true, 5);
$temp_share = $temp_share[$share_id];
$args = array('share' => &$temp_share);
$result = array();
$result['share_id'] = $share_id;
switch (ACTION_NAME) {
case 'dapei':
$result['html'] = tplFetch('inc/book/book_dapei', $args);
break;
case 'look':
$result['html'] = tplFetch('inc/book/book_look', $args);
break;
default:
$result['html'] = tplFetch('inc/book/book_index', $args);
break;
}
return "ShowUserClickShare(" . outputJson($result, false) . ");";
}
}
return '';
}
示例4: detail
public function detail()
{
global $_FANWE;
$id = intval($_FANWE['request']['id']);
if ($id == 0) {
fHeader("location: " . FU('index/index'));
}
include fimport('dynamic/u');
//获取相关的分享ID
$eventinfo = FDB::fetchFirst("select * from " . FDB::table("event") . " where id=" . $id);
if (intval($eventinfo['share_id']) == 0) {
fHeader("location: " . FU('index/index'));
}
$eventinfo['share'] = FS('Share')->getShareDetail($eventinfo['share_id']);
if ($share_detail === false) {
fHeader("location: " . FU('index'));
}
$user_share_collect = FS('Share')->getShareCollectUser($eventinfo['share_id']);
$page_title = preg_replace("/\\[[^\\]]+\\]/i", "", $eventinfo['title']);
$_FANWE['nav_title'] = $page_title . ' - ' . lang('common', 'event');
$_FANWE['seo_description'] = $page_title;
$_FANWE['setting']['site_description'] = '';
//分享评论
$page_args = array('id' => $id);
$count = $eventinfo['thread_count'];
$post_list = array();
if ($count > 0) {
$pager = buildPage('event/' . ACTION_NAME, $page_args, $count, $_FANWE['page'], 10);
$sql = 'SELECT share_id FROM ' . FDB::table('event_share') . '
WHERE event_id = ' . $id . ' ORDER BY share_id DESC LIMIT ' . $pager['limit'];
$ids = array();
$res = FDB::query($sql);
while ($data = FDB::fetch($res)) {
$ids[] = $data['share_id'];
}
$ids = implode(',', $ids);
$sql = 'SELECT * from ' . FDB::table('share') . ' where share_id IN (' . $ids . ') ORDER BY share_id';
$list = FDB::fetchAll($sql);
$post_list = FS('Share')->getShareDetailList($list, true, true, true);
}
$args = array('share_list' => &$post_list, 'pager' => &$pager, 'current_share_id' => $eventinfo['share_id']);
$post_html = tplFetch("inc/share/post_share_list", $args);
//热门话题
$hot_event_list = FS("event")->getHotEvent(10);
if (intval($_FANWE['uid']) > 0) {
//我发布的
$me_event_list = FS("event")->getUserEvent($_FANWE['uid'], 5);
//我参与的
$me_join_event_list = FS("event")->getUserJoinevent($_FANWE['uid'], 5);
}
if (intval($_FANWE['page']) == 1) {
FDB::query('UPDATE ' . FDB::table('share') . ' SET click_count = click_count + 1 WHERE share_id = ' . $eventinfo['share_id']);
}
include template('page/event/event_detail');
display();
}
示例5: getTipUserFollow
function getTipUserFollow($uid)
{
global $_FANWE;
$is_follow = false;
if ($_FANWE['uid'] > 0 && $_FANWE['uid'] != $uid) {
$is_follow = FS('User')->getIsFollowUId($uid);
}
$args = array('uid' => $uid, 'is_follow' => $is_follow);
return tplFetch('services/user/tip_follow', $args);
}
示例6: getBestFlashs
function getBestFlashs($fid)
{
global $_FANWE;
$args = array();
$cache_file = getTplCache('inc/club/flash_topic', array($fid), 1);
if (getCacheIsUpdate($cache_file, 300)) {
$args['best_list'] = FS('Topic')->getImgTopic('best', 6, 1, $fid);
}
return tplFetch('inc/club/flash_topic', $args, '', $cache_file);
}
示例7: getHotUser
/**
* 热心排行榜
*/
function getHotUser()
{
$cache_file = getTplCache('inc/ask/hot_user', array(), 1);
if (getCacheIsUpdate($cache_file, 300)) {
//热心排行榜
$sql = "SELECT uc.uid,u.user_name,uc.ask,ask_posts,uc.ask_best_posts \r\n\t\t\tFROM " . FDB::table("user_count") . " AS uc \r\n\t\t\tINNER JOIN " . FDB::table("user") . " AS u ON u.uid = uc.uid \r\n\t\t\tORDER BY uc.ask_best_posts DESC ,uc.ask_posts DESC limit 10";
$hot_users = FDB::fetchAll($sql);
$args['hot_users'] =& $hot_users;
}
return tplFetch('inc/ask/hot_user', $args, '', $cache_file);
}
示例8: detail
function detail()
{
global $_FANWE;
$id = intval($_FANWE['request']['tid']);
if ($id == 0) {
fHeader('location: ' . FU('club/index'));
}
$topic = FS('Topic')->getTopicById($id);
if (empty($topic)) {
fHeader('location: ' . FU('club/index'));
}
$_FANWE['nav_title'] = lang('common', 'club');
$_FANWE['nav_title'] = $topic['title'] . ' - ' . $_FANWE['nav_title'];
FDB::query('UPDATE ' . FDB::table('share') . ' SET click_count = click_count + 1 WHERE share_id = ' . $topic['share_id']);
$topic['time'] = getBeforeTimelag($topic['create_time']);
$topic['share'] = FS('Share')->getShareDetail($topic['share_id']);
$user_share_collect = FS('Share')->getShareCollectUser($topic['share_id']);
$forum_id = $topic['fid'];
$forum = $_FANWE['cache']['forums']['all'][$forum_id];
$root_forum = $forum;
$is_root = true;
if ($forum['parent_id'] > 0) {
$is_root = false;
$root_forum = $_FANWE['cache']['forums']['all'][$forum['parent_id']];
}
FS('Topic')->updateTopicLooksCache($id);
$topic_looks = FS('Topic')->getTopicLooks($id, 33);
$is_follow = FS('Topic')->getIsFollowTid($id);
$follow_count = FS('Topic')->getTopicFollowCount($id);
$follow_users = FS('Topic')->getTopicFollows($id, 9);
$user_new_topics = FS('Topic')->getUserNewTopicList($id, $topic['uid'], 5);
$forum_hot_topics = FS('Topic')->getHotTopicList($id, $root_forum['fid'], 9);
$forum_new_topics = FS('Topic')->getNowTopicList($id, $root_forum['fid'], 10);
$forum_hot_pics = FS('Topic')->getImgTopic('hot', 9, 1, $root_forum['fid']);
$new_events = FS('Event')->getHotNewEvent(10);
$best_topics = FS('Topic')->getImgTopic('hot', 12, 1);
$best_topics = array_chunk($best_topics, 3);
$page_args = array('tid' => $id);
$count = $topic['post_count'];
$pager = buildPage('club/' . ACTION_NAME, $page_args, $count, $_FANWE['page'], 10);
$post_list = FS('Topic')->getTopicPostList($id, $pager['limit']);
$args = array('share_list' => &$post_list, 'pager' => &$pager, 'current_share_id' => $topic['share_id']);
$post_html = tplFetch("inc/share/post_share_list", $args);
include template('page/club/club_detail');
display();
}
示例9: getIndexCateShare
/**
* 首页分类推荐分享
*/
function getIndexCateShare()
{
$args = array();
$cache_file = getTplCache('inc/index/index_cate_share', array(), 1);
if (getCacheIsUpdate($cache_file, 600)) {
global $_FANWE;
FanweService::instance()->cache->loadCache('goods_category');
$cate_indexs = $_FANWE['cache']['goods_category']['all'];
foreach ($cate_indexs as $k => $v) {
if ($v['parent_id'] == 0 && $v['is_index'] == 1) {
$cids = array();
FS('Share')->getChildCids($v['cate_id'], $cids);
/*$tags = FDB::fetchAll("select gt.tag_name,gt.tag_code from ".FDB::table("goods_category_tags")." as gct INNER JOIN ".FDB::table("goods_tags")." as gt on gt.tag_id = gct.tag_id where gct.cate_id in (".implode(",",$cids).") order by gct.weight desc,gt.count desc,gt.tag_id desc limit 12");
foreach($tags as $tk=>$tv){
$tags[$tk]["encode"] = urlencode($tv['tag_code']);
}
$v['hot_tags'] = $tags ;
*/
$v['share_count'] = FDB::resultFirst("select count(DISTINCT s.uid) from " . FDB::table("share") . " as s INNER JOIN " . FDB::table("share_category") . " as sc ON sc.share_id = s.share_id where sc.cate_id in (" . implode(",", $cids) . ")");
$v['user'] = array();
$users = FDB::fetchAll("select DISTINCT(s.uid) as uid from " . FDB::table("share") . " as s INNER JOIN " . FDB::table("share_category") . " as sc ON sc.share_id = s.share_id where sc.cate_id in (" . implode(",", $cids) . ") order by s.share_id desc limit 10");
foreach ($users as $kk => $vv) {
$user = FS("User")->getUserShowName($vv['uid']);
$v['user'][$vv['uid']] = $user['name'];
}
$sql = "SELECT s.*,st.tag_name FROM " . FDB::table("share") . " as s \r\n\t\t\t\t\t\tINNER JOIN " . FDB::table("share_category") . " as sc ON sc.share_id = s.share_id \r\n\t\t\t\t\t\tINNER JOIN " . FDB::table("share_tags") . " as st ON st.share_id = s.share_id\r\n\t\t\t\t\t\tINNER JOIN " . FDB::table("goods_category_tags") . " as gct ON gct.cate_id = sc.cate_id\r\n\t\t\t\t\t\tWHERE gct.cate_id in (" . implode(",", $cids) . ") AND s.is_index=1 GROUP BY s.share_id ORDER BY s.sort desc,s.share_id desc limit 30";
$v['share_list'] = FDB::fetchAll($sql);
foreach ($v['share_list'] as $kk => $vv) {
$tag['tag_name'] = $vv['tag_name'];
$tag['tag_code'] = $vv['tag_name'];
$tag['encode'] = urlencode($vv['tag_name']);
$v['hot_tags'][$vv['tag_name']] = $tag;
}
$v['share_list'] = FS("Share")->getShareDetailList($v['share_list']);
$args['cate_list'][] = $v;
}
}
unset($cate_indexs);
}
return tplFetch('inc/index/index_cate_share', $args, '', $cache_file);
}
示例10: FS
if ($uid == 0) {
exit;
}
$share = FS('Share')->getShareById($share_id);
if (empty($share)) {
exit;
}
if ($share['uid'] != $uid) {
exit;
}
$tags = trim($_FANWE['request']['tags']);
$check_result = FS('Share')->checkWord($tags, 'tag');
if ($check_result['error_code'] == 1) {
$result['status'] = 0;
$result['error'] = $check_result['error_msg'];
outputJson($result);
}
$tags = str_replace('***', '', $tags);
$tags = str_replace(' ', ' ', $tags);
$tags = explode(' ', $tags);
$tags = array_unique($tags);
$tags = array_slice($tags, 0, $_FANWE['setting']['share_tag_count']);
$share_tags['user'] = trim($_FANWE['request']['tags']);
FS('Share')->updateShareTags($share_id, $share_tags);
$args['tags'] = FS('Share')->getShareTags($share_id);
$args['tags'] = $args['tags']['user'];
FS('Share')->tagsFormat($args['tags']);
$result['tags'] = implode(' ', $tags);
$result['status'] = 1;
$result['html'] = tplFetch("services/share/tag_list", $args);
outputJson($result);
示例11: array
<?php
global $_FANWE;
$share_id = (int) $_FANWE['request']['share_id'];
if (!$share_id) {
exit;
}
$img = FDB::resultFirst('select img from ' . FDB::table('share_photo') . ' where share_id = ' . $share_id);
$args = array('img' => $img);
if ($img) {
$result['status'] = 1;
} else {
$result['status'] = 0;
}
$result['html'] = tplFetch('services/share/detail', $args);
outputJson($result);
示例12: FS
<?php
global $_FANWE;
$list = FS("Album")->getAlbumListByUid($_FANWE['uid']);
FanweService::instance()->cache->loadCache('albums');
$args = array('list' => &$list);
if ($_FANWE['request']['type'] == 'more') {
$result['html'] = tplFetch('services/share/select_album_list', $args);
} else {
$result['html'] = tplFetch('services/share/select_album', $args);
}
outputJson($result);
示例13: getUserShareShopHtml
/**
* 获取会员分享的店铺百分比信息HTML
* @param int $uid 会员编号
* @param int $num 显示数量
* @return string
*/
public function getUserShareShopHtml($uid, $num = 10)
{
$user = FS('User')->getUserById($uid);
$user_lang = $_FANWE['uid'] == $uid ? lang('user', 'me') : lang('user', 'ta_' . $user['gender']);
$shops = ShopService::getUserShareShops($uid, $num);
$args = array('shops' => &$shops, 'user' => &$user, 'user_lang' => &$user_lang);
return tplFetch("inc/shop/user_shop_percent", $args);
}
示例14: FS
//未登陆直接退出
$uid = $_FANWE['uid'];
if ($uid == 0) {
exit;
}
$share = FS('Share')->getShareById($share_id);
//没有分享直接退出
if (empty($share)) {
exit;
}
$result = array();
if ($share['uid'] == $uid) {
$result['status'] = 3;
outputJson($result);
}
if (FS('Share')->getIsCollectByUid($share_id, $uid)) {
$result['status'] = 2;
outputJson($result);
}
FS('Share')->saveFav($share);
$share_dynamic = FS('Share')->getShareDynamic($share_id);
$result['count'] = $share_dynamic['collect_count'];
$result['status'] = 4;
$img_size = intval($_FANWE['request']['size']);
if ($img_size == 0) {
$img_size = 12;
}
$user_list = FS('Share')->getShareCollectUser($share_id, $_FANWE['uid'], $img_size);
$args = array('collects' => $user_list, 'img_size' => 32);
$result['collects'] = tplFetch("inc/share/collect_list", $args);
outputJson($result);
示例15: FS
}
$share = FS('Share')->getShareById($share_id);
//没有分享直接退出
if (empty($share)) {
exit;
}
$result = array('status' => 1, 'html' => '', 'error' => '');
if (!checkIpOperation("add_comment", SHARE_INTERVAL_TIME)) {
$result['status'] = 0;
$result['error'] = lang('share', 'interval_tips');
outputJson($result);
}
$check_result = FS('Share')->checkWord($_FANWE['request']['content'], 'content');
if ($check_result['error_code'] == 1) {
$result['status'] = 0;
$result['error'] = $check_result['error_msg'];
outputJson($result);
}
$comment_id = FS('Share')->saveComment($_FANWE['request']);
//FS("User")->updateUserScore($_FANWE['uid'],'share','comments',$_FANWE['request']['content'],$comment_id);
$comment = FS('Share')->getShareComment($comment_id);
$comment['user'] = array('uid' => $_FANWE['uid'], 'user_name' => $_FANWE['user_name'], 'url' => FU('u/index', array('uid' => $_FANWE['uid'])));
$comment['time'] = getBeforeTimelag($comment['create_time']);
$is_remove_comment = FS('Share')->getIsRemoveComment($share);
$args = array('comment' => $comment, 'is_remove_comment' => $is_remove_comment);
if ($_FANWE['request']['comment_type'] == 'album') {
$result['html'] = tplFetch('services/album/comment_item', $args);
} else {
$result['html'] = tplFetch('inc/share/comment_item', $args);
}
outputJson($result);