当前位置: 首页>>代码示例>>PHP>>正文


PHP assign_pager函数代码示例

本文整理汇总了PHP中assign_pager函数的典型用法代码示例。如果您正苦于以下问题:PHP assign_pager函数的具体用法?PHP assign_pager怎么用?PHP assign_pager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assign_pager函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ceil

    $pages = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $pages) {
        $page = $pages;
    }
    $pager['search']['id'] = $cat_id;
    $keywords = '';
    $goon_keywords = '';
    //继续传递的搜索关键词
    /* 获得文章列表 */
    if (isset($_REQUEST['keywords'])) {
        $keywords = addslashes(htmlspecialchars(urldecode(trim($_REQUEST['keywords']))));
        $pager['search']['keywords'] = $keywords;
        $search_url = substr(strrchr($_POST['cur_url'], '/'), 1);
        $smarty->assign('search_value', stripslashes(stripslashes($keywords)));
        $smarty->assign('search_url', $search_url);
        $count = get_article_count($cat_id, $keywords);
        $pages = $count > 0 ? ceil($count / $size) : 1;
        if ($page > $pages) {
            $page = $pages;
        }
        $goon_keywords = urlencode($_REQUEST['keywords']);
    }
    $smarty->assign('artciles_list', get_cat_articles($cat_id, $page, $size, $keywords));
    $smarty->assign('cat_id', $cat_id);
    /* 分页 */
    assign_pager('article_cat', $cat_id, $count, $size, '', '', $page, $goon_keywords);
    assign_dynamic('article_cat');
}
$smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? "feed-typearticle_cat" . $cat_id . ".xml" : 'feed.php?type=article_cat' . $cat_id);
// RSS URL
$smarty->display('article_cat.dwt', $cache_id);
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:article_cat.php

