本文整理汇总了PHP中gcms::pagination方法的典型用法代码示例。如果您正苦于以下问题:PHP gcms::pagination方法的具体用法?PHP gcms::pagination怎么用?PHP gcms::pagination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gcms
的用法示例。
在下文中一共展示了gcms::pagination方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: number_format
$replace[] = number_format($item['visited']);
$replace[] = number_format($item['comments']);
if (!empty($item['picture']) && is_file(DATA_PATH . "document/{$item['picture']}")) {
$replace[] = DATA_URL . "document/{$item['picture']}";
} elseif (!empty($index['icon']) && is_file(DATA_PATH . "document/{$index['icon']}")) {
$replace[] = DATA_URL . "document/{$index['icon']}";
} else {
$replace[] = WEB_URL . "/{$index['default_icon']}";
}
if ($item['create_date'] > $valid_date && $item['comment_date'] == 0) {
$replace[] = ' new';
} elseif ($item['last_update'] > $valid_date || $item['comment_date'] > $valid_date) {
$replace[] = ' update';
} else {
$replace[] = '';
}
$list[] = preg_replace($patt, $replace, $listitem);
}
// URL สำหรับ แบ่งหน้า และ canonical
$c = $cat_count > 0 ? "&cat={$cat}" : '';
if (empty($tag)) {
$url = '<a href="' . gcms::getURL($index['module'], '', 0, 0, "page=%d{$c}") . '">%d</a>';
$canonical = gcms::getURL($index['module'], '', 0, 0, "page={$page}{$c}");
} else {
$url = '<a href="' . gcms::getURL('tag', $tag, 0, 0, "page=%d{$c}") . '">%d</a>';
$canonical = gcms::getURL('tag', $tag, 0, 0, "page={$page}{$c}");
}
// แบ่งหน้า
$splitpage = gcms::pagination($totalpage, $page, $url);
}
}
示例2: array
$tr .= '<td headers="r' . $id . ' c4" class=menu><a href="{URLQUERY?id=' . $id . '&module=countrywrite&src=country&spage=' . $page . '}" title="{LNG_MEMBER_EDIT_TITLE}" class=icon-edit></a></td>';
$tr .= '</tr>';
$content[] = $tr;
}
$content[] = '</tbody>';
$content[] = '<tfoot>';
$content[] = '<tr>';
$content[] = '<td headers=c0> </td>';
$content[] = '<td headers=c1 class=check-column><a class="checkall icon-uncheck"></a></td>';
$content[] = '<td headers=c2 colspan=3></td>';
$content[] = '</tr>';
$content[] = '</tfoot>';
$content[] = '</table>';
// แบ่งหน้า
$url = '<a href="{URLQUERY?module=country&page=%d}" title="{LNG_DISPLAY_PAGE} %d">%d</a>';
$content[] = '<div class=splitpage>' . gcms::pagination($totalpage, $page, $url) . '</div>';
$content[] = '<div class=table_nav>';
$content[] = '<fieldset>';
// sel action
$sel = array();
$sel[] = '<select id=sel_action>';
// delete
$sel[] = '<option value=delete_country>{LNG_DELETE}</option>';
// country zone
$sel[] = '<option value=zone_0>{LNG_COUNTRY_NO_ZONE}</option>';
if (isset($lng['COUNTRIES_ZONE'])) {
foreach ($lng['COUNTRIES_ZONE'] as $i => $item) {
$sel[] = '<option value=zone_' . $i . '>' . $item . '</option>';
}
}
$sel[] = '</select>';
示例3: implode
$replace[] = $item['detail'];
$replace[] = $item['count'];
$replace[] = $item['visited'];
$items[] = gcms::pregReplace($patt, $replace, $skin);
}
// URL สำหรับแบ่งหน้า
$qs[] = 'page=%d';
$url = '<a href="' . gcms::getURL($index['module'], '', 0, 0, implode('&', $qs)) . '">%d</a>';
// แสดงผล list รายการ
$patt = array('/{BREADCRUMS}/', '/{TOPIC}/', '/{DETAIL}/', '/{LIST}/', '/{SPLITPAGE}/', '/{COLS}/');
$replace = array();
$replace[] = implode("\n", $breadcrumbs);
$replace[] = $index['topic'];
$replace[] = nl2br($index['detail']);
$replace[] = implode("\n", $items);
$replace[] = gcms::pagination($totalpage, $page, $url);
$replace[] = $config['gallery_cols'];
$content = preg_replace($patt, $replace, gcms::loadtemplate($index['module'], 'gallery', 'album'));
}
// title,keywords,description
$title = $index['topic'];
$keywords = $index['keywords'];
$description = $index['description'];
// เลือกเมนู
$menu = $install_modules[$index['module']]['alias'];
$menu = $menu == '' ? $index['module'] : $menu;
} else {
$title = $lng['LNG_DATA_NOT_FOUND'];
$content = '<div class=error>' . $title . '</div>';
}
}