Пример #1
0
 function index()
 {
     global $_FANWE;
     $_FANWE['nav_title'] = lang('common', 'ask');
     $ask_indexs = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
     $asks = $_FANWE['cache']['asks'];
     $index = 0;
     $ask_list = array();
     foreach ($asks as $ask) {
         if ($ask['aid'] > 0) {
             $ask['index_char'] = $ask_indexs[$index];
             $ask['list'] = FDB::fetchAll('SELECT tid,title,post_count,is_solve
                 FROM ' . FDB::table('ask_thread') . '
                 WHERE status=1 and aid=' . $ask['aid'] . ' ORDER BY tid DESC LIMIT 0,3');
             if ($index % 2 == 0) {
                 $ask_list['l'][] = $ask;
             } else {
                 $ask_list['r'][] = $ask;
             }
             $index++;
         }
     }
     $cache_file = getTplCache('page/ask/ask_index', $cache_args);
     //新发表的问题
     $new_asks = FDB::fetchAll("SELECT tid,title,is_solve FROM " . FDB::table("ask_thread") . " WHERE status=1 order by tid desc limit 9");
     //热门有图问题
     $hot_asks = FS('Ask')->getImgAsk('hot', 9);
     include template('page/ask/ask_index');
     display();
 }
 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;
 }
 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);
 }
Пример #4
0
 public function index()
 {
     global $_FANWE;
     $cache_args = array('index');
     $cache_file = getTplCache('page/link_index', $cache_args);
     if (!@(include $cache_file)) {
         include template('page/link_index');
     }
     display($cache_file);
 }
Пример #5
0
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);
}
Пример #6
0
 public function addgoods()
 {
     $share_module = FDB::fetchAll("select `name`,`class`,`icon`,`url` from " . FDB::table('sharegoods_module') . " where status = 1 and is_install = 1");
     global $_FANWE;
     $cache_file = getTplCache('inc/shareutil/addgoods');
     if (!@(include $cache_file)) {
         include template('inc/shareutil/addgoods');
     }
     display($cache_file);
 }
/**
 * 热心排行榜
 */
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
0
 function index()
 {
     global $_FANWE;
     $cache_args = array('club_index');
     $_FANWE['nav_title'] = lang('common', 'club');
     $cache_file = getTplCache('page/club/club_index', $cache_args);
     if (!@(include $cache_file)) {
         include template('page/club/club_index');
     }
     display($cache_args);
 }
Пример #9
0
 public function rule()
 {
     global $_FANWE;
     $title = sprintf(lang('common', 'user_sore_rule'), $_FANWE['setting']['site_name']);
     $_FANWE['nav_title'] = $title;
     $cache_file = getTplCache('page/exchange/exchange_rule');
     if (!@(include $cache_file)) {
         include template('page/exchange/exchange_rule');
     }
     display($cache_file);
 }
Пример #10
0
<?php

$cache_file = getTplCache('services/user/share');
FanweService::instance()->cache->loadCache('albums');
if (!@(include $cache_file)) {
    $login_modules = getLoginModuleList();
    include template('services/user/share');
}
display($cache_file);
Пример #11
0
/**
 * 首页分类推荐分享
 */
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);
}
Пример #12
0
<?php

