add automaxpages
This commit is contained in:
@@ -41,7 +41,8 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$namefile = $hash.'.pdf';
|
$namefile = $hash.'.pdf';
|
||||||
$pgfile = PGDIR.$hash.'/'.$hash.'-'.$page.'.pdf';
|
$basepg = PGDIR.$hash.'/'.$hash.'-';
|
||||||
|
$pgfile = $basepg.$page.'.pdf';
|
||||||
$cachefile = PDFDIR.$namefile;
|
$cachefile = PDFDIR.$namefile;
|
||||||
|
|
||||||
if (file_exists($cachefile)){
|
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';
|
$pdfile = '/pages/'.$hash.'/'.$hash.'-'.$page.'.pdf';
|
||||||
$pagenum = 1;
|
$pagenum = 1;
|
||||||
}
|
}
|
||||||
elseif (file_exists($cachefile)){
|
|
||||||
$pdfile = '/pdf/'.$namefile;
|
|
||||||
$pagenum = $page;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$pdfile = $fullpdf;
|
|
||||||
$pagenum = $page;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($page > 1 or $promo){
|
if ($page > 1 or $promo){
|
||||||
$fullpdf = $pdfile;
|
$fullpdf = $pdfile;
|
||||||
@@ -78,7 +70,6 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
|
|||||||
|
|
||||||
|
|
||||||
$id = $price['price_id'];
|
$id = $price['price_id'];
|
||||||
$maxpage = 24;
|
|
||||||
$title = $price['pricename'];
|
$title = $price['pricename'];
|
||||||
|
|
||||||
if ($promo){
|
if ($promo){
|
||||||
@@ -90,8 +81,8 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
|
|||||||
$baseurl = "/read/$hash/";
|
$baseurl = "/read/$hash/";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($page < $maxpage){
|
|
||||||
$nextpage = $page + 1;
|
$nextpage = $page + 1;
|
||||||
|
if (file_exists($basepg.$nextpage.'.pdf')){
|
||||||
$nexturl = "$baseurl$nextpage";
|
$nexturl = "$baseurl$nextpage";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +94,6 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
|
|||||||
$tempcontent = VIEWPATH.'anpdf2.phtml'; //подшаблон
|
$tempcontent = VIEWPATH.'anpdf2.phtml'; //подшаблон
|
||||||
include VIEWPATH.'layout.phtml'; //центральный шаблон
|
include VIEWPATH.'layout.phtml'; //центральный шаблон
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function text_kuri(){
|
function text_kuri(){
|
||||||
|
|||||||
Reference in New Issue
Block a user