本文整理汇总了PHP中get_top10函数的典型用法代码示例。如果您正苦于以下问题:PHP get_top10函数的具体用法?PHP get_top10怎么用?PHP get_top10使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_top10函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
$smarty->assign('page_title', $position['title']);
// 页面标题
$smarty->assign('ur_here', $position['ur_here']);
// 当前位置
/* meta information */
$smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));
$smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
$smarty->assign('flash_theme', $_CFG['flash_theme']);
// Flash轮播图片模板
$smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? 'feed.xml' : 'feed.php');
// RSS URL
$smarty->assign('categories', get_categories_tree());
// 分类树
$smarty->assign('helps', get_shop_help());
// 网店帮助
$smarty->assign('top_goods', get_top10());
// 销售排行
$smarty->assign('best_goods', get_recommend_goods('best'));
// 推荐商品
$smarty->assign('new_goods', get_recommend_goods('new'));
// 最新商品
$smarty->assign('hot_goods', get_recommend_goods('hot'));
// 热点文章
$smarty->assign('promotion_goods', get_promote_goods());
// 特价商品
$smarty->assign('brand_list', get_brands());
$smarty->assign('promotion_info', get_promotion_info());
// 增加一个动态显示所有促销信息的标签栏
$smarty->assign('invoice_list', index_get_invoice_query());
// 发货查询
$smarty->assign('new_articles', index_get_new_articles());
示例2: htmlspecialchars
$smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
$smarty->assign('flash_theme', $_CFG['flash_theme']);
// Flash轮播图片模板
$smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? 'feed.xml' : 'feed.php');
// RSS URL
$smarty->assign('categories', get_categories_tree());
// 分类树
$smarty->assign('helps', get_shop_help());
// 网店帮助
$smarty->assign('top_goods', get_top10());
// 销售排行
///llx添加start
$smarty->assign('top_goods1', get_top10(16));
$smarty->assign('top_goods2', get_top10(81));
$smarty->assign('top_goods3', get_top10(17));
$smarty->assign('top_goods4', get_top10(93));
///llx添加end
$best_goods = get_recommend_goods('best');
$smarty->assign('best_goods', $best_goods);
// 推荐商品
$smarty->assign('new_goods', get_recommend_goods('new'));
// 最新商品
$smarty->assign('hot_goods', get_recommend_goods('hot'));
// 热点文章
$smarty->assign('promotion_goods', get_promote_goods());
// 特价商品
$smarty->assign('brand_list', get_brands());
$smarty->assign('promotion_info', get_promotion_info());
// 增加一个动态显示所有促销信息的标签栏
$smarty->assign('invoice_list', index_get_invoice_query());
// 发货查询
示例3: foreach
foreach ($res as $v) {
$str[$v['cat_id']]['goods'] = assign_cat_goods($v['cat_id'], $num = 10, 'cate');
$mysql = "SELECT cat_id,cat_name FROM " . $GLOBALS['ecs']->table('category') . "WHERE parent_id = '" . $v['cat_id'] . "' AND is_show_cate = 1";
$result = $GLOBALS['db']->getAll($mysql);
$cat_arr = array();
if ($result) {
foreach ($result as $key => $val) {
$cat_arr[$key]['url'] = build_uri('category', array('cid' => $val['cat_id']), $val['cat_name']);
$cat_arr[$key]['cat_name'] = $val['cat_name'];
}
$str[$v['cat_id']]['category'] = $cat_arr;
//子分类
} else {
$str[$v['cat_id']]['category'] = '';
}
$str[$v['cat_id']]['top'] = get_top10($v['cat_id'], 5);
//分类排行
$str[$v['cat_id']]['name'] = $v['cat_name'];
//分类名
$str[$v['cat_id']]['cat_id'] = $v['cat_id'];
//分类id
$str[$v['cat_id']]['url'] = build_uri('category', array('cid' => $v['cat_id']), $v['cat_name']);
//分类id
}
$smarty->assign('cate_goods', $str);
$smarty->display('category_top.dwt');
}
/* zhong改下 */
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
示例4: get_same_attribute_goods
//print_r($properties['spe']);
$smarty->assign('attribute_linked', get_same_attribute_goods($properties)); // 相同属性的关联商品
$smarty->assign('related_goods', $linked_goods); // 关联商品
$smarty->assign('goods_article_list', get_linked_articles($goods_id)); // 关联文章
$smarty->assign('fittings', get_goods_fittings(array($goods_id))); // 配件
$smarty->assign('rank_prices', get_user_rank_prices($goods_id, $shop_price)); // 会员等级价格
$smarty->assign('pictures', get_goods_gallery($goods_id)); // 商品相册
$smarty->assign('bought_goods', get_also_bought($goods_id)); // 购买了该商品的用户还购买了哪些商品
$smarty->assign('goods_rank', get_goods_rank($goods_id)); // 商品的销售排名
$smarty->assign('related_cat', get_related_cat($goods['cat_id']));
$smarty->assign('related_brand', get_related_brand($goods['cat_id']));
$smarty->assign('top10_brand', get_top10_brand($goods['brand_id']));
$smarty->assign('top10_category', get_top10($goods['cat_id']));
$smarty->assign('top10_price', get_top10_price($goods['shop_price']));
//by mike start
//组合套餐名
$comboTabIndex = array(' ','一', '二', '三','四','五','六','七','八','九','十');
$smarty->assign('comboTab',$comboTabIndex);
//组合套餐组
$fittings_list = get_goods_fittings(array($goods_id));
if(is_array($fittings_list)){
foreach($fittings_list as $vo){
$fittings_index[$vo['group_id']] = 1;//关联数组
示例5: array
return $ft->errorpage('Sorry, that corporation does not seem to exist.');
}
# now get some interesting stats
$stats = array();
$get = array('week' => this_week(), 'month' => this_month(), 'year' => this_year(), 'ever' => 0);
foreach ($get as $when => $val) {
$st = $ft->dbh->_select_row_as_assoc('SELECT * FROM tbl:stats WHERE type = "corp" AND var1 = ? AND dtype = ? AND var2 = ?', array($corpid, $when, $val));
$stats[$when] = $st;
}
# get various top 10s
$ft->assign('t10weapons', get_top10('corp', $corpid, 'weapon'));
$ft->assign('t10shipslost', get_top10('corp', $corpid, 'ship_lost'));
$ft->assign('t10shipsdestroyed', get_top10('corp', $corpid, 'ship_killed'));
$ft->assign('t10systems', get_top10('corp', $corpid, 'system'));
$ft->assign('t10targets', get_top10('corp', $corpid, 'pilot'));
$ft->assign('t10shipsflown', get_top10('corp', $corpid, 'ship_flown'));
# get the last 50 final blows
# $fbids = $ft->dbh->_select_column('SELECT killid FROM tbl:summary WHERE k_pilotid = ? AND type = "kill" ' .
# 'ORDER BY killtime DESC LIMIT 10', array($pilotid));
# $fbs = load_kills_by_id($fbids);
# us killing them
$kids = $ft->dbh->_select_column('SELECT DISTINCT s.killid FROM tbl:killers k, tbl:summary s WHERE k.corpid = ? ' . 'AND s.killid = k.killid AND s.type = "kill" ' . 'ORDER BY s.killtime DESC LIMIT 10', array($corpid));
$ks = load_kills_by_id($kids);
# us losing to them
$lids = $ft->dbh->_select_column('SELECT DISTINCT killid FROM tbl:summary WHERE v_corpid = ? AND type = "loss" ' . 'ORDER BY killtime DESC LIMIT 10', array($corpid));
$ls = load_kills_by_id($lids);
# them killing us (FOR THEIR SIDE)
$xkids = $ft->dbh->_select_column('SELECT DISTINCT killid FROM tbl:summary WHERE k_corpid = ? AND type = "loss" ' . 'ORDER BY killtime DESC LIMIT 10', array($corpid));
$xks = load_kills_by_id($xkids);
# us killing them (FOR THEIR SIDE)
$xlids = $ft->dbh->_select_column('SELECT DISTINCT s.killid FROM tbl:killers k, tbl:summary s WHERE k_corpid = ? ' . 'AND s.killid = k.killid AND s.type = "kill" ' . 'ORDER BY s.killtime DESC LIMIT 10', array($corpid));
示例6: get_on_top_goods
function get_on_top_goods($id, $num = 5)
{
$sql = 'SELECT cat_id,cat_name FROM ' . $GLOBALS['ecs']->table('category') . ' WHERE is_on_top = 1 AND parent_id =' . $id;
$res = $GLOBALS['db']->getAll($sql);
foreach ($res as $idx => $row) {
$arr[$idx]['cat_url'] = build_uri('category', array('cid' => $row['cat_id']), $row['cat_name']);
$arr[$idx]['cat_name'] = $row['cat_name'];
$sql = 'SELECT cat_id,cat_name FROM ' . $GLOBALS['ecs']->table('category') . " WHERE parent_id = '{$row['cat_id']}' ORDER BY sort_order LIMIT 9 ";
$child_cat_res = $GLOBALS['db']->getAll($sql);
$child_cat = array();
$top_goods = array();
foreach ($child_cat_res as $key => $value) {
$child_cat[$key]['cat_id'] = $value['cat_id'];
$child_cat[$key]['cat_name'] = $value['cat_name'];
$child_cat[$key]['url'] = build_uri('category', array('cid' => $value['cat_id']), $value['cat_name']);
$top_goods[$key]['cat_name'] = $value['cat_name'];
$top_goods[$key]['goods'] = get_top10($value['cat_id']);
}
$children = get_children($row['cat_id']);
$sql = 'SELECT g.goods_id, g.goods_name, g.market_price, g.shop_price AS org_price, ' . "IFNULL(mp.user_price, g.shop_price * '{$_SESSION['discount']}') AS shop_price, " . 'g.promote_price, promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img ' . "FROM " . $GLOBALS['ecs']->table('goods') . ' AS g ' . "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp " . "ON mp.goods_id = g.goods_id AND mp.user_rank = '{$_SESSION['user_rank']}' " . 'WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND ' . 'g.is_delete = 0 AND (' . $children . ') ';
$order_rule = 'ORDER BY g.sort_order, g.goods_id DESC';
$sql .= $order_rule;
if ($num > 0) {
$sql .= ' LIMIT ' . $num;
}
$goods_res = $GLOBALS['db']->getAll($sql);
$goods = array();
foreach ($goods_res as $goods_idx => $goods_row) {
if ($goods_row['promote_price'] > 0) {
$promote_price = bargain_price($goods_row['promote_price'], $goods_row['promote_start_date'], $goods_row['promote_end_date']);
$goods[$goods_idx]['promote_price'] = $promote_price > 0 ? price_format($promote_price) : '';
} else {
$goods[$goods_idx]['promote_price'] = '';
}
$goods[$goods_idx]['id'] = $goods_row['goods_id'];
$goods[$goods_idx]['name'] = $goods_row['goods_name'];
$goods[$goods_idx]['brief'] = $goods_row['goods_brief'];
$goods[$goods_idx]['market_price'] = price_format($goods_row['market_price']);
$goods[$goods_idx]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($goods_row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $goods_row['goods_name'];
$goods[$goods_idx]['shop_price'] = price_format($goods_row['shop_price']);
$goods[$goods_idx]['thumb'] = get_image_path($goods_row['goods_id'], $goods_row['goods_thumb'], true);
$goods[$goods_idx]['goods_img'] = get_image_path($goods_row['goods_id'], $goods_row['goods_img']);
$goods[$goods_idx]['url'] = build_uri('goods', array('gid' => $goods_row['goods_id']), $goods_row['goods_name']);
}
$arr[$idx]['goods'] = $goods;
$arr[$idx]['child_cat'] = $child_cat;
$arr[$idx]['top_goods'] = $top_goods;
}
return $arr;
}
示例7: action_view
function action_view()
{
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
/* 取得参数:预售活动id */
$pre_sale_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
if ($pre_sale_id <= 0) {
ecs_header("Location: pre_sale.php\n");
exit;
}
/* 取得预售活动信息 */
$pre_sale = pre_sale_info($pre_sale_id);
if (empty($pre_sale)) {
ecs_header("Location: pre_sale.php\n");
exit;
}
// elseif ($pre_sale['is_on_sale'] == 0 || $pre_sale['is_alone_sale'] == 0)
// {
// header("Location: ./\n");
// exit;
// }
/* 评价数量 */
$pre_sale['comment_count'] = goods_comment_count($pre_sale['goods_id']);
/* 累计销量 */
$pre_sale['sale_count'] = goods_sale_count($pre_sale['goods_id']);
/* 赠送积分 */
$pre_sale['give_integral'] = $pre_sale['gift_integral'];
/* 缓存id:语言,预售活动id,状态,(如果是进行中)当前数量和是否登录 */
$cache_id = $_CFG['lang'] . '-' . $pre_sale_id . '-' . $pre_sale['status'];
// 活动进行中
if ($pre_sale['status'] == PSS_UNDER_WAY) {
$cache_id = $cache_id . '-' . $pre_sale['valid_goods'] . '-' . intval($_SESSION['user_id'] > 0);
}
$cache_id = sprintf('%X', crc32($cache_id));
/* 如果没有缓存,生成缓存 */
if (!$smarty->is_cached('pre_sale_goods.dwt', $cache_id) || true) {
$pre_sale['gmt_end_date'] = $pre_sale['end_date'];
$smarty->assign('pre_sale', $pre_sale);
/* 取得预售商品信息 */
$goods_id = $pre_sale['goods_id'];
$goods = get_goods_info($goods_id);
if (empty($goods)) {
ecs_header("Location: pre_sale.php\n");
exit;
}
$goods['url'] = build_uri('goods', array('gid' => $goods_id), $goods['goods_name']);
$goods = array_merge($goods, $pre_sale);
$gift_integral = $pre_sale['gift_integral'];
$goods['give_integral'] = $pre_sale['gift_integral'];
// $parent_cat_id = get_parent_cat_id($goods['cat_id']);
// $goods['child_cat'] = get_child_cat($parent_cat_id); // 相关分类
// $goods['get_cat_brands'] = get_cat_brands($parent_cat_id);; // 同类品牌
$smarty->assign('url', $_SERVER["REQUEST_URI"]);
$smarty->assign('volume_price', $goods_volume_price);
$smarty->assign('goods_id', $goods['goods_id']);
$smarty->assign('promote_end_time', $goods['gmt_end_time']);
$smarty->assign('helps', get_shop_help());
// 网店帮助
$smarty->assign('top_goods', get_top10());
// 销售排行
$smarty->assign('promotion_info', get_promotion_info());
// yyy添加start
$count1 = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " where comment_type=0 and id_value ='{$goods_id}' and status=1");
$smarty->assign('review_count', $count1);
// 评论数
// 评价晒单 增加 by www.68ecshop.com
$rank_num['rank_a'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (5,4)");
$rank_num['rank_b'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank in (3,2)");
$rank_num['rank_c'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND comment_rank = 1");
$rank_num['rank_total'] = $rank_num['rank_a'] + $rank_num['rank_b'] + $rank_num['rank_c'];
$rank_num['rank_pa'] = $rank_num['rank_a'] > 0 ? round($rank_num['rank_a'] / $rank_num['rank_total'] * 100, 1) : 0;
$rank_num['rank_pb'] = $rank_num['rank_b'] > 0 ? round($rank_num['rank_b'] / $rank_num['rank_total'] * 100, 1) : 0;
$rank_num['rank_pc'] = $rank_num['rank_c'] > 0 ? round($rank_num['rank_c'] / $rank_num['rank_total'] * 100, 1) : 0;
$rank_num['shaidan_num'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('shaidan') . " WHERE goods_id = '{$goods_id}' AND status = 1");
$smarty->assign('rank_num', $rank_num);
$res = $GLOBALS['db']->getAll("SELECT * FROM " . $GLOBALS['ecs']->table('goods_tag') . " WHERE goods_id = '{$goods_id}' AND state = 1");
foreach ($res as $v) {
$v['tag_num'] = $GLOBALS['db']->getOne("SELECT COUNT(*) AS num FROM " . $GLOBALS['ecs']->table('comment') . " WHERE id_value = '{$goods_id}' AND status = 1 AND FIND_IN_SET({$v['tag_id']},comment_tag)");
$tag_arr[] = $v;
}
require_once 'includes/lib_comment.php';
$tag_arr = array_sort($tag_arr, 'tag_num', 'desc');
if ($tag_arr) {
foreach ($tag_arr as $key => $val) {
if ($_CFG['tag_show_num'] > 0) {
if ($key + 1 <= $_CFG['tag_show_num']) {
$comment_tags[] = $val;
}
} else {
$comment_tags[] = $val;
}
}
}
$smarty->assign('comment_tags', $comment_tags);
/* meta */
$smarty->assign('keywords', htmlspecialchars($goods['keywords']));
$smarty->assign('description', htmlspecialchars($goods['goods_brief']));
$goods['goods_style_name'] = add_style($goods['goods_name'], $goods['goods_name_style']);
$smarty->assign('goods', $goods);
//.........这里部分代码省略.........
示例8: array
return $ft->errorpage('Sorry, that pilot does not seem to exist.');
}
# now get some interesting stats
$stats = array();
$get = array('week' => this_week(), 'month' => this_month(), 'year' => this_year(), 'ever' => 0);
foreach ($get as $when => $val) {
$st = $ft->dbh->_select_row_as_assoc('SELECT * FROM tbl:stats WHERE type = "pilot" AND var1 = ? AND dtype = ? AND var2 = ?', array($pilotid, $when, $val));
$stats[$when] = $st;
}
# get various top 10s
$ft->assign('t10weapons', get_top10('pilot', $pilotid, 'weapon'));
$ft->assign('t10shipslost', get_top10('pilot', $pilotid, 'ship_lost'));
$ft->assign('t10shipsdestroyed', get_top10('pilot', $pilotid, 'ship_killed'));
$ft->assign('t10systems', get_top10('pilot', $pilotid, 'system'));
$ft->assign('t10targets', get_top10('pilot', $pilotid, 'pilot'));
$ft->assign('t10shipsflown', get_top10('pilot', $pilotid, 'ship_flown'));
# get the last 50 final blows
# $fbids = $ft->dbh->_select_column('SELECT killid FROM tbl:summary WHERE k_pilotid = ? AND type = "kill" ' .
# 'ORDER BY killtime DESC LIMIT 10', array($pilotid));
# $fbs = load_kills_by_id($fbids);
# us killing them
$kids = $ft->dbh->_select_column('SELECT DISTINCT s.killid FROM tbl:killers k, tbl:summary s WHERE k.pilotid = ? ' . 'AND s.killid = k.killid AND s.type = "kill" ' . 'ORDER BY s.killtime DESC LIMIT 10', array($pilotid));
$ks = load_kills_by_id($kids);
# us losing to them
$lids = $ft->dbh->_select_column('SELECT DISTINCT killid FROM tbl:summary WHERE v_pilotid = ? AND type = "loss" ' . 'ORDER BY killtime DESC LIMIT 10', array($pilotid));
$ls = load_kills_by_id($lids);
# them killing us (FOR THEIR SIDE)
$xkids = $ft->dbh->_select_column('SELECT DISTINCT killid FROM tbl:summary WHERE k_pilotid = ? AND type = "loss" ' . 'ORDER BY killtime DESC LIMIT 10', array($pilotid));
$xks = load_kills_by_id($xkids);
# us killing them (FOR THEIR SIDE)
$xlids = $ft->dbh->_select_column('SELECT DISTINCT s.killid FROM tbl:killers k, tbl:summary s WHERE v_pilotid = ? ' . 'AND s.killid = k.killid AND s.type = "kill" ' . 'ORDER BY s.killtime DESC LIMIT 10', array($pilotid));