本文整理汇总了PHP中get_wap_pager函数的典型用法代码示例。如果您正苦于以下问题:PHP get_wap_pager函数的具体用法?PHP get_wap_pager怎么用?PHP get_wap_pager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_wap_pager函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($cat_goods['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price'];
//$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>";
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']));
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'category.php?c_id=' . $c_id, 'page');
$smarty->assign('pagebar', $pagebar);
}
$pcat_array = get_parent_cats($c_id);
if (!empty($pcat_array[1]['cat_name'])) {
$pcat_array[1]['cat_name'] = encode_output($pcat_array[1]['cat_name']);
$smarty->assign('pcat_array', $pcat_array[1]);
}
$smarty->assign('footer', get_footer());
$smarty->display('category.wml');
示例2: intval
$page_num = '10';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($article_num / $page_num);
if ($page <= 0)
{
$page = 1;
}
if ($pages == 0)
{
$pages = 1;
}
if ($page > $pages)
{
$page = $pages;
}
$pagebar = get_wap_pager($article_num, $page_num, $page, 'article.php', 'page');
$smarty->assign('pagebar', $pagebar);
include_once(ROOT_PATH . '/includes/lib_article.php');
$article_array = get_cat_articles(-1, $page, $page_num);
$i = 1;
foreach ($article_array as $key => $article_data)
{
$article_array[$key]['i'] = $i;
$article_array[$key]['title'] = encode_output($article_data['title']);
$i++;
}
$smarty->assign('article_array', $article_array);
}
$smarty->display('article_list.html');
}
示例3: foreach
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($sort_array as $goods_key) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods[$goods_key]['promote_price_org']) ? $goods[$goods_key]['shop_price'] : $goods[$goods_key]['promote_price'];
//$wml_data .= "<a href='goods.php?id={}'>".encode_output($goods[$goods_key]['name'])."</a>[".encode_output($price)."]<br/>";
$goods_data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods[$goods_key]['id'], 'name' => encode_output($goods[$goods_key]['name']));
}
$i++;
}
$smarty->assign('goods_data', $goods_data);
$pagebar = get_wap_pager($num, $page_num, $page, 'goods_list.php?type=' . $type . '&order_price=' . (empty($order_price) ? 0 : $order_price), 'page');
$smarty->assign('pagebar', $pagebar);
}
$smarty->assign('footer', get_footer());
$smarty->display('goods_list.html');
/**
* 获得推荐商品
*
* @access public
* @param string $type 推荐类型,可以是 best, new, hot
* @param string $order_rule 指定商品排序规则
* @return array
*/
function wap_get_recommend_goods($type = '', $order_rule = '')
{
if (!in_array($type, array('best', 'new', 'hot'))) {
示例4: COUNT
$record_count = $db->getOne('SELECT COUNT(*) FROM ' . $ecs->table('order_info') . " WHERE user_id = {$_SESSION['user_id']}");
if ($record_count > 0) {
include_once ROOT_PATH . 'includes/lib_transaction.php';
$page_num = '10';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($record_count / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$pagebar = get_wap_pager($record_count, $page_num, $page, 'user.php?act=order_list', 'page');
$smarty->assign('pagebar', $pagebar);
/* 订单状态 */
$_LANG['os'][OS_UNCONFIRMED] = '未确认';
$_LANG['os'][OS_CONFIRMED] = '已确认';
$_LANG['os'][OS_CANCELED] = '已取消';
$_LANG['os'][OS_INVALID] = '无效';
$_LANG['os'][OS_RETURNED] = '退货';
$_LANG['ss'][SS_UNSHIPPED] = '未发货';
$_LANG['ss'][SS_SHIPPED] = '已发货';
$_LANG['ss'][SS_RECEIVED] = '收货确认';
$_LANG['ps'][PS_UNPAYED] = '未付款';
$_LANG['ps'][PS_PAYING] = '付款中';
$_LANG['ps'][PS_PAYED] = '已付款';
$_LANG['confirm_cancel'] = '您确认要取消该订单吗?取消后此订单将视为无效订单';
$_LANG['cancel'] = '取消订单';
示例5: foreach
foreach ($goods as $key => $data) {
$sort_array[$data['id']] = $key;
}
krsort($sort_array);
$page_num = '10';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($sort_array as $goods_key) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods[$goods_key]['promote_price_org']) ? $goods[$goods_key]['shop_price'] : $goods[$goods_key]['promote_price'];
//$wml_data .= "<a href='goods.php?id={}'>".encode_output($goods[$goods_key]['name'])."</a>[".encode_output($price)."]<br/>";
$goods_data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods[$goods_key]['id'], 'name' => encode_output($goods[$goods_key]['name']));
}
$i++;
}
$smarty->assign('goods_data', $goods_data);
$pagebar = get_wap_pager($num, $page_num, $page, 'goods_list.php?type=' . $type, 'page');
$smarty->assign('pagebar', $pagebar);
}
$smarty->assign('footer', get_footer());
$smarty->display('goods_list.wml');
示例6: get_article_count
}
} else {
include_once ROOT_PATH . '/includes/lib_article.php';
$article_num = get_article_count($cid);
$page_num = '10';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($article_num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$pagebar = get_wap_pager($article_num, $page_num, $page, 'article.php?cid=' . $cid, 'page');
$smarty->assign('pagebar', $pagebar);
$article_array = get_cat_articles($cid, $page, $page_num);
$i = 1;
foreach ($article_array as $key => $article_data) {
$article_array[$key]['i'] = $i;
$article_array[$key]['title'] = encode_output($article_data['title']);
$i++;
}
$smarty->assign('article_array', $article_array);
$cat_name = $db->getOne("SELECT cat_name FROM " . $ecs->table('article_cat') . " WHERE cat_id = '{$cid}'");
$smarty->assign('cat_name', $cat_name);
}
$smarty->display('article_list.dwt');
}
示例7: foreach
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($brands_array['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price'];
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']), 'thumb' => $goods_data['thumb'], 'goods_img' => $goods_data['goods_img']);
// 10:34 2013-7-27
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'brands.php?b_id=' . $b_id . '&sort=' . (empty($get_sort) ? 0 : $get_sort) . '&order=' . (empty($get_order) ? 0 : $get_order), 'page');
$smarty->assign('pagebar', $pagebar);
}
}
$brands_array = get_brands();
if (count($brands_array) > 1) {
foreach ($brands_array as $key => $brands_data) {
$brands_array[$key]['brand_name'] = encode_output($brands_data['brand_name']);
}
$smarty->assign('brand_id', $b_id);
$smarty->assign('other_brands', $brands_array);
}
$smarty->assign('sort', $get_sort);
$smarty->assign('order', $get_order);
$smarty->assign('footer', get_footer());
$smarty->display('brands.dwt');
示例8: db_create_in
$sql2 .= ' WHERE `is_on_sale`=1 AND `is_alone_sale`=1 AND ' . db_create_in($a_goods_id, 'g.goods_id');
}
$record_count = $db->getOne($sql1);
if ($record_count > 0) {
$page_num = '10';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($record_count / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$pagebar = get_wap_pager($record_count, $page_num, $page, "activities_goods.php?id={$id}", 'page');
$smarty->assign('pagebar', $pagebar);
$start = $page_num * ($page - 1);
$sql2 .= " LIMIT {$start},{$page_num}";
$goods_list = $db->getAll($sql2);
if (!empty($goods_list)) {
foreach ($goods_list as $key => $val) {
$goods_list[$key]['shop_price'] = price_format($val['shop_price']);
}
}
$smarty->assign('goods_list', $goods_list);
$smarty->display('activity_goods.dwt');
}
}
}
示例9: foreach
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($brands_array['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price'];
//$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>";
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']));
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'brands.php?b_id=' . $b_id . '&order_price=' . (empty($order_price) ? 0 : $order_price), 'page');
$smarty->assign('pagebar', $pagebar);
}
}
$brands_array = get_brands();
if (count($brands_array) > 1) {
foreach ($brands_array as $key => $brands_data) {
$brands_array[$key]['brand_name'] = encode_output($brands_data['brand_name']);
}
$smarty->assign('brand_id', $b_id);
$smarty->assign('other_brands', $brands_array);
}
$smarty->assign('footer', get_footer());
$smarty->display('brands.html');
示例10: foreach
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($brands_array['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price'];
//$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>";
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']));
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'brands.php?b_id=' . $b_id, 'page');
$smarty->assign('pagebar', $pagebar);
}
$brands_array = get_brands();
if (count($brands_array) > 1) {
foreach ($brands_array as $key => $brands_data) {
$brands_array[$key]['brand_name'] = encode_output($brands_data['brand_name']);
}
$smarty->assign('brand_id', $b_id);
$smarty->assign('other_brands', $brands_array);
}
$smarty->assign('footer', get_footer());
$smarty->display('brands.wml');
示例11: foreach
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($cat_goods['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = empty($goods_info['promote_price_org']) ? $goods_data['shop_price'] : $goods_data['promote_price'];
//$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>";
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']));
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'category.php?c_id=' . $c_id . '&order_price=' . (empty($order_price) ? 0 : $order_price), 'page');
$smarty->assign('pagebar', $pagebar);
}
$pcat_array = get_parent_cats($c_id);
if (!empty($pcat_array[1]['cat_name'])) {
$pcat_array[1]['cat_name'] = encode_output($pcat_array[1]['cat_name']);
$smarty->assign('pcat_array', $pcat_array[1]);
}
$smarty->assign('cat_array', $cat_array);
}
$smarty->assign('footer', get_footer());
$smarty->display('category.html');
示例12: foreach
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($cat_goods['goods'] as $goods_data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$price = !empty($goods_data['promote_price']) ? $goods_data['promote_price'] : $goods_data['shop_price'];
//$wml_data .= "<a href='goods.php?id={$goods_data['id']}'>".encode_output($goods_data['name'])."</a>[".encode_output($price)."]<br/>";
$data[] = array('i' => $i, 'price' => encode_output($price), 'id' => $goods_data['id'], 'name' => encode_output($goods_data['name']), 'thumb' => $goods_data['thumb'], 'goods_img' => $goods_data['goods_img']);
//16:41 2013-07-16
}
$i++;
}
$smarty->assign('goods_data', $data);
$pagebar = get_wap_pager($num, $page_num, $page, 'category.php?c_id=' . $c_id . '&sort=' . (empty($get_sort) ? 0 : $get_sort) . '&order=' . (empty($get_order) ? 0 : $get_order), 'page');
$smarty->assign('pagebar', $pagebar);
}
$pcat_array = get_parent_cats($c_id);
if (!empty($pcat_array[1]['cat_name'])) {
$pcat_array[1]['cat_name'] = encode_output($pcat_array[1]['cat_name']);
$smarty->assign('pcat_array', $pcat_array[1]);
}
$smarty->assign('cat_array', $cat_array);
}
$smarty->assign('sort', $get_sort);
$smarty->assign('order', $get_order);
$smarty->assign('footer', get_footer());
$smarty->assign('footer', get_footer());
$smarty->display('category.dwt');
示例13: intval
$record_count = $db->getOne($sql);
//分页函数
if ($record_count) {
$page_num = '8';
$page = !empty($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$pages = ceil($record_count / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$pagebar = get_wap_pager($record_count, $page_num, $page, 'account.php', 'page');
$smarty->assign('pagebar', $pagebar);
}
//获取剩余余额
$surplus_amount = get_user_surplus($user_id);
if (empty($surplus_amount)) {
$surplus_amount = 0;
}
//获取余额记录
$account_log = array();
$sql = "SELECT * FROM " . $ecs->table('account_log') . " WHERE user_id = '{$user_id}'" . " AND {$account_type} <> 0 " . " ORDER BY log_id DESC";
$page_num = '8';
$res = $GLOBALS['db']->selectLimit($sql, $page_num);
while ($row = $db->fetchRow($res)) {
$row['change_time'] = local_date($_CFG['date_format'], $row['change_time']);
$row['type'] = $row[$account_type] > 0 ? $_LANG['account_inc'] : $_LANG['account_dec'];
示例14: intval
$num = $comment['pager']['record_count'];
if ($num > 0) {
$page_num = '5';
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;
$pages = ceil($num / $page_num);
if ($page <= 0) {
$page = 1;
}
if ($pages == 0) {
$pages = 1;
}
if ($page > $pages) {
$page = $pages;
}
$i = 1;
foreach ($comment['comments'] as $key => $data) {
if ($i > $page_num * ($page - 1) && $i <= $page_num * $page) {
$re_content = !empty($data['re_content']) ? encode_output($data['re_content']) : '';
$re_username = !empty($data['re_username']) ? encode_output($data['re_username']) : '';
$re_add_time = !empty($data['re_add_time']) ? substr($data['re_add_time'], 5, 14) : '';
$comment_data[] = array('i' => $i, 'content' => encode_output($data['content']), 'username' => encode_output($data['username']), 'add_time' => substr($data['add_time'], 5, 14), 're_content' => $re_content, 're_username' => $re_username, 're_add_time' => $re_add_time, 'comment_rank' => $data['rank'] / 5 * 100);
}
$i++;
}
$smarty->assign('comment_data', $comment_data);
$pagebar = get_wap_pager($num, $page_num, $page, 'comment.php?g_id=' . $goods_id, 'page');
$smarty->assign('pagebar', $pagebar);
}
$smarty->assign('footer', get_footer());
$smarty->display('comment.dwt');
}
示例15: stripslashes
$smarty->assign('search_keywords', stripslashes($_REQUEST['keywords']));
/* 分页 */
$url_format = "search.php?category={$category}&keywords=" . urlencode(stripslashes($_REQUEST['keywords'])) . "&brand=" . $_REQUEST['brand'] . "&action=" . $action . "&goods_type=" . $_REQUEST['goods_type'] . "&sc_ds=" . $_REQUEST['sc_ds'];
if (!empty($_REQUEST['intro'])) {
$url_format .= "&intro=" . $_REQUEST['intro'];
}
if (isset($_REQUEST['pickout'])) {
$url_format .= '&pickout=1';
}
$url_format .= "&min_price=" . $_REQUEST['min_price'] . "&max_price=" . $_REQUEST['max_price'] . "&sort={$sort}";
$url_format .= "{$attr_url}&order={$order}&page=";
$pager['search'] = array('keywords' => stripslashes(urlencode($_REQUEST['keywords'])), 'category' => $category, 'brand' => $_REQUEST['brand'], 'sort' => $sort, 'order' => $order, 'min_price' => $_REQUEST['min_price'], 'max_price' => $_REQUEST['max_price'], 'action' => $action, 'intro' => empty($_REQUEST['intro']) ? '' : trim($_REQUEST['intro']), 'goods_type' => $_REQUEST['goods_type'], 'sc_ds' => $_REQUEST['sc_ds'], 'outstock' => $_REQUEST['outstock']);
$pager['search'] = array_merge($pager['search'], $attr_arg);
$pager = get_pager('search.php', $pager['search'], $count, $page, $size);
$smarty->assign('pager', $pager);
$pagebar = get_wap_pager($count, $size, $page, $url_format, 'page');
$smarty->assign('pagebar', $pagebar);
$_LANG['sort']['goods_id'] = '按上架时间排序';
$_LANG['sort']['shop_price'] = '按价格排序';
$_LANG['sort']['last_update'] = '按更新时间排序';
$_LANG['order']['DESC'] = '倒序';
$_LANG['order']['ASC'] = '正序';
$smarty->assign('lang', $_LANG);
assign_dynamic('search');
if (!empty($GLOBALS['_CFG']['search_keywords'])) {
$searchkeywords = explode(',', trim($GLOBALS['_CFG']['search_keywords']));
} else {
$searchkeywords = array();
}
$smarty->assign('searchkeywords', $searchkeywords);
$smarty->assign('footer', get_footer());