$uid = (int) $_FANWE['request']['uid'];
if ($uid == 0) {
    exit;
}
require_once fimport('dynamic/user');
$cache_file = getTplCache('services/user/tip', $_FANWE['request'], 2);
if (getCacheIsUpdate($cache_file, 600)) {
    $user = FS("User")->getUserById($uid);
    if ($user) {
        $user['url'] = FU('u/index', array('uid' => $uid));
        $user['city'] = '';
        Cache::getInstance()->loadCache('citys');
        $reside_province = $_FANWE['cache']['citys']['all'][$user['reside_province']]['name'];
        $reside_city = $_FANWE['cache']['citys']['all'][$user['reside_city']]['name'];
        if (!empty($reside_province)) {
            $user['city'] .= $reside_province;
        }
        if (!empty($reside_city)) {
            $user['city'] .= '&nbsp;' . $reside_city;
        }
        $medals = array();
        if (!empty($user['medals'])) {
            $medals = explode(',', $user['medals']);
        }
        $user['medals'] = array();
        if ($user['is_buyer'] == 1) {
            $user['medals'][] = array('name' => lang('user', 'buyer_alt'), 'url' => FU('settings/buyerverifier'), 'small_img' => './tpl/images/medal_buyer.png');
        }
        if ($user['is_daren'] == 1) {
Пример #13
0
<?php

$cache_file = getTplCache('services/user/login');
if (!@(include $cache_file)) {
    $login_modules = getLoginModuleList();
    include template('services/user/login');
}
display($cache_file);
Пример #14
0
<?php

global $_FANWE;
if (!$_FANWE['uid']) {
    exit;
}
FanweService::instance()->cache->loadCache('albums');
$cache_file = getTplCache('services/user/album');
if (!@(include $cache_file)) {
    $login_modules = getLoginModuleList();
    include template('services/user/album');
}
display($cache_file);
/**
 * 晒货列表
 */
function getLookLists()
{
    $args = array();
    $cache_file = getTplCache('inc/index/look_list', array(), 1);
    if (getCacheIsUpdate($cache_file, 600)) {
        $args['look_list'] = FS('Share')->getPhotoListByType("look");
    }
    return tplFetch('inc/index/look_list', $args, '', $cache_file);
}
Пример #16
0
<?php

$cache_file = getTplCache('services/share/expression');
if (!@(include $cache_file)) {
    $expressions = getCache('expression');
    if ($expressions === NULL) {
        $expressions = array();
        $res = FDB::query('SELECT type,title,emotion,filename 
			FROM ' . FDB::table('expression') . ' ORDER BY type');
        while ($data = FDB::fetch($res)) {
            $data['url'] = './public/expression/' . $data['type'] . '/' . $data['filename'];
            $data['emotion'] = str_replace(array('[', ']'), array('', ''), $data['emotion']);
            $expressions[$data['type']][] = $data;
        }
        setCache('expression', $expressions);
    }
    $expressions_js = array();
    foreach ($expressions as $ekty => $elist) {
        $args = array('current_exp' => &$elist);
        $expressions_js[$ekty] = tplFetch("services/share/expression_item", $args);
    }
    $expressions_json = getJson($expressions_js);
    $current_exp = current($expressions_js);
    include template('services/share/expression');
}
display($cache_file);
Пример #17
0
<?php

$cache_file = getTplCache('services/share/atme');
if (!@(include $cache_file)) {
    include template('services/share/atme');
}
display($cache_file);
Пример #18
0
/**
 * 首页 最新的主题
 */
function getUUIndexTopic()
{
    global $_FANWE;
    $args = array();
    $cache_file = getTplCache('inc/index/new_topic', array(), 1);
    if (getCacheIsUpdate($cache_file, 600)) {
        $res = FDB::query('SELECT fid,thread_count FROM ' . FDB::table('forum') . ' WHERE parent_id = 0');
        while ($data = FDB::fetch($res)) {
            $_FANWE['cache']['forums']['all'][$data['fid']]['thread_count'] = $data['thread_count'];
        }
        $args['new_list'] = FS('Topic')->getImgTopic('new', 5, 1);
        $args['ask_list'] = FS('Ask')->getImgAsk('new', 5, 1);
    }
    return tplFetch('inc/index/topics', $args, '', $cache_file);
}
Пример #19
0
<?php

$cache_file = getTplCache('services/share/addgoods');
if (!@(include $cache_file)) {
    FanweService::instance()->cache->loadCache('business');
    $business = $_FANWE['cache']['business'];
    include template('services/share/addgoods');
}
display($cache_file);
Пример #20
0
/**
 * 最新活动,热门主题
 */
function getPinkHotTopic()
{
    $cache_file = getTplCache('inc/index/hot_topic', array(), 1);
    if (getCacheIsUpdate($cache_file, 600)) {
        $args['new_events'] = FS('Event')->getHotNewEvent(4);
        $args['hot_topics'] = FS('Topic')->getHotTopicList(0, 0, 2);
    }
    return tplFetch('inc/index/hot_topic', $args, '', $cache_file);
}
Пример #21
0
    private function getList()
    {
        global $_FANWE;
        $_FANWE['user_click_share_id'] = (int) $_FANWE['request']['sid'];
        unset($_FANWE['request']['sid']);
        $cache_file = getTplCache('page/book/book_index', $_FANWE['request'], 2);
        if (getCacheIsUpdate($cache_file, BOOK_CACHE_PAGE_TIME)) {
            $category = urldecode($_FANWE['request']['cate']);
            $is_root = false;
            $page_args = array();
            if (isset($_FANWE['cache']['goods_category']['cate_code'][$category])) {
                $page_args['cate'] = $_FANWE['request']['cate'];
                $cate_id = $_FANWE['cache']['goods_category']['cate_code'][$category];
                $goods_cate_code = $category;
            } else {
                $is_root = true;
                $cate_id = $_FANWE['cache']['goods_category']['root'];
            }
            $sort = $_FANWE['request']['sort'];
            $sort = !empty($sort) ? $sort : "pop";
            $category_data = $_FANWE['cache']['goods_category']['all'][$cate_id];
            $category_tags = array();
            $_FANWE['nav_title'] = $category_data['cate_name'];
            if (!empty($category_data['seo_keywords'])) {
                $_FANWE['seo_keywords'] = $category_data['seo_keywords'];
                $_FANWE['setting']['site_keywords'] = '';
            }
            if (!empty($category_data['seo_desc'])) {
                $_FANWE['seo_description'] = $category_data['seo_desc'];
                $_FANWE['setting']['site_description'] = '';
            }
            $child_ids = array();
            if (isset($category_data['child'])) {
                $child_ids = $category_data['child'];
                if (!$is_root) {
                    $tagurlpara['cate'] = urlencode($category_data['cate_code']);
                }
                foreach ($category_data['child'] as $child_id) {
                    $child_cate = $_FANWE['cache']['goods_category']['all'][$child_id];
                    $tag_key = 'goods_category_tags_' . $child_id;
                    FanweService::instance()->cache->loadCache($tag_key);
                    foreach ($_FANWE['cache'][$tag_key] as $k => $tag) {
                        $tagurlpara['tag'] = urlencode($tag['tag_name']);
                        $tag['url'] = FU("book/" . ACTION_NAME, $tagurlpara);
                        $child_cate['tags'][] = $tag;
                        if ($k > 16) {
                            break;
                        }
                    }
                    $category_tags[] = $child_cate;
                }
            }
            $hot_tags = array();
            if (!$is_root) {
                $child_ids[] = $cate_id;
                require fimport("function/share");
                $hot_tags = getHotTags($child_ids, $category, 10);
            }
            $condition = " WHERE s.share_data IN ('goods','photo','goods_photo')";
            if (!$is_root) {
                $cids = array();
                FS('Share')->getChildCids($cate_id, $cids);
                $condition .= " AND sc.cate_id IN (" . implode(',', $cids) . ")";
            }
            $title = $category_data['short_name'];
            $is_match = false;
            $tag = urldecode($_FANWE['request']['kw']);
            if (!empty($tag)) {
                $_FANWE['nav_title'] = $tag . ' - ' . $_FANWE['nav_title'];
                $title = htmlspecialchars($tag);
                $is_match = true;
                //$match_key = FS('Words')->segment($tag,10);
                //$match_key = tagToUnicode($match_key,'+');
                $match_key = segmentToUnicode($tag, '+');
                $condition .= " AND match(sm.content_match) against('" . $match_key . "' IN BOOLEAN MODE) ";
                $page_args['tag'] = urlencode($tag);
            }
            //输出排序URL
            $sort_page_args = $page_args;
            $sort_page_args['sort'] = 'hot7';
            $hot7_url['url'] = FU('book/' . ACTION_NAME, $sort_page_args);
            if ($sort == 'hot7') {
                $hot7_url['act'] = 1;
            }
            $sort_page_args['sort'] = 'hot30';
            $hot30_url['url'] = FU('book/' . ACTION_NAME, $sort_page_args);
            if ($sort == 'hot30') {
                $hot30_url['act'] = 1;
            }
            $sort_page_args['sort'] = 'new';
            $new_url['url'] = FU('book/' . ACTION_NAME, $sort_page_args);
            if ($sort == 'new') {
                $new_url['act'] = 1;
            }
            $sort_page_args['sort'] = 'pop';
            $pop_url['url'] = FU('book/' . ACTION_NAME, $sort_page_args);
            if ($sort == 'pop') {
                $pop_url['act'] = 1;
            }
            if (!empty($_FANWE['request']['sort'])) {
                $page_args['sort'] = $sort;
            } else {
                $page_args['sort'] = 'pop';
            }
            $today_time = getTodayTime();
            switch ($sort) {
                //7天最热 点击次数
                case 'hot7':
                    $day7_time = $today_time - 604800;
                    $field = ",(s.create_time > {$day7_time}) AS time_sort ";
                    $sort = " ORDER BY time_sort DESC,s.click_count DESC";
                    break;
                    //30天最热 点击次数
                //30天最热 点击次数
                case 'hot30':
                    $day30_time = $today_time - 2592000;
                    $field = ",(s.create_time > {$day30_time}) AS time_sort ";
                    $sort = " ORDER BY time_sort DESC,s.click_count DESC";
                    break;
                    //最新
                //最新
                case 'new':
                    $field = '';
                    $sort = " ORDER BY s.share_id DESC";
                    break;
                    //潮流  喜欢人数
                //潮流  喜欢人数
                case 'pop':
                default:
                    $day7_time = $today_time - 604800;
                    $field = ",(s.create_time > {$day7_time}) AS time_sort ";
                    $sort = " ORDER BY time_sort DESC,s.collect_count DESC";
                    break;
            }
            $sql = 'SELECT DISTINCT(s.share_id),s.uid,s.content,s.collect_count,s.comment_count,s.create_time,s.cache_data ' . $field . '
					FROM ' . FDB::table('share') . ' AS s ';
            if (!$is_root) {
                $sql .= 'INNER JOIN ' . FDB::table('share_category') . ' AS sc ON s.share_id = sc.share_id ';
            }
            if ($is_match) {
                $sql .= 'INNER JOIN ' . FDB::table('share_match') . ' AS sm ON sm.share_id = s.share_id ';
            }
            $sql .= $condition . $sort;
            $sql_count = 'SELECT COUNT(DISTINCT s.share_id)
				FROM ' . FDB::table('share') . ' AS s ';
            if (!$is_root) {
                $sql_count .= 'INNER JOIN ' . FDB::table('share_category') . ' AS sc ON s.share_id = sc.share_id ';
            }
            if ($is_match) {
                $sql_count .= 'INNER JOIN ' . FDB::table('share_match') . ' AS sm ON sm.share_id = s.share_id ';
            }
            $sql_count .= $condition;
            $page_size = 50;
            $max_page = 100;
            $count = FDB::resultFirst($sql_count);
            if ($count > $max_page * $page_size) {
                $count = $max_page * $page_size;
            }
            if ($_FANWE['page'] > $max_page) {
                $_FANWE['page'] = $max_page;
            }
            $pager = buildPage('book/' . $action, $page_args, $count, $_FANWE['page'], $page_size, '', 3);
            $share_datas = array();
            $sql = $sql . ' LIMIT ' . $pager['limit'];
            $share_list = FDB::fetchAll($sql);
            $share_list = FS('Share')->getShareDetailList($share_list, false, false, false, true, 2);
            $col = 4;
            $index = 0;
            $share_display = array();
            foreach ($share_list as $share) {
                $mod = $index % $col;
                $share_display['col' . $mod][] = $share;
                $index++;
            }
            include template('page/book/book_index');
            display($cache_file);
            exit;
        } else {
            include $cache_file;
            display();
        }
    }
Пример #22
0
<?php

$cache_file = getTplCache('services/share/addpic');
if (!@(include $cache_file)) {
    include template('services/share/addpic');
}
display($cache_file);