From 77040f82477c35d2e44e926be46d6e5eb9ac8609 Mon Sep 17 00:00:00 2001 From: Andrey Kuvshinov Date: Sat, 16 May 2020 18:51:50 +0300 Subject: [PATCH] no downloads books --- app/routes/anpdf.php | 17 +++++++++++++++-- app/views/anpdf2.phtml | 5 ++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/routes/anpdf.php b/app/routes/anpdf.php index 4e6e55a..11f2a2d 100644 --- a/app/routes/anpdf.php +++ b/app/routes/anpdf.php @@ -176,7 +176,17 @@ function promo_kuri($hash, $page = 0, $promo = true){ # test url http://klan.dv/promo/bac343b41b357fdc8243373a429caa62 (742.pdf source) - $price = db_get("SELECT `price_id`, `pricename`, `BeginDate` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1"); + $pricesql = " + SELECT + `price_id`, `pricename`, `BeginDate`, `category_id` + FROM + `price` + WHERE + `pricehash` = '$hash' + LIMIT 1 + "; + + $price = db_get($pricesql); if (!isset($price['price_id'])){ header("HTTP/1.0 404 Not Found"); @@ -214,7 +224,10 @@ function promo_kuri($hash, $page = 0, $promo = true){ else { $filedown = True; $baseurl = "/read/$hash/"; - } + } + + if ($price['category_id'] == 3) + $filedown = False; $endurl = "$baseurl$count"; diff --git a/app/views/anpdf2.phtml b/app/views/anpdf2.phtml index 82ec788..3b78945 100644 --- a/app/views/anpdf2.phtml +++ b/app/views/anpdf2.phtml @@ -15,7 +15,10 @@ Получайте «Газету на @email» - Приятного чтения ↓ + + + + Приятного чтения ↓