add cache pages
This commit is contained in:
@@ -181,7 +181,7 @@ function promo_kuri($hash, $page = 0, $promo = true){
|
|||||||
|
|
||||||
$pricesql = "
|
$pricesql = "
|
||||||
SELECT
|
SELECT
|
||||||
`price_id`, `pricename`, `BeginDate`, `category_id`
|
`price_id`, `pricename`, `BeginDate`, `category_id`, `pages`
|
||||||
FROM
|
FROM
|
||||||
`price`
|
`price`
|
||||||
WHERE
|
WHERE
|
||||||
@@ -213,9 +213,22 @@ function promo_kuri($hash, $page = 0, $promo = true){
|
|||||||
$file = PDFSOURCE."${price['price_id']}.pdf";
|
$file = PDFSOURCE."${price['price_id']}.pdf";
|
||||||
$data = pdfs_init($file, $page);
|
$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'];
|
$pdfile = $data['pdfpgurl'];
|
||||||
$fullpdf = $data['pdfurl'];
|
$fullpdf = $data['pdfurl'];
|
||||||
$count = $data['count'];
|
$count = $data['pages'];
|
||||||
$pagenum = 1;
|
$pagenum = 1;
|
||||||
$newcurr = strtotime($price['BeginDate']);
|
$newcurr = strtotime($price['BeginDate']);
|
||||||
$category = $price['category_id'];
|
$category = $price['category_id'];
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function pdfs_init($source, $page = 1){
|
|||||||
if (!file_exists($source))
|
if (!file_exists($source))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$result['count'] = pdfs_count($source); // количество страниц
|
// $result['count'] = pdfs_count($source); // количество страниц
|
||||||
$result['pdfurl'] = SITE.trim(pdfs_cachefile($source), '/'); //полный файл на скачку
|
$result['pdfurl'] = SITE.trim(pdfs_cachefile($source), '/'); //полный файл на скачку
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user