add automaxpages

This commit is contained in:
Andrey Kuvshinov
2020-04-28 22:24:58 +03:00
parent c92457b901
commit 925ef570cf

View File

@@ -41,7 +41,8 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
}
$namefile = $hash.'.pdf';
$pgfile = PGDIR.$hash.'/'.$hash.'-'.$page.'.pdf';
$basepg = PGDIR.$hash.'/'.$hash.'-';
$pgfile = $basepg.$page.'.pdf';
$cachefile = PDFDIR.$namefile;
if (file_exists($cachefile)){
@@ -56,15 +57,6 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
$pdfile = '/pages/'.$hash.'/'.$hash.'-'.$page.'.pdf';
$pagenum = 1;
}
elseif (file_exists($cachefile)){
$pdfile = '/pdf/'.$namefile;
$pagenum = $page;
}
else {
$pdfile = $fullpdf;
$pagenum = $page;
}
if ($page > 1 or $promo){
$fullpdf = $pdfile;
@@ -78,7 +70,6 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
$id = $price['price_id'];
$maxpage = 24;
$title = $price['pricename'];
if ($promo){
@@ -90,9 +81,9 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
$baseurl = "/read/$hash/";
}
if ($page < $maxpage){
$nextpage = $page + 1;
$nexturl = "$baseurl$nextpage";
$nextpage = $page + 1;
if (file_exists($basepg.$nextpage.'.pdf')){
$nexturl = "$baseurl$nextpage";
}
if ($page > 1) {
@@ -103,7 +94,6 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
$tempcontent = VIEWPATH.'anpdf2.phtml'; //подшаблон
include VIEWPATH.'layout.phtml'; //центральный шаблон
}
function text_kuri(){