示例2: brand_recommend_goods

        $smarty->assign('vote', $vote['content']);
    }
    $smarty->assign('best_goods', brand_recommend_goods('best', $brand_id, $cate));
    $smarty->assign('promotion_goods', brand_recommend_goods('promote', $brand_id, $cate));
    $smarty->assign('brand', $brand_info);
    $smarty->assign('promotion_info', get_promotion_info());
    $count = goods_count_by_brand($brand_id, $cate);
    $goodslist = brand_get_goods($brand_id, $cate, $size, $page, $sort, $order);
    if ($display == 'grid') {
        if (count($goodslist) % 2 != 0) {
            $goodslist[] = array();
        }
    }
    $smarty->assign('goods_list', $goodslist);
    $smarty->assign('script_name', 'brand');
    assign_pager('brand', $cate, $count, $size, $sort, $order, $page, '', $brand_id, 0, 0, $display);
    // 分页
    assign_dynamic('brand');
    // 动态内容
}
$smarty->display('brand.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
 * 获得指定品牌的详细信息.
 *
 * @param int $id
 */
function get_brand_info($id)
{
开发者ID:netroby,项目名称:ecshop,代码行数:31,代码来源:brand.php

示例3: get_exchange_goods_count

        $count = get_exchange_goods_count($children, $integral_min, $integral_max);
        $max_page = $count > 0 ? ceil($count / $size) : 1;
        if ($page > $max_page) {
            $page = $max_page;
        }
        $goodslist = exchange_get_goods($children, $integral_min, $integral_max, $ext, $size, $page, $sort, $order);
        if ($display == 'grid') {
            if (count($goodslist) % 2 != 0) {
                $goodslist[] = array();
            }
        }
        $smarty->assign('goods_list', $goodslist);
        $smarty->assign('category', $cat_id);
        $smarty->assign('integral_max', $integral_max);
        $smarty->assign('integral_min', $integral_min);
        assign_pager('exchange', $cat_id, $count, $size, $sort, $order, $page, '', '', $integral_min, $integral_max, $display);
        // 分页
        assign_dynamic('exchange_list');
        // 动态内容
    }
    $smarty->assign('feed_url', $_CFG['rewrite'] == 1 ? "feed-typeexchange.xml" : 'feed.php?type=exchange');
    // RSS URL
    $smarty->display('exchange_list.dwt', $cache_id);
} elseif ($_REQUEST['act'] == 'view') {
    $goods_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
    $cache_id = $goods_id . '-' . $_SESSION['user_rank'] . '-' . $_CFG['lang'] . '-exchange';
    $cache_id = sprintf('%X', crc32($cache_id));
    if (!$smarty->is_cached('exchange_goods.dwt', $cache_id)) {
        $smarty->assign('image_width', $_CFG['image_width']);
        $smarty->assign('image_height', $_CFG['image_height']);
        $smarty->assign('helps', get_shop_help());
开发者ID:nirvana-info,项目名称:old_bak,代码行数:31,代码来源:exchange.php

示例4: htmlspecialchars

    $smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
    $smarty->assign('pinpai_list', $pinpai_list);
    $smarty->assign('act', $act);
    $smarty->assign('mainboard', $mainboard);
    $smarty->assign('cpu', $cpu);
    $smarty->assign('step', $step);
    $smarty->assign('typename', $typename);
    $smarty->assign('func', $func);
    $smarty->assign('goods_list', $goods);
    $smarty->assign('helps', get_shop_help());
    // 网店帮助
    /* links */
    $links = index_get_links();
    $smarty->assign('img_links', $links['img']);
    $smarty->assign('txt_links', $links['txt']);
    assign_pager('diy', $act, $count, $size, '', '', $page, '', '', '', '', '', '', $step, $cpu, $mainboard, $brand_id, $keyword);
    // 分页
    //}
    $smarty->display('diy_goods.dwt');
}
/**
 * 获得所有的友情链接
 *
 * @access  private
 * @return  array
 */
function index_get_links()
{
    $sql = 'SELECT link_logo, link_name, link_url FROM ' . $GLOBALS['ecs']->table('friend_link') . ' ORDER BY show_order';
    $res = $GLOBALS['db']->getAll($sql);
    $links['img'] = $links['txt'] = array();
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:diy.php

示例5: category_get_goods

    }
    $goodslist = category_get_goods($children, $brand, $price_min, $price_max, $ext, $size, $page, $sort, $order);
    if ($display == 'grid') {
        if (count($goodslist) % 2 != 0) {
            $goodslist[] = array();
        }
    }
    $smarty->assign('goods_list', $goodslist);
    $smarty->assign('category', $cat_id);
    $smarty->assign('script_name', 'category');
    $smarty->assign('cat_name_curr', $cat['cat_name']);
    $smarty->assign('condition', $condition);
    $smarty->assign('brand_have_logo', $brand_have_logo);
    $smarty->assign('filter_attr_count', count($all_attr_list));
    $filter = isset($_REQUEST['filter']) ? intval($_REQUEST['filter']) : 0;
    assign_pager('category', $cat_id, $count, $size, $sort, $order, $page, '', $brand, $price_min, $price_max, $display, $filter_attr_str, '', '', $filter);
    // 分页
    assign_dynamic('category');
    // 动态内容
}
function get_categories($cat_id = 0)
{
    if ($cat_id > 0) {
        $parent_id = $cat_id;
    } else {
        $parent_id = 0;
    }
    /*
    判断当前分类中全是是否是底级分类,
    如果是取出底级分类上级分类,
    如果不是取当前分类及其下的子分类
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:category.php

示例6: get_categories_tree_supplier

    //$smarty->assign('ur_here',         $ur_here);  // 当前位置
    $smarty->assign('categories', get_categories_tree_supplier());
    // 分类树
    $children = get_children_supplier($cat_id);
    $count = get_cagtegory_goods_count($children);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    $goodslist = category_get_goods($children, $size, $page);
    if ($display == 'grid') {
        if (count($goodslist) % 2 != 0) {
            $goodslist[] = array();
        }
    }
    assign_pager('supplier', $cat_id, $count, $size, '', '', $page, '', '', '', '', $display, '');
    // 分页
    $smarty->assign('goods_list', $goodslist);
    assign_dynamic('category');
}
$smarty->display('category.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
 * 获得分类下的商品
 *
 * @access  public
 * @param   string  $children
 * @return  array
 */
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:supplier_category.php

示例7: empty

    $brands[0]['selected'] = empty($brand) ? 1 : 0;
    $smarty->assign('brands', $brands);
    $count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max);
    //$count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max, $ext);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    $goodslist = category_get_goods($children, $brand, $price_min, $price_max, $size, $page, $sort, $order);
    //$goodslist = category_get_goods($children, $brand, $price_min, $price_max, $ext, $size, $page, $sort, $order);
    if ($display == 'grid') {
        if (count($goodslist) % 2 != 0) {
            $goodslist[] = array();
        }
    }
    assign_pager('supplier', $cat_id, $count, $size, $sort, $order, $page, '', $brands, $price_min, $price_max, $display, '');
    // 分页
    $smarty->assign('goods_list', $goodslist);
    assign_dynamic('category');
}
$smarty->display('category.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
 * 获得分类的信息
 *
 * @param   integer $cat_id
 *
 * @return  void
 */
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:supplier_category.php

示例8: get_cagtegory_goods_count

    $count = get_cagtegory_goods_count($children, $brand, $price_min, $price_max, $ext);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    $goodslist = category_get_goods($children, $brand, $price_min, $price_max, $ext, $size, $page, $sort, $order);
    if ($display == 'grid') {
        if (count($goodslist) % 2 != 0) {
            $goodslist[] = array();
        }
    }
    $smarty->assign('maxpage', $max_page);
    $smarty->assign('goods_list', $goodslist);
    $smarty->assign('category', $cat_id);
    $smarty->assign('script_name', 'v_shop_list');
    assign_pager('v_shop_list', $cat_id, $count, $size, $sort, $order, $page, '', $brand, $price_min, $price_max, $display, $filter_attr_str);
    // 分页
    assign_dynamic('v_shop_list');
    // 动态内容
}
$smarty->assign('cat_id', $cat_id);
$smarty->assign('brand', $brand);
$smarty->assign('price_min', $price_min);
$smarty->assign('price_max', $price_max);
$smarty->assign('filter_attr_str', $filter_attr_str);
$smarty->display('v_shop_list.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
 * 获得分类的信息
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:v_shop_list.php

示例9: ecs_header

    if ($children === false) {
        ecs_header("Location: supplier.php?suppId=" . $_GET['suppId']);
        exit;
    }
    $count = get_cagtegory_goods_count($children, $keywords, $s_value);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    $goodslist = category_get_goods($children, $size, $page, $keywords, $s_value, $sort, $order);
    if ($display == 'grid') {
        if (count($goodslist) % 2 != 0) {
            $goodslist[] = array();
        }
    }
    assign_pager('supplier', $cat_id, $count, $size, $sort, $order, $page, $keywords . "&price=" . $price, '', '', '', $display, '');
    // 分页
    $smarty->assign('goods_list', $goodslist);
    assign_dynamic('search');
}
$smarty->display('search.dwt', $cache_id);
/*------------------------------------------------------ */
//-- PRIVATE FUNCTION
/*------------------------------------------------------ */
/**
 * 获得指定商品属性所属的分类的ID
 *
 * @access  public
 * @param   integer     $cat        (1=>'精品推荐',2=>'新品上市',3=>'热卖商品')
 * @param	string		$keywords    关键字
 * @return  string
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:supplier_search.php

示例10: assign_ur_here

 $position = assign_ur_here();
 $smarty->assign('page_title', $position['title']);
 // 页面标题
 $smarty->assign('ur_here', $position['ur_here']);
 // 当前位置
 $is_separate = intval($_REQUEST['is_separate']);
 /* 初始化分页信息 */
 $page = isset($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1;
 $size = isset($_REQUEST['page_size']) && intval($_REQUEST['page_size']) > 0 ? intval($_REQUEST['page_size']) : 10;
 $count = get_count_distrib_order_by_user_id($_SESSION['user_id'], $is_separate);
 $max_page = $count > 0 ? ceil($count / $size) : 1;
 if ($page > $max_page) {
     $page = $max_page;
 }
 $smarty->assign('order_list', get_all_distrib_order_by_user_id($_SESSION['user_id'], $is_separate, $page, $size));
 assign_pager('v_user_shouyimore', '', $count, $size, '', '', $page);
 // 分页
 /* meta information */
 $smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));
 $smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
 $smarty->assign('user_id', $_SESSION['user_id']);
 if ($is_separate == 1) {
     $v_title = '已分成';
 } elseif ($is_separate == 2) {
     $v_title = '取消分成';
 } else {
     $v_title = '未分成';
 }
 $smarty->assign('v_title', $v_title);
 /* 页面中的动态内容 */
 assign_dynamic('v_user_shouyimore');
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:v_user_shouyimore.php

