add cache pages

This commit is contained in:
Andrey Kuvshinov
2020-05-21 21:01:42 +03:00
parent f2ab7dd263
commit b9cd095e55
2 changed files with 16 additions and 3 deletions

View File

@@ -181,7 +181,7 @@ function promo_kuri($hash, $page = 0, $promo = true){
$pricesql = "
SELECT
`price_id`, `pricename`, `BeginDate`, `category_id`
`price_id`, `pricename`, `BeginDate`, `category_id`, `pages`
FROM
`price`
WHERE
@@ -213,9 +213,22 @@ function promo_kuri($hash, $page = 0, $promo = true){
$file = PDFSOURCE."${price['price_id']}.pdf";
$data = pdfs_init($file, $page);
if ($price['pages'] == 0){
$data['pages'] = pdfs_count($file);
$pages_sql = "
UPDATE
price
SET
pages = ${data['count']}
WHERE
price_id = ${price['price_id']}
";
db_get($pages_sql, 'chitatel');
}
$pdfile = $data['pdfpgurl'];
$fullpdf = $data['pdfurl'];
$count = $data['count'];
$count = $data['pages'];
$pagenum = 1;
$newcurr = strtotime($price['BeginDate']);
$category = $price['category_id'];

View File

@@ -46,7 +46,7 @@ function pdfs_init($source, $page = 1){
if (!file_exists($source))
return false;
$result['count'] = pdfs_count($source); // количество страниц
// $result['count'] = pdfs_count($source); // количество страниц
$result['pdfurl'] = SITE.trim(pdfs_cachefile($source), '/'); //полный файл на скачку