24 lines
1.0 KiB
PHP
Executable File
24 lines
1.0 KiB
PHP
Executable File
<?php
|
|
ini_set('display_errors', 0);
|
|
/* ----------------------------------------------------------------------
|
|
30.11.2023
|
|
Получаем контент
|
|
---------------------------------------------------------------------- */
|
|
$content=\core::getContent($_GET['id'], 'bib');
|
|
$smarty->assign('book', $content['row']);
|
|
|
|
$content['json']['obem'] = \core::formatFileSize($content['json']['obem']);
|
|
$smarty->assign('json', $content['json']);
|
|
$cat = \DB::getRow("SELECT * FROM `content_category` WHERE `id`=? AND `site`=? AND `content_type`='bib' LIMIT 1", array($book['category'], $_SERVER['SERVER_NAME']));
|
|
$smarty->assign('cat', $cat);
|
|
|
|
|
|
$popular=\DB::getAll("SELECT `id`, `title`,`json` FROM `content` WHERE `site`=? AND `content_type`=? ORDER BY `see` DESC LIMIT 9", array($_SERVER['SERVER_NAME'], 'bib'));
|
|
for ($i=0; $i<count($popular); $i++){
|
|
$massiv=\json::from_j($popular[$i]['json']);
|
|
$popular[$i]['img']=$massiv['fileBook'];
|
|
$list_books[$i]['description']=$massiv['description'];
|
|
unset($massiv);
|
|
}
|
|
$smarty->assign('list', $popular);
|
|
?>
|