diff --git a/app/api/book.php b/app/api/book.php index ac09dbb..bd8956c 100644 --- a/app/api/book.php +++ b/app/api/book.php @@ -14,6 +14,7 @@ function bookid_kuri($slug) { `categoryslug`, price.category_id AS category_id, `BeginDate`, + `date_subscript`, `priceanons`, `priceimg`, `pricehash`, @@ -48,7 +49,6 @@ function bookid_kuri($slug) { //$book['pic'] = IMGSRV."price/300x470/{$book['price_id']}.{$book['priceimg']}"; $book['pic'] = picbook($book, 300, 470); - $book['links']['pdf'] = SITE.'read/'.$book['pricehash']; $book['links']['text'] = SITE.'readtext/'.$book['pricehash']; $file = PDFSOURCE.$book['price_id'].'.pdf'; diff --git a/app/confg.php b/app/confg.php index 8f372ff..4ac9866 100644 --- a/app/confg.php +++ b/app/confg.php @@ -4,7 +4,6 @@ ini_set('display_errors', 0); ini_set('display_startup_errors', 0); error_reporting(E_ALL); - if (isset($_SERVER['HTTP_HOST'])) define('SITE', 'https://'.$_SERVER['HTTP_HOST'].'/'); @@ -80,9 +79,17 @@ set('noreply', ]); -db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'newser', 'Chjk90yuiREY'); -db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'reader', 'ghjyjkUIOhg56Fh'); -db_config('chitatel', 'mysql:host=mysql;dbname=argumentiru', 'chitatel', 'hjYu78kl*90Uio'); -db_config('klan', 'mysql:host=mysql;dbname=argumentiru', 'klan', 'zpFGhyuRty765Jk'); +if ( $_SERVER['HTTP_HOST'] == 'vklan.argumenti.ru') { + db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'root', '234ASasdYa56UIkol'); + db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'root', '234ASasdYa56UIkol'); + db_config('chitatel', 'mysql:host=mysql;dbname=argumentiru', 'root', '234ASasdYa56UIkol'); + db_config('klan', 'mysql:host=mysql;dbname=argumentiru', 'root', '234ASasdYa56UIkol'); +} +else { + db_config('argumentiru', 'mysql:host=mysql;dbname=argumentiru', 'newser', 'Chjk90yuiREY'); + db_config('reader', 'mysql:host=mysql;dbname=argumentiru', 'reader', 'ghjyjkUIOhg56Fh'); + db_config('chitatel', 'mysql:host=mysql;dbname=argumentiru', 'chitatel', 'hjYu78kl*90Uio'); + db_config('klan', 'mysql:host=mysql;dbname=argumentiru', 'klan', 'zpFGhyuRty765Jk'); +} // GRANT ALL PRIVILEGES ON argumentiru.* TO 'hitatel'@'%' IDENTIFIED BY 'hjYu78kl*90Uio' diff --git a/app/routes/books.php b/app/routes/books.php index f030b5d..fb87a8f 100644 --- a/app/routes/books.php +++ b/app/routes/books.php @@ -60,7 +60,15 @@ function category_kuri($category = '', $filter = 'all', $page = 1){ $filter = "category_id = 1"; } elseif ($category == 'knigi') { - $filter = "category_id = 3"; + if (SUBSTATUS == 1) { + $filter = "category_id = 3 AND sub = 1"; + } + else { + $filter = "category_id = 3"; + } + } + elseif($category == 'soon'){ + $filter = "sub = 0"; } $cats = api_cats(); @@ -93,6 +101,10 @@ function category_kuri($category = '', $filter = 'all', $page = 1){ if (isset($cats[$category])){ $breadcrumbs['page'] = $pagetitle; } + else { + $pagetitle = 'Скоро в подписке'; + $breadcrumbs['page'] = $pagetitle; + } $tempcontent = VIEWPATH.'books.phtml'; include VIEWPATH.'layout.phtml'; diff --git a/app/routes/report.php b/app/routes/report.php new file mode 100644 index 0000000..e69de29 diff --git a/app/views/book.phtml b/app/views/book.phtml index b70b049..597b787 100644 --- a/app/views/book.phtml +++ b/app/views/book.phtml @@ -17,7 +17,7 @@

- +

Читать PDF

@@ -31,7 +31,18 @@

Доступ к библиотеке за 490 руб. в год

Или войдите в личный кабинет если покупка уже оформлена

- + + +

в подписке с + +

Скоро в подписке + + + за 490 рублей в год + +

+ + 0 && $book['pieces'] > 0):?>

Бумажная за руб.

diff --git a/app/views/books.phtml b/app/views/books.phtml index cc2702b..1b2a343 100644 --- a/app/views/books.phtml +++ b/app/views/books.phtml @@ -1,9 +1,12 @@
@@ -24,9 +27,15 @@

-

- Читать > -

+ +

+ Скоро в подписке +

+ +

+ Читать > +

+
diff --git a/app/views/klanbooks.phtml b/app/views/klanbooks.phtml new file mode 100644 index 0000000..e69de29