From 0a06b7595d3408ffee40350263ab6f3aae5ae3bd Mon Sep 17 00:00:00 2001 From: Andrey Kuvshinov Date: Thu, 9 Apr 2020 00:00:18 +0300 Subject: [PATCH] add static pdf file --- app/modules/anpdf/anpdf.php | 13 +++++++++++-- app/routes/price.php | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/modules/anpdf/anpdf.php b/app/modules/anpdf/anpdf.php index ced55b3..3cce68c 100644 --- a/app/modules/anpdf/anpdf.php +++ b/app/modules/anpdf/anpdf.php @@ -40,9 +40,18 @@ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){ return False; } + $namefile = $price['pricehash'].'.pdf'; + $cachefile = PDFDIR.$namefile; + + if (file_exists($cachefile)){ + $pdfile = '/'.$namefile; + } + else { + $pdfile = '/file/'.$hash; + } + $id = $price['price_id']; - $pdfile = "/file/$hash"; - $maxpage = 32; + $maxpage = 24; $title = $price['pricename']; if (!$promo) diff --git a/app/routes/price.php b/app/routes/price.php index 474947e..1b1f79c 100644 --- a/app/routes/price.php +++ b/app/routes/price.php @@ -18,7 +18,6 @@ function anfilename($id){ - function file_kuri($hash) {