示例11: show_message

    if ($level == 0) {
        show_message('您没有权限查看此会员分成订单信息');
    }
    $user_info = get_user_info_by_user_id($user_id);
    //用户信息,包括昵称和头像
    $smarty->assign('user_info', $user_info);
    /* 初始化分页信息 */
    $page = isset($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1;
    $size = isset($_REQUEST['page_size']) && intval($_REQUEST['page_size']) > 0 ? intval($_REQUEST['page_size']) : 10;
    $count = get_affiliate_count_by_user_id($user_id);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    $smarty->assign('order_list', get_affiliate_info_by_user_id($user_id, $page, $size));
    assign_pager('v_user_huiyuan_list', '', $count, $size, '', '', $page);
    // 分页
    $smarty->assign('user_id', $_SESSION['user_id']);
    /* 页面中的动态内容 */
    assign_dynamic('v_user_huiyuan_list');
}
$smarty->display('v_user_huiyuan_list.dwt', $cache_id);
//获取会员分成订单数量
function get_affiliate_count_by_user_id($user_id)
{
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('order_info') . " o" . " LEFT JOIN" . $GLOBALS['ecs']->table('users') . " u ON o.user_id = u.user_id" . " LEFT JOIN " . $GLOBALS['ecs']->table('affiliate_log') . " a ON o.order_id = a.order_id" . " WHERE o.user_id > 0 AND a.user_id = '{$user_id}' AND o.is_separate > 0 AND a.separate_type = 0";
    return $GLOBALS['db']->getOne($sql);
}
//获取会员分成订单信息
function get_affiliate_info_by_user_id($user_id, $page, $size)
{
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:v_user_huiyuan_list.php

示例12: htmlspecialchars

    // 页面标题
    $smarty->assign('ur_here', $position['ur_here']);
    // 当前位置
    /* meta information */
    $smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords']));
    $smarty->assign('description', htmlspecialchars($_CFG['shop_desc']));
    /* 初始化分页信息 */
    $page = isset($_REQUEST['page']) && intval($_REQUEST['page']) > 0 ? intval($_REQUEST['page']) : 1;
    $size = isset($_REQUEST['page_size']) && intval($_REQUEST['page_size']) > 0 ? intval($_REQUEST['page_size']) : 10;
    $count = get_deposit_count_by_user_id($_SESSION['user_id']);
    $max_page = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $max_page) {
        $page = $max_page;
    }
    $smarty->assign('deposit_list', get_deposit_by_user_id($_SESSION['user_id'], $page, $size));
    assign_pager('v_user_tixianmore', '', $count, $size, '', '', $page);
    // 分页
    $smarty->assign('user_id', $_SESSION['user_id']);
    /* 页面中的动态内容 */
    assign_dynamic('v_user_tixianmore');
}
$smarty->display('v_user_tixianmore.dwt', $cache_id);
//获取提现记录数量
function get_deposit_count_by_user_id($user_id)
{
    return $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('deposit') . " WHERE user_id = '{$user_id}'");
}
//获取提现记录
function get_deposit_by_user_id($user_id, $page, $size)
{
    $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('deposit') . " WHERE user_id = '{$user_id}'";
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:v_user_tixianmore.php

示例13: get_top10

    // 网店帮助
    $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('promotion_info', get_promotion_info());
    /* Meta */
    $meta = $db->getRow("SELECT keywords, cat_desc FROM " . $ecs->table('article_cat') . " WHERE cat_id = '{$cat_id}'");
    if ($meta === false || empty($meta)) {
        /* 如果没有找到任何记录则返回首页 */
        ecs_header("Location: ./\n");
        exit;
    }
    $smarty->assign('keywords', htmlspecialchars($meta['keywords']));
    $smarty->assign('description', htmlspecialchars($meta['cat_desc']));
    /* 获得文章总数 */
    $size = isset($_CFG['article_page_size']) && intval($_CFG['article_page_size']) > 0 ? intval($_CFG['article_page_size']) : 20;
    $count = get_article_count($cat_id);
    $pages = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $pages) {
        $page = $pages;
    }
    /* 获得文章列表 */
    $smarty->assign('artciles_list', get_cat_articles($cat_id, $page, $size));
    /* 分页 */
    assign_pager('article_cat', $cat_id, $count, $size, '', '', $page);
    assign_dynamic('article_cat');
}
$smarty->display('article_cat.dwt', $cache_id);
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:article_cat.php

