本文整理汇总了PHP中get_current_page函数的典型用法代码示例。如果您正苦于以下问题:PHP get_current_page函数的具体用法?PHP get_current_page怎么用?PHP get_current_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_current_page函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _requestListGet
/**
* Метод, предназначенный для получения и вывода списка Запросов
*
* @param boolean $pagination признак формирования постраничного списка
*/
function _requestListGet($pagination = true)
{
global $AVE_DB, $AVE_Template;
$limit = '';
// Если используется постраничная навигация
if ($pagination) {
// Определяем лимит записей на страницу и начало диапазона выборки
$limit = $this->_limit;
$start = get_current_page() * $limit - $limit;
// Получаем общее количество запросов
$num = $AVE_DB->Query("SELECT COUNT(*) FROM " . PREFIX . "_request")->GetCell();
// Если количество больше, чем установленный лимит, тогда формируем постраничную навигацию
if ($num > $limit) {
$page_nav = " <a class=\"pnav\" href=\"index.php?do=request&page={s}&cp=" . SESSION . "\">{t}</a> ";
$page_nav = get_pagination(ceil($num / $limit), 'page', $page_nav);
$AVE_Template->assign('page_nav', $page_nav);
}
$limit = $pagination ? "LIMIT " . $start . "," . $limit : '';
}
// Выполняем запрос к БД на получение списка запросов с учетом лимита вывода на страницу (если необходимо)
$items = array();
$sql = $AVE_DB->Query("\r\n\t\t\tSELECT *\r\n\t\t\tFROM " . PREFIX . "_request\r\n\t\t\tORDER BY Id ASC\r\n\t\t\t" . $limit . "\r\n\t\t");
// Формируем массив из полученных данных
while ($row = $sql->FetchRow()) {
$row->request_author = get_username_by_id($row->request_author_id);
array_push($items, $row);
}
// Возвращаем массив
return $items;
}
开发者ID:laiello,项目名称:avecms,代码行数:35,代码来源:class.request.php
示例2: index
/**
* 返回国家列表
* @access public
*/
function index()
{
$country = get_post_value('country');
$region = get_post_value('region');
$province = get_post_value('province');
$city = get_post_value('city');
$field = array('country.country_id', 'country.country', 'region.region_id', 'region.region', 'province.province_id', 'province.province', 'city.city_id', 'city.city', 'city.status', 'city.orders');
// 排序方法2
$orderby = array('country.orders', 'region.orders', 'province.orders');
$m = new Address();
$m->clear();
$m->setField($field);
$m->setWhere('country.status', '!=', '50000');
$m->setWhere('region.status', '!=', '50000');
$m->setWhere('province.status', '!=', '50000');
$m->setWhere('city.status', '!=', '50000');
if ($country != '') {
$m->setWhere('country.country_id', '=', $country);
}
if ($region != '') {
$m->setWhere('region.region_id', '=', $region);
}
if ($province != '') {
$m->setWhere('province.province_id', '=', $province);
}
if ($city != '') {
$m->setWhere('city.city', 'LIKE', '%' . $city . '%');
}
$m->setTable('vcb_address_country AS country');
$m->setJoin('vcb_address_region as region', 'country.country_id=region.country_id');
$m->setJoin('vcb_address_province as province', 'region.region_id=province.region_id');
$m->setJoin('vcb_address_city as city', 'province.province_id=city.province_id');
$m->setOrderBy($orderby);
$count = $m->getRowsCount();
//合计计录数
//分页其他参数
$page = new Page($count);
$parameter = array('country' => get_post_value('country'));
$page->setParameter($parameter);
$showPage = $page->showPage();
$showTotal = $page->showTotal();
$m->setPage(get_current_page());
$data = $m->select();
//状态标题
$count = count($data);
for ($i = 0; $i < $count; $i++) {
$status = $data[$i]['status'];
$data[$i]['status_name'] = $m->getStatus($status);
}
$this->assign('data', $data);
//输出数据
$this->assign('showPage', $showPage);
//输出分页
$this->assign('showTotal', $showTotal);
//输出分页合计
$r = $m->getRegion($country);
$this->assign('region', $r);
$p = $m->getProvince($region);
$this->assign('province', $p);
}
开发者ID:koery,项目名称:Vcanbuy,代码行数:64,代码来源:CityController.class.php
示例3: render_ui
function render_ui($ui_page, $title = null)
{
$page =& get_current_page();
$renderer =& get_renderer();
$layout_page = load_layout_page($ui_page);
if ($layout_page !== null) {
if (empty($title)) {
$title = $page->title;
}
if (empty($title)) {
$title = $page->name;
}
$vars = new_global_wiki_variables();
$vars->set('title', $title);
$info_text = get_info_text();
if (count($info_text) > 0) {
$vars->set('info_text', implode(' ', $info_text));
}
$redirected_page =& get_redirected_page();
if ($redirected_page !== null) {
$vars->set('redir_page', $redirected_page->name);
}
$layout_page->render($vars);
}
}
开发者ID:SnowyYANG,项目名称:miniwiki,代码行数:25,代码来源:ui.php
示例4: do_pages
function do_pages($total, $page_size = 15)
{
global $db;
if ($total < $page_size) {
return;
}
$query = preg_replace('/page=[0-9]+/', '', $_SERVER['QUERY_STRING']);
$query = preg_replace('/^&*(.*)&*$/', "\$1", $query);
if (!empty($query)) {
$query = htmlspecialchars($query);
$query = "&{$query}";
}
$current = get_current_page();
$total_pages = ceil($total / $page_size);
echo '<div class="pages">';
if ($current == 1) {
echo '<span class="nextprev">«</span>';
} else {
$i = $current - 1;
echo '<a href="?page=' . $i . $query . '">«</a>';
}
echo '<span class="current">' . $current . '</span>';
if ($current < $total_pages) {
$i = $current + 1;
echo '<a href="?page=' . $i . $query . '">»</a>';
} else {
echo '<span class="nextprev">»</span>';
}
echo "</div>\n";
}
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:30,代码来源:html1-mobile.php
示例5: group_read
function group_read($from_where, $order_by)
{
global $db, $main_smarty, $view, $user, $rows, $page_size, $offset;
// figure out what "page" of the results we're on
$offset = (get_current_page() - 1) * $page_size;
// pagesize set in the admin panel
$search->pagesize = $page_size;
if ($order_by == "") {
$order_by = "group_date DESC";
}
include_once mnminclude . 'smartyvariables.php';
global $db, $main_smarty;
$rows = $db->get_var("SELECT count(*) FROM " . table_groups . " WHERE " . $from_where . " ");
$group = $db->get_results("SELECT distinct(group_id) as group_id FROM " . table_groups . " WHERE " . $from_where . " ORDER BY group_status DESC, " . $order_by . " LIMIT {$offset},{$page_size} ");
if ($group) {
foreach ($group as $groupid) {
$group_display .= group_print_summary($groupid->group_id);
}
$main_smarty->assign('group_display', $group_display);
}
if (Auto_scroll == 2 || Auto_scroll == 3) {
$main_smarty->assign("scrollpageSize", $page_size);
} else {
$main_smarty->assign('group_pagination', do_pages($rows, $page_size, "groups", true));
}
return true;
}
开发者ID:bklein01,项目名称:pligg-cms,代码行数:27,代码来源:groups.php
示例6: __construct
/**
* 架构函数
* @param array $totalRows 总的记录数
* @param array $listRows 每页显示记录数
* @param array $parameter 分页跳转的参数
*/
public function __construct($totalRows, $listRows = null, $parameter = array()) {
/* 基础设置 */
$this->_url = CURRENT_URL ;
$this->totalRows = $totalRows; //设置总记录数
$this->listRows = !isset($listRows) ? DEFAULT_LIMIT : $listRows; // 设置每页显示行数
$this->parameter = empty ( $parameter ) ? '' : $parameter;
$this->_currentPage = get_current_page();
$this->_currentPage = $this->_currentPage >0 ? $this->_currentPage :1;
}
开发者ID:koery,项目名称:Vcanbuy,代码行数:16,代码来源:Page20141125修改showTotal和showPage之前.class.php
示例7: include_template_part
/**
* @param string $include
* @param string $page (optional)
*/
function include_template_part($include, $page = "")
{
global $pwt;
if (!file_exists(dirname(__FILE__) . "/tpl/{$include}.php")) {
trigger_error("Template {$include}.php not found.", E_USER_WARNING);
return;
}
$page = $page === "" ? get_current_page() : explode("/", $page);
$home = get_relative_home_path($page);
include dirname(__FILE__) . "/tpl/{$include}.php";
}
开发者ID:g737a6b,项目名称:php_website_template,代码行数:15,代码来源:functions.php
示例8: doPages
function doPages($page_size, $thepage, $query_string, $total = 0)
{
//per page count
$index_limit = 5;
//set the query string to blank, then later attach it with $query_string
$query = '';
if (strlen($query_string) > 0) {
$query = "&" . $query_string;
}
//get the current page number example: 3, 4 etc: see above method description
$current = get_current_page();
$total_pages = ceil($total / $page_size);
$start = max($current - intval($index_limit / 2), 1);
$end = $start + $index_limit - 1;
$pagging = '<div class="paging">';
if ($current == 1) {
$pagging .= '<span class="prn">< Previous</span> ';
} else {
$i = $current - 1;
$pagging .= '<a class="prn" title="go to page ' . $i . '" rel="nofollow" href="' . $thepage . '?page=' . $i . $query . '">< Previous</a> ';
$pagging .= '<span class="prn">...</span> ';
}
if ($start > 1) {
$i = 1;
$pagging .= '<a title="go to page ' . $i . '" href="' . $thepage . '?page=' . $i . $query . '">' . $i . '</a> ';
}
for ($i = $start; $i <= $end && $i <= $total_pages; $i++) {
if ($i == $current) {
$pagging .= '<span>' . $i . '</span> ';
} else {
$pagging .= '<a title="go to page ' . $i . '" href="' . $thepage . '?page=' . $i . $query . '">' . $i . '</a> ';
}
}
if ($total_pages > $end) {
$i = $total_pages;
$pagging .= '<a title="go to page ' . $i . '" href="' . $thepage . '?page=' . $i . $query . '">' . $i . '</a> ';
}
if ($current < $total_pages) {
$i = $current + 1;
$pagging .= '<span class="prn">...</span> ';
$pagging .= '<a class="prn" title="go to page ' . $i . '" rel="nofollow" href="' . $thepage . '?page=' . $i . $query . '">Next ></a> ';
} else {
$pagging .= '<span class="prn">Next ></span> ';
}
//if nothing passed to method or zero, then dont print result, else print the total count below:
if ($total != 0) {
//prints the total result count just below the paging
$pagging .= '(' . $total . ' Records)';
}
$pagging .= '</div>';
return $pagging;
}
开发者ID:GayathriDendukuri,项目名称:etrdemo,代码行数:52,代码来源:function_common.php
示例9: doPages
function doPages($page_size, $thepage, $query_string, $total = 0)
{
//per page count
$index_limit = 10;
//set the query string to blank, then later attach it with $query_string
$query = '';
if (strlen($query_string) > 0) {
$query = "&" . $query_string;
}
//get the current page number example: 3, 4 etc: see above method description
$current = get_current_page();
$total_pages = ceil($total / $page_size);
$start = max($current - intval($index_limit / 2), 1);
$end = $start + $index_limit - 1;
echo '<br /><br /><div class="paging">';
if ($current == 1) {
echo '<span class="prn">< Previous</span> ';
} else {
$i = $current - 1;
echo '<a href="' . $thepage . '?page=' . $i . $query . '" class="prn" rel="nofollow" title="go to page ' . $i . '">< Previous</a> ';
echo '<span class="prn">...</span> ';
}
if ($start > 1) {
$i = 1;
echo '<a href="' . $thepage . '?page=' . $i . $query . '" title="go to page ' . $i . '">' . $i . '</a> ';
}
for ($i = $start; $i <= $end && $i <= $total_pages; $i++) {
if ($i == $current) {
echo '<span>' . $i . '</span> ';
} else {
echo '<a href="' . $thepage . '?page=' . $i . $query . '" title="go to page ' . $i . '">' . $i . '</a> ';
}
}
if ($total_pages > $end) {
$i = $total_pages;
echo '<a href="' . $thepage . '?page=' . $i . $query . '" title="go to page ' . $i . '">' . $i . '</a> ';
}
if ($current < $total_pages) {
$i = $current + 1;
echo '<span class="prn">...</span> ';
echo '<a href="' . $thepage . '?page=' . $i . $query . '" class="prn" rel="nofollow" title="go to page ' . $i . '">Next ></a> ';
} else {
echo '<span class="prn">Next ></span> ';
}
//if nothing passed to method or zero, then dont print result, else print the total count below:
if ($total != 0) {
//prints the total result count just below the paging
echo '<p id="total_count">(total ' . $total_pages . ' page)</p></div>';
}
}
开发者ID:smilingrey,项目名称:ALIA,代码行数:50,代码来源:paging.php
示例10: get_user_posts
function get_user_posts($user_id = 0)
{
global $conn;
$post_per_page = get_posts_per_page();
$current_page = get_current_page();
$offset = ($current_page - 1) * $post_per_page;
$posts_query = "SELECT *\n\t\tFROM posts\n\t\tWHERE user_id={$user_id}\n\t\tORDER BY publish_date DESC\n\t\tLIMIT {$offset}, {$post_per_page}";
$posts_query = mysqli_query($conn, $posts_query);
$all_posts = array();
// $counter = 0;
while ($post = mysqli_fetch_assoc($posts_query)) {
// $all_posts[$counter++] = $post;
$all_posts[] = $post;
}
return $all_posts;
}
开发者ID:saqibamin,项目名称:icl,代码行数:16,代码来源:functions.php
示例11: document_pagination
/**
* Постраничная навигация документа
*
* @param string $text текст многострочной части документа
* @return string
*/
function document_pagination($text)
{
global $AVE_Core;
// IE8 <div style="page-break-after: always"><span style="display: none"> </span></div>
// Chrome <div style="page-break-after: always; "><span style="DISPLAY:none"> </span></div>
// FF <div style="page-break-after: always;"><span style="display: none;"> </span></div>
$pages = preg_split('#<div style="page-break-after:[; ]*always[; ]*"><span style="display:[ ]*none[;]*"> </span></div>#i', $text);
$total_page = @sizeof($pages);
if ($total_page > 1) {
$text = @$pages[get_current_page('artpage') - 1];
$page_nav = ' <a class="pnav" href="index.php?id=' . $AVE_Core->curentdoc->Id . '&doc=' . (empty($AVE_Core->curentdoc->document_alias) ? prepare_url($AVE_Core->curentdoc->document_title) : $AVE_Core->curentdoc->document_alias) . '&artpage={s}' . '">{t}</a> ';
$page_nav = get_pagination($total_page, 'artpage', $page_nav, get_settings('navi_box'));
$text .= rewrite_link($page_nav);
}
return $text;
}
开发者ID:laiello,项目名称:avecms,代码行数:22,代码来源:func.parsefields.php
示例12: rubricList
/**
* Вывод списка рубрик
*
*/
function rubricList()
{
global $AVE_DB, $AVE_Template;
$rubrics = array();
$num = $AVE_DB->Query("SELECT COUNT(*) FROM " . PREFIX . "_rubrics")->GetCell();
$page_limit = $this->_limit;
$seiten = ceil($num / $page_limit);
$set_start = get_current_page() * $page_limit - $page_limit;
if ($num > $page_limit) {
$page_nav = " <a class=\"pnav\" href=\"index.php?do=rubs&page={s}&cp=" . SESSION . "\">{t}</a> ";
$page_nav = get_pagination($seiten, 'page', $page_nav);
$AVE_Template->assign('page_nav', $page_nav);
}
$sql = $AVE_DB->Query("\r\n\t\t\tSELECT\r\n\t\t\t\trub.*,\r\n\t\t\t\tCOUNT(doc.Id) AS doc_count\r\n\t\t\tFROM\r\n\t\t\t\t" . PREFIX . "_rubrics AS rub\r\n\t\t\tLEFT JOIN\r\n\t\t\t\t" . PREFIX . "_documents AS doc\r\n\t\t\t\t\tON rubric_id = rub.Id\r\n\t\t\tGROUP BY rub.Id\r\n\t\t\tLIMIT " . $set_start . "," . $page_limit);
while ($row = $sql->FetchRow()) {
array_push($rubrics, $row);
}
$AVE_Template->assign('rubrics', $rubrics);
}
开发者ID:laiello,项目名称:avecms,代码行数:23,代码来源:class.rubs.php
示例13: roadmapTaskList
/**
* Административная часть (задачи)
*/
function roadmapTaskList($tpl_dir, $project_id, $status)
{
global $AVE_DB, $AVE_Template;
$project_id = (int) $project_id;
$status = (int) $status;
$limit = $this->_limit;
$num = $AVE_DB->Query("\r\n\t\t\tSELECT COUNT(*)\r\n\t\t\tFROM " . PREFIX . "_modul_roadmap_tasks\r\n\t\t\tWHERE pid = '" . $project_id . "'\r\n\t\t\tAND task_status = '" . $status . "'\r\n\t\t")->GetCell();
$pages = ceil($num / $limit);
$start = get_current_page() * $limit - $limit;
$items = array();
$sql = $AVE_DB->Query("\r\n\t\t\tSELECT *\r\n\t\t\tFROM " . PREFIX . "_modul_roadmap_tasks\r\n\t\t\tWHERE pid = '" . $project_id . "'\r\n\t\t\tAND task_status = '" . $status . "'\r\n\t\t\tORDER BY priority\r\n\t\t\tLIMIT " . $start . "," . $limit);
while ($row = $sql->FetchRow()) {
$row->username = get_username_by_id($row->uid);
switch ($row->priority) {
case '1':
$row->priority = $AVE_Template->get_config_vars('ROADMAP_TASK_HIGHEST');
break;
case '2':
$row->priority = $AVE_Template->get_config_vars('ROADMAP_TASK_HIGH');
break;
case '3':
$row->priority = $AVE_Template->get_config_vars('ROADMAP_TASK_NORMAL');
break;
case '4':
$row->priority = $AVE_Template->get_config_vars('ROADMAP_TASK_LOW');
break;
case '5':
$row->priority = $AVE_Template->get_config_vars('ROADMAP_TASK_LOWEST');
break;
}
array_push($items, $row);
}
if ($num > $limit) {
$page_nav = " <a class=\"pnav\" href=\"index.php?do=modules&action=modedit&mod=roadmap&moduleaction=show_tasks&closed=" . $status . "&id=" . $project_id . "&cp=" . SESSION . "&page={s}\">{t}</a> ";
$page_nav = get_pagination($pages, 'page', $page_nav);
$AVE_Template->assign('page_nav', $page_nav);
}
$AVE_Template->assign('items', $items);
$AVE_Template->assign('content', $AVE_Template->fetch($tpl_dir . 'admin_tasks.tpl'));
}
开发者ID:laiello,项目名称:avecms,代码行数:43,代码来源:class.roadmap.php
示例14: get_page_nav
function get_page_nav()
{
global $smarty_q, $config_q;
$current_page = get_current_page();
$quotes_count = $smarty_q->get_template_vars("quotes_count");
$max_pages = floor($quotes_count / $config_q["quotes_on_page"]);
$start = $current_page - 10;
$end = $current_page + 10;
$pages = array();
$k = 1;
for ($i = $start; $i < $end; $i++) {
if ($i > 0 && $i <= $max_pages) {
$pages[$k] = array("caption" => $i, "index" => $k);
if ($i == $current_page) {
$pages[$k]["selected"] = true;
} else {
$pages[$k]["selected"] = false;
}
$k++;
}
}
return $pages;
}
开发者ID:hkirsman,项目名称:tsitaat_com,代码行数:23,代码来源:defs.php
示例15: sanitize
}
if (isset($_REQUEST['search'])) {
$search->filterToStatus = "all";
}
if (!isset($_REQUEST['search'])) {
$search->orderBy = "link_published_date DESC, link_date DESC";
}
if (isset($_REQUEST['tag'])) {
$search->searchTerm = sanitize($_REQUEST['search'], 3);
$search->isTag = true;
}
if (isset($thecat)) {
$search->category = $catID;
}
// figure out what "page" of the results we're on
$search->offset = (get_current_page() - 1) * $page_size;
// pagesize set in the admin panel
$search->pagesize = $page_size;
// since this is index, we only want to view "published" stories
$search->filterToStatus = "published";
// this is for the tabs on the top that filter
if (isset($_GET['part'])) {
$search->setmek = $db->escape($_GET['part']);
}
$search->do_setmek();
// do the search
$search->doSearch();
$linksum_count = $search->countsql;
$linksum_sql = $search->sql;
if (isset($_REQUEST['category'])) {
$category_data = get_cached_category_data('category_safe_name', sanitize($_REQUEST['category'], 1));
开发者ID:bendroid,项目名称:pligg-cms,代码行数:31,代码来源:index.php
示例16: get_pagination
/**
* Постраничная навигация для запросов и модулей
*
* @param int $total_pages количество страниц в документе
* @param string $type тип постраничной навигации,
* допустимые значения: page, apage, artpage
* @param string $template_label шаблон метки навигации
* @param string $navi_box контейнер постраничной навигации
* @return string HTML-код постраничной навигации
*/
function get_pagination($total_pages, $type, $template_label, $navi_box = '')
{
$nav = '';
if (!in_array($type, array('page', 'apage', 'artpage'))) {
$type = 'page';
}
$curent_page = get_current_page($type);
if ($curent_page == 1) {
$seiten = array($curent_page, $curent_page + 1, $curent_page + 2, $curent_page + 3, $curent_page + 4);
} elseif ($curent_page == 2) {
$seiten = array($curent_page - 1, $curent_page, $curent_page + 1, $curent_page + 2, $curent_page + 3);
} elseif ($curent_page + 1 == $total_pages) {
$seiten = array($curent_page - 3, $curent_page - 2, $curent_page - 1, $curent_page, $curent_page + 1);
} elseif ($curent_page == $total_pages) {
$seiten = array($curent_page - 4, $curent_page - 3, $curent_page - 2, $curent_page - 1, $curent_page);
} else {
$seiten = array($curent_page - 2, $curent_page - 1, $curent_page, $curent_page + 1, $curent_page + 2);
}
$seiten = array_unique($seiten);
$total_label = trim(get_settings('total_label'));
$start_label = trim(get_settings('start_label'));
$end_label = trim(get_settings('end_label'));
$separator_label = trim(get_settings('separator_label'));
$next_label = trim(get_settings('next_label'));
$prev_label = trim(get_settings('prev_label'));
if ($total_pages > 5 && $curent_page > 3) {
//Первая
$nav .= '<li>' . str_replace('{t}', $start_label, str_replace(array('&' . $type . '={s}', '&' . $type . '={s}', '/' . $type . '-{s}'), '', $template_label)) . '</li>';
if ($separator_label != '') {
$nav .= '<li>' . $separator_label . '</li>';
}
}
if ($curent_page > 1) {
if ($curent_page == 2) {
//$nav .= str_replace('{t}', $prev_label, str_replace(array('&'.$type.'={s}','&'.$type.'={s}'), '', $template_label));
//ХЗ
$nav .= '<li>' . str_replace('{t}', $prev_label, str_replace(array('&' . $type . '={s}', '&' . $type . '={s}', '/' . $type . '-{s}'), '', $template_label)) . '</li>';
} else {
//$nav .= str_replace('{t}', $prev_label, str_replace('{s}', ($curent_page - 1), $template_label));
//Предыдущая
$nav .= '<li>' . str_replace('{t}', $prev_label, str_replace('{s}', $curent_page - 1, $template_label)) . '</li>';
}
}
// while (list(,$val) = each($seiten))
foreach ($seiten as $val) {
if ($val >= 1 && $val <= $total_pages) {
if ($curent_page == $val) {
//Текущая
$nav .= str_replace(array('{s}', '{t}'), $val, '<li class="active"><a class="active">' . $curent_page . '</a></li>');
} else {
if ($val == 1) {
$nav .= '<li>' . str_replace('{t}', $val, str_replace(array('&' . $type . '={s}', '&' . $type . '={s}', '/' . $type . '-{s}'), '', $template_label)) . '</li>';
} else {
//Остальные неактивные
$nav .= '<li>' . str_replace(array('{s}', '{t}'), $val, $template_label) . '</li>';
}
}
}
}
if ($curent_page < $total_pages) {
//$nav .= str_replace('{t}', $next_label, str_replace('{s}', ($curent_page + 1), $template_label));
//Сдедующая
$nav .= '<li>' . str_replace('{t}', $next_label, str_replace('{s}', $curent_page + 1, $template_label)) . '</li>';
}
if ($total_pages > 5 && $curent_page < $total_pages - 2) {
if ($separator_label != '') {
$nav .= '<li>' . $separator_label . '</li>';
}
//Последняя
$nav .= '<li>' . str_replace('{t}', $end_label, str_replace('{s}', $total_pages, $template_label)) . '</li>';
}
if ($nav != '') {
//Страница ХХХ из ХХХ
if ($total_label != '') {
$nav = '<span class="pages">' . sprintf($total_label, $curent_page, $total_pages) . '</span> ' . $nav;
}
if ($navi_box != '') {
$nav = sprintf($navi_box, $nav);
}
}
return $nav;
}
开发者ID:RGBvision,项目名称:AVE.cms,代码行数:92,代码来源:func.pagination.php
示例17: do_pages
function do_pages($total, $page_size = 25, $margin = true)
{
global $db, $globals;
if ($total > 0 && $total < $page_size) {
return;
}
// MDOMENECH
if (1 || !$globals['mobile']) {
$index_limit = 5;
$go_prev = _('previous');
$go_next = _('next');
} else {
$index_limit = 1;
$go_prev = '';
$go_next = '';
}
$separator = '…';
$query = preg_replace('/page=[0-9]+/', '', $_SERVER['QUERY_STRING']);
$query = preg_replace('/^&*(.*)&*$/', "\$1", $query);
if (!empty($query)) {
$query = htmlspecialchars($query);
$query = "&{$query}";
}
$current = get_current_page();
$total_pages = ceil($total / $page_size);
$start = max($current - intval($index_limit / 2), 1);
$end = $start + $index_limit - 1;
if ($margin) {
echo '<div class="pages margin">';
} else {
echo '<div class="pages">';
}
// MDOMENECH
echo '<ul class="pagination">';
if ($current == 1) {
echo '<li><span class="nextprev">' . $go_prev . '</span></li>';
} else {
$i = $current - 1;
if ($i > 10) {
$nofollow = ' rel="nofollow"';
} else {
$nofollow = '';
}
echo '<li><a href="?page=' . $i . $query . '"' . $nofollow . ' rel="prev">' . $go_prev . '</a></li>';
}
if ($total_pages > 0) {
if ($start > 1) {
$i = 1;
echo '<li><a href="?page=' . $i . $query . '" title="' . _('ir a página') . " {$i}" . '">' . $i . '</a></li>';
}
for ($i = $start; $i <= $end && $i <= $total_pages; $i++) {
if ($i == $current) {
echo '<li><span class="current">' . $i . '</span></li>';
} else {
if ($i > 10) {
$nofollow = ' rel="nofollow"';
} else {
$nofollow = '';
}
echo '<li><a href="?page=' . $i . $query . '" title="' . _('ir a página') . " {$i}" . '"' . $nofollow . '>' . $i . '</a></li>';
}
}
if ($total_pages > $end) {
$i = $total_pages;
if ($i > 10) {
$nofollow = ' rel="nofollow"';
} else {
$nofollow = '';
}
echo '<li><a href="?page=' . $i . $query . '" title="' . _('ir a página') . " {$i}" . '"' . $nofollow . '>' . $i . '</a></li>';
}
} else {
if ($current > 2) {
echo '<li><a href="?page=1' . $query . '" title="' . _('ir a página') . " 1" . '">1</a></li>';
}
echo '<li><span class="current">' . $current . '</span></li>';
}
if ($total < 0 || $current < $total_pages) {
$i = $current + 1;
if ($i > 10) {
$nofollow = ' rel="nofollow"';
} else {
$nofollow = '';
}
echo '<li><a href="?page=' . $i . $query . '"' . $nofollow . ' rel="next">' . $go_next . '</a></li>';
} else {
echo '<li><span class="nextprev">' . $go_next . '</span></li>';
}
echo '</ul><!-- pagination -->';
echo '</div>';
}
开发者ID:manelio,项目名称:woolr,代码行数:91,代码来源:html1.php
示例18: get_current_page
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<?php
$page = get_current_page();
if (!isset($sub_title)) {
$sub_title = isset($page['title']) ? $page['title'] : lang_key('list_your_ad');
}
$seo = isset($page['seo_settings']) && $page['seo_settings'] != '' ? (array) json_decode($page['seo_settings']) : array();
if (!isset($meta_desc)) {
$meta_desc = isset($seo['meta_description']) ? $seo['meta_description'] : get_settings('site_settings', 'meta_description', 'autocon car dealership');
}
if (!isset($key_words)) {
$key_words = isset($seo['key_words']) ? $seo['key_words'] : get_settings('site_settings', 'key_words', 'car dealership,car listing, house, car');
}
if (!isset($crawl_after)) {
$crawl_after = isset($seo['crawl_after']) ? $seo['crawl_after'] : get_settings('site_settings', 'crawl_after', 3);
}
?>
<?php
if (isset($post)) {
echo isset($post) ? social_sharing_meta_tags_for_post($post) : '';
} elseif (isset($blog_meta)) {
开发者ID:Ripudamangithub,项目名称:donopen,代码行数:31,代码来源:template_view.php
示例19: request_parse
/**
* Обработка тега запроса.
* Возвращает список документов удовлетворяющих параметрам запроса
* оформленный с использованием шаблона
*
* @param int $id идентификатор запроса
* @return string
*/
function request_parse($id)
{
global $AVE_Core, $AVE_DB, $request_documents;
$return = '';
if (is_array($id)) {
$id = $id[1];
}
$row_ab = $AVE_DB->Query("\r\n\t\tSELECT *\r\n\t\tFROM " . PREFIX . "_request\r\n\t\tWHERE Id = '" . $id . "'\r\n\t")->FetchRow();
if (is_object($row_ab)) {
$ttl = (int) $row_ab->request_cache_lifetime;
$limit = $row_ab->request_items_per_page < 1 ? 1 : $row_ab->request_items_per_page;
$main_template = $row_ab->request_template_main;
$item_template = $row_ab->request_template_item;
$request_order_by = $row_ab->request_order_by;
$request_asc_desc = $row_ab->request_asc_desc;
$request_order = $request_order_by . " " . $request_asc_desc;
$request_order_fields = '';
$request_order_tables = '';
if ($row_ab->request_order_by_nat) {
$request_order_tables = "LEFT JOIN " . PREFIX . "_document_fields AS s" . $row_ab->request_order_by_nat . "\r\n\t\t\t ON (s" . $row_ab->request_order_by_nat . ".document_id = a.Id and s" . $row_ab->request_order_by_nat . ".rubric_field_id=" . $row_ab->request_order_by_nat . ")";
$request_order_fields = "s" . $row_ab->request_order_by_nat . ".field_value, ";
$request_order = "s" . $row_ab->request_order_by_nat . ".field_value " . $row_ab->request_asc_desc;
}
$doctime = get_settings('use_doctime') ? "AND a.document_published <= UNIX_TIMESTAMP() AND\r\n \t\t \t(a.document_expire = 0 OR a.document_expire >=UNIX_TIMESTAMP())" : '';
$where_cond = empty($_POST['req_' . $id]) && empty($_SESSION['doc_' . $AVE_Core->curentdoc->Id]['req_' . $id]) ? unserialize($row_ab->request_where_cond) : unserialize(request_get_condition_sql_string($row_ab->Id));
$where_cond['from'] = str_replace('%%PREFIX%%', PREFIX, $where_cond['from']);
$where_cond['where'] = str_replace('%%PREFIX%%', PREFIX, $where_cond['where']);
if ($row_ab->request_show_pagination == 1) {
if (!empty($AVE_Core->install_modules['comment']->Status)) {
$num = $AVE_DB->Query(eval2var(" ?> \r\n\t\t\t\t\tSELECT COUNT(*)\r\n\t\t\t\t\tFROM \r\n\t\t\t\t\t" . ($where_cond['from'] ? $where_cond['from'] : '') . "\r\n\t\t\t\t\t" . PREFIX . "_documents AS a\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\ta.Id != '1'\r\n\t\t\t\t\tAND a.Id != '" . PAGE_NOT_FOUND_ID . "'\r\n\t\t\t\t\tAND a.Id != '" . get_current_document_id() . "'\r\n\t\t\t\t\tAND a.rubric_id = '" . $row_ab->rubric_id . "'\r\n\t\t\t\t\tAND a.document_deleted != '1'\r\n\t\t\t\t\tAND a.document_status != '0'\r\n\t\t\t\t\t" . $where_cond['where'] . "\r\n\t\t\t\t\t" . $doctime . "\r\n\t\t\t\t<?php "), $ttl, 'rub_' . $row_ab->rubric_id)->GetCell();
} else {
$num = $AVE_DB->Query(eval2var(" ?>\r\n\t\t\t\t\tSELECT COUNT(*)\r\n\t\t\t\t\tFROM \r\n\t\t\t\t\t" . ($where_cond['from'] ? $where_cond['from'] : '') . "\r\n\t\t\t\t\t" . PREFIX . "_documents AS a\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\ta.Id != '1'\r\n\t\t\t\t\tAND a.Id != '" . PAGE_NOT_FOUND_ID . "'\r\n\t\t\t\t\tAND a.Id != '" . get_current_document_id() . "'\r\n\t\t\t\t\tAND a.rubric_id = '" . $row_ab->rubric_id . "'\r\n\t\t\t\t\tAND a.document_deleted != '1'\r\n\t\t\t\t\tAND a.document_status != '0'\r\n\t\t\t\t\t" . $where_cond['where'] . "\r\n\t\t\t\t\t" . $doctime . "\r\n\t\t\t\t<?php "), $ttl, 'rub_' . $row_ab->rubric_id)->GetCell();
}
$seiten = ceil($num / $limit);
if (isset($_REQUEST['apage']) && is_numeric($_REQUEST['apage']) && $_REQUEST['apage'] > $seiten) {
$redirect_link = rewrite_link('index.php?id=' . $AVE_Core->curentdoc->Id . '&doc=' . (empty($AVE_Core->curentdoc->document_alias) ? prepare_url($AVE_Core->curentdoc->document_title) : $AVE_Core->curentdoc->document_alias) . (isset($_REQUEST['artpage']) && is_numeric($_REQUEST['artpage']) ? '&artpage=' . $_REQUEST['artpage'] : '') . (isset($_REQUEST['page']) && is_numeric($_REQUEST['page']) ? '&page=' . $_REQUEST['page'] : ''));
header('Location:' . $redirect_link);
exit;
}
$start = get_current_page('apage') * $limit - $limit;
} else {
$start = 0;
}
if ($row_ab->request_items_per_page != 0) {
$filter_limit = "LIMIT " . $start . "," . $limit;
}
if (!empty($AVE_Core->install_modules['comment']->Status)) {
$q = " ?>\r\n\t\t\t\tSELECT\r\n\t\t\t\t\t" . $request_order_fields . "\r\n\t\t\t\t\ta.Id,\r\n\t\t\t\t\ta.document_title,\r\n\t\t\t\t\ta.document_alias,\r\n\t\t\t\t\ta.document_author_id,\r\n\t\t\t\t\ta.document_count_view,\r\n\t\t\t\t\ta.document_published,\r\n\t\t\t\t\tCOUNT(b.document_id) AS nums\r\n\t\t\t\tFROM\r\n\t\t\t\t\t" . ($where_cond['from'] ? $where_cond['from'] : '') . "\r\n\t\t\t\t\t" . PREFIX . "_documents AS a\r\n\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t" . PREFIX . "_modul_comment_info AS b\r\n\t\t\t\t\t\tON b.document_id = a.Id\r\n\t\t\t\t " . ($request_order_tables > '' ? $request_order_tables : '') . "\t\r\n\t\t\t\tWHE
|
请发表评论