add correct prev и next pages
This commit is contained in:
@@ -313,15 +313,9 @@ function readtext_kuri($hash, $page = 1, $promo = 'no'){
|
|||||||
$endurl = "$baseurl$count";
|
$endurl = "$baseurl$count";
|
||||||
|
|
||||||
|
|
||||||
if ($count > $page){
|
|
||||||
$nextpage = $page + 1;
|
|
||||||
$nexturl = $baseurl.$nextpage;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($page > 1) {
|
|
||||||
$prevpage = $page - 1;
|
|
||||||
$prevurl = $baseurl.$prevpage;
|
|
||||||
}
|
|
||||||
|
|
||||||
$title = $price['pricename'];
|
$title = $price['pricename'];
|
||||||
$newcurr = strtotime($price['BeginDate']);
|
$newcurr = strtotime($price['BeginDate']);
|
||||||
@@ -330,23 +324,41 @@ function readtext_kuri($hash, $page = 1, $promo = 'no'){
|
|||||||
$content = apipage_kuri($price['price_id'], $page);
|
$content = apipage_kuri($price['price_id'], $page);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($page > 1) {
|
||||||
|
$prevpage = $page - 1;
|
||||||
|
|
||||||
|
for ($p = $prevpage; $p > 0; $p--) {
|
||||||
|
$prevcontent = apipage_kuri($price['price_id'], $p);
|
||||||
|
if (count($prevcontent) > 0){
|
||||||
|
$prevpage = $p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$prevurl = $baseurl.$prevpage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($count > $page){
|
if ($count > $page){
|
||||||
|
|
||||||
/** предварительно сл. полоса если не пустая */
|
/** предварительно сл. полоса если не пустая */
|
||||||
|
|
||||||
$nextpage = $page + 1;
|
$nextpage = $page + 1;
|
||||||
|
|
||||||
for ($p = $page + 1; $p <= $count; $p++) {
|
for ($p = $nextpage; $p <= $count; $p++) {
|
||||||
$content = apipage_kuri($price['price_id'], $p);
|
$nextcontent = apipage_kuri($price['price_id'], $p);
|
||||||
if (count($content) > 0){
|
if (count($nextcontent) > 0){
|
||||||
$nextpage = $p;
|
$nextpage = $p;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$nexturl = $baseurl.$nextpage;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$nexturl = $baseurl.$nextpage;
|
|
||||||
|
|
||||||
$tempcontent = VIEWPATH.'antext.phtml'; //подшаблон
|
$tempcontent = VIEWPATH.'antext.phtml'; //подшаблон
|
||||||
include VIEWPATH.'layout.phtml'; //центральный шаблон
|
include VIEWPATH.'layout.phtml'; //центральный шаблон
|
||||||
|
|||||||
Reference in New Issue
Block a user