示例14: substr

    $pager['search']['keywords'] = $keywords;
    $search_url = substr(strrchr($_POST['cur_url'], '/'), 1);
    $smarty->assign('search_value', stripslashes(stripslashes($keywords)));
    $smarty->assign('search_url', $search_url);
    $count = get_article_count($cat_id, $keywords);
    $pages = $count > 0 ? ceil($count / $size) : 1;
    if ($page > $pages) {
        $page = $pages;
    }
    $goon_keywords = urlencode($_REQUEST['keywords']);
}
$news_list = queryListByCatId($cat_id, $page, $size, $keywords);
$smarty->assign('news_list', $news_list);
$smarty->assign('cat_id', $id);
/* 分页 */
assign_pager('news_list', $id, $count, $size, '', '', $page, $goon_keywords);
$smarty->display('news_list.dwt');
function findIdByName($cat_name)
{
    $sql = "SELECT cat_id FROM `ecs_article_cat` WHERE cat_name = '" . $cat_name . "'";
    return $GLOBALS['db']->getOne($sql);
}
function queryListByCatId($cat_id, $page, $size, $keywords)
{
    $sql = 'SELECT a.article_id, a.title, ac.cat_name, a.add_time, a.file_url, a.open_type, ac.cat_id, ac.cat_name, a.content ' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' AS a, ' . $GLOBALS['ecs']->table('article_cat') . ' AS ac' . " WHERE a.is_open = 1 AND a.cat_id = ac.cat_id AND ac.cat_id = {$cat_id}" . ' ORDER BY a.article_type DESC, a.add_time DESC LIMIT ' . $size * ($page - 1) . ',' . $size * $page;
    $res = $GLOBALS['db']->getAll($sql);
    $arr = array();
    foreach ($res as $idx => $row) {
        $arr[$idx]['id'] = $row['article_id'];
        $arr[$idx]['title'] = $row['title'];
        $arr[$idx]['short_title'] = $GLOBALS['_CFG']['article_title_length'] > 0 ? sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title'];
开发者ID:flyindance,项目名称:jiayinobs,代码行数:31,代码来源:news_list.php


注:本文中的assign_pager函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。