本文整理汇总了PHP中article::get_page_sum方法的典型用法代码示例。如果您正苦于以下问题:PHP article::get_page_sum方法的具体用法?PHP article::get_page_sum怎么用?PHP article::get_page_sum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类article
的用法示例。
在下文中一共展示了article::get_page_sum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: module_sheet
function module_sheet()
{
global $global, $smarty;
$prefix = $global['channel'] . '/mod-sheet';
if (isset($global['field'])) {
$prefix = $prefix . '/field-' . $global['field'];
}
if (isset($global['key'])) {
$prefix = $prefix . '/key-' . $global['key'];
}
$obj = new article();
$obj->set_where('art_channel_id = ' . $global['channel_id']);
if (isset($global['key'])) {
$obj->set_where($global['field'] . " like '%" . url_decode($global['key']) . "%'");
}
$obj->set_page_size(10);
$obj->set_page_num($global['page']);
$sheet = $obj->get_sheet();
for ($i = 0; $i < count($sheet); $i++) {
$sheet[$i]['cat_name'] = get_data('cat_art', $sheet[$i]['art_cat_id'], 'cat_name');
}
set_link($obj->get_page_sum());
$smarty->assign('article', $sheet);
$smarty->assign('prefix', $prefix);
}
示例2: module_search_main
function module_search_main()
{
global $global, $smarty;
$global['key'] = url_decode($global['key']);
$list_len = get_varia('art_list_len');
$obj = new article();
$obj->set_field('art_id,art_channel_id,art_title,art_add_time');
$obj->set_where("art_title like '%" . $global['key'] . "%'");
$obj->set_page_size($list_len ? $list_len : 20);
$obj->set_page_num($global['page']);
$sheet = $obj->get_sheet();
for ($i = 0; $i < count($sheet); $i++) {
$sheet[$i]['channel'] = get_data('channel', $sheet[$i]['art_channel_id'], 'cha_code');
$sheet[$i]['short_title'] = cut_str($sheet[$i]['art_title'], 42);
}
set_link($obj->get_page_sum());
$smarty->assign('search', $sheet);
}
示例3: module_article_main
function module_article_main()
{
global $global, $smarty;
if (!$global['id']) {
$art_best = get_global('best');
$prefix = get_data('channel', $global['channel_id'], 'cha_code');
$list_len = get_varia('art_list_len');
$obj = new article();
$obj->set_where('art_channel_id = ' . $global['channel_id']);
if ($global['cat']) {
$family = implode(',', get_cat_family('cat_art', $global['cat']));
$obj->set_where("art_cat_id in ({$family})");
$prefix .= '/cat-' . $global['cat'];
}
if ($art_best) {
$obj->set_where('art_best = 1');
$prefix .= '/best-1';
}
$obj->set_page_size($list_len ? $list_len : 20);
$obj->set_page_num($global['page']);
$sheet = $obj->get_sheet();
for ($i = 0; $i < count($sheet); $i++) {
$sheet[$i]['short_title'] = cut_str($sheet[$i]['art_title'], 42);
}
set_link($obj->get_page_sum());
$smarty->assign('show_sheet', 1);
$smarty->assign('article', $sheet);
$smarty->assign('prefix', $prefix);
} else {
$obj = new article();
$obj->set_field('art_id,art_title,art_author,art_add_time,art_text');
$obj->set_where('art_channel_id = ' . $global['channel_id']);
$obj->set_where('art_id = ' . $global['id']);
$one = $obj->get_one();
$smarty->assign('article', $one);
$obj = new article();
$obj->set_field('art_id,art_title');
$obj->set_where('art_channel_id = ' . $global['channel_id']);
$obj->set_where('art_id < ' . $global['id']);
$one = $obj->get_one();
if (count($one)) {
$smarty->assign('next_id', $one['art_id']);
$smarty->assign('next_title', cut_str($one['art_title'], 15));
} else {
$smarty->assign('next_id', '');
$smarty->assign('next_title', '');
}
$obj = new article();
$obj->set_field('art_id,art_title');
$obj->set_where('art_channel_id = ' . $global['channel_id']);
$obj->set_where('art_id > ' . $global['id']);
$obj->set_order('');
$obj->set_order('art_top', 'asc');
$obj->set_order('art_index', 'asc');
$obj->set_order('art_id', 'asc');
$one = $obj->get_one();
if (count($one)) {
$smarty->assign('prev_id', $one['art_id']);
$smarty->assign('prev_title', cut_str($one['art_title'], 15));
} else {
$smarty->assign('prev_id', '');
$smarty->assign('prev_title', '');
}
$obj = new varia();
$smarty->assign('share_code', im_filter($obj->get_value('share_code', true)));
$smarty->assign('show_sheet', 0);
}
}