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