本文整理汇总了PHP中Misc::genPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::genPage方法的具体用法?PHP Misc::genPage怎么用?PHP Misc::genPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Misc
的用法示例。
在下文中一共展示了Misc::genPage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
Cache::loadPage('', 30);
$inputData = array();
$postid = 0;
$curPage = 0;
// Model::loadWithPath('home',System::getThemePath().'model/');
if (!($match = Uri::match('tag\\/(\\w+)\\/?'))) {
Redirect::to('404page');
}
$friendly_url = addslashes($match[1]);
if ($match = Uri::match('page\\/(\\d+)')) {
$curPage = (int) $match[1];
}
$loadData = Post::get(array('limitShow' => 10, 'limitPage' => $curPage, 'cacheTime' => 30, 'where' => "where postid IN (select postid from post_tags where title='{$friendly_url}')", 'orderby' => "order by postid desc"));
if (!isset($loadData[0]['postid'])) {
Redirect::to('404page');
}
$inputData['newPost'] = $loadData;
$inputData['keywords'] = $friendly_url;
$inputData['listPage'] = Misc::genPage('tag/' . $friendly_url, $curPage);
System::setTitle('Tag "' . $friendly_url . '" results:');
self::makeContent('tag', $inputData);
Cache::savePage();
}
示例2: index
public function index()
{
$post = array('alert' => '');
Model::load('admincp/usergroups');
if ($match = Uri::match('\\/usergroups\\/(\\w+)')) {
if (method_exists("controlUsergroups", $match[1])) {
$method = $match[1];
$this->{$method}();
die;
}
}
$curPage = 0;
if ($match = Uri::match('\\/page\\/(\\d+)')) {
$curPage = $match[1];
}
if (Request::has('btnAction')) {
actionProcess();
}
// $valid=UserGroups::getThisPermission('can_addnew_usergroup');
$post['pages'] = Misc::genPage('admincp/usergroups', $curPage);
$post['theList'] = UserGroups::get(array('cacheTime' => 1, 'limitShow' => 20, 'limitPage' => $curPage));
System::setTitle('Usergroups list - ' . ADMINCP_TITLE);
View::make('admincp/head');
self::makeContents('usergroupsList', $post);
View::make('admincp/footer');
}
示例3: index
public function index()
{
Cache::loadPage('', 30);
$inputData = array();
$postid = 0;
$curPage = 0;
// Model::loadWithPath('home',System::getThemePath().'model/');
if ($match = Uri::match('page\\/(\\d+)')) {
$curPage = (int) $match[1];
}
$txtKeywords = addslashes(Request::get('txtKeywords', ''));
if ($match = Uri::match('\\/keyword\\/(.*?)\\/page')) {
$txtKeywords = base64_decode($match[1]);
}
$loadData = Post::get(array('limitShow' => 10, 'limitPage' => $curPage, 'cacheTime' => 30, 'where' => "where title LIKE '%{$txtKeywords}%'", 'orderby' => "order by postid desc"));
if (!isset($loadData[0]['postid'])) {
Redirect::to('404page');
}
$inputData['newPost'] = $loadData;
$inputData['keywords'] = $txtKeywords;
$inputData['listPage'] = Misc::genPage('search/keyword/' . base64_encode($txtKeywords), $curPage);
System::setTitle('Search result with keyword "' . $txtKeywords . '" results:');
self::makeContent('search', $inputData);
Cache::savePage();
}
示例4: listPage
function listPage()
{
$curPage = 0;
$keywords = '';
if ($matches = Uri::match('search\\/keyword\\/(.*?)\\/page\\/(\\d+)')) {
$curPage = $matches[2];
$keywords = $matches[1];
} else {
$keywords = base64_encode(Request::get('txtKeywords'));
}
$listPage = Misc::genPage('search/keyword/' . $keywords, $curPage);
$result = array('pages' => $listPage, 'keywords' => base64_decode($keywords));
return $result;
}
示例5: index
public function index()
{
$post = array('alert' => '');
Model::load('admincp/taxrate');
$curPage = 0;
if ($match = Uri::match('\\/page\\/(\\d+)')) {
$curPage = $match[1];
}
if (Request::has('btnAction')) {
actionProcess();
}
if (Request::has('btnAdd')) {
try {
insertProcess();
$post['alert'] = '<div class="alert alert-success">Add new category success.</div>';
} catch (Exception $e) {
$post['alert'] = '<div class="alert alert-warning">' . $e->getMessage() . '</div>';
}
}
if (Request::has('btnSave')) {
$match = Uri::match('\\/edit\\/(\\d+)');
try {
updateProcess($match[1]);
$post['alert'] = '<div class="alert alert-success">Update category success.</div>';
} catch (Exception $e) {
$post['alert'] = '<div class="alert alert-warning">' . $e->getMessage() . '</div>';
}
}
if (Request::has('btnSearch')) {
filterProcess();
} else {
$post['pages'] = Misc::genPage('admincp/taxrate', $curPage);
$post['theList'] = Taxrates::get(array('limitShow' => 20, 'limitPage' => $curPage, 'orderby' => 'order by taxid desc', 'cacheTime' => 1));
}
if ($match = Uri::match('\\/edit\\/(\\d+)')) {
$loadData = Taxrates::get(array('where' => "where taxid='" . $match[1] . "'"));
$post['edit'] = $loadData[0];
if (strlen($loadData[0]['country_short']) > 0) {
$post['edit']['countries'] = explode(',', $loadData[0]['country_short']);
}
// print_r($post['countries']);die();
}
$post['listCountries'] = Country::get();
System::setTitle('Taxrate list - ' . ADMINCP_TITLE);
View::make('admincp/head');
self::makeContents('taxrateList', $post);
View::make('admincp/footer');
}
示例6: listPage
function listPage()
{
$curPage = 0;
$id = 0;
$friendly_url = '';
if ($matches = Uri::match('category-(\\d+)-([a-zA-Z0-9_-]+)-page-(\\d+)')) {
$curPage = $matches[3];
$id = $matches[1];
$friendly_url = $matches[2];
} elseif ($matches = Uri::match('category-(\\d+)-([a-zA-Z0-9_-]+)')) {
$id = $matches[1];
$friendly_url = $matches[2];
}
$listPage = Misc::genPage('category-' . $id . '-' . $friendly_url, $curPage, 5, '-');
return $listPage;
}
示例7: index
public function index()
{
Cache::loadPage('', 30);
$inputData = array();
$curPage = 0;
Model::loadWithPath('home', System::getThemePath() . 'model/');
if ($match = Uri::match('page\\/(\\d+)')) {
$curPage = (int) $match[1];
}
$curPage = (int) $curPage >= 0 ? $curPage : 0;
$inputData['newPost'] = Post::get(array('limitShow' => 2, 'limitPage' => $curPage));
if (!isset($inputData['newPost'][0]['postid'])) {
Redirect::to('404page');
}
$inputData['listPage'] = Misc::genPage('', $curPage);
self::makeContent('home', $inputData);
Cache::savePage();
}
示例8: index
public function index()
{
// Cache::loadPage(30);
$inputData = array();
$postid = 0;
$curPage = 0;
// Model::loadWithPath('home',System::getThemePath().'model/');
if (!($match = Uri::match('category\\/(\\w+)$'))) {
Redirect::to('404page');
}
$friendly_url = addslashes($match[1]);
if ($match = Uri::match('page\\/(\\d+)')) {
$curPage = (int) $match[1];
}
$loadData = Post::get(array('limitShow' => 2, 'limitPage' => $curPage, 'cacheTime' => -1, 'query' => "select p.*,c.title as cattitle from post p,categories c where c.friendly_url='{$friendly_url}' AND p.catid=c.catid order by p.postid desc"));
if (!isset($loadData[0]['postid'])) {
Redirect::to('404page');
}
$inputData['newPost'] = $loadData;
$inputData['listPage'] = Misc::genPage('', $curPage);
System::setTitle(ucfirst($loadData[0]['cattitle']));
self::makeContent('category', $inputData);
// Cache::savePage();
}