2022-12-11 13:55:49 +05:00
|
|
|
|
<?php
|
|
|
|
|
|
2023-01-14 21:17:46 +05:00
|
|
|
|
ini_set('display_errors', 0);
|
2022-12-11 13:55:49 +05:00
|
|
|
|
|
2023-02-12 15:08:07 +05:00
|
|
|
|
@mkdir('img/' . $_SERVER['SERVER_NAME'] . '/ava', 0700);
|
|
|
|
|
|
2022-12-11 13:55:49 +05:00
|
|
|
|
/*
|
|
|
|
|
20.11.2017 добавлен поиск по алиасу (ЧПУ) /alias.html
|
|
|
|
|
22.03.2021: Почти все засунуто в ООП
|
|
|
|
|
-- Доделать лайки и дизлайки
|
|
|
|
|
-- Сделать коментарии
|
|
|
|
|
*/
|
|
|
|
|
//print_r($_SESSION);
|
|
|
|
|
|
|
|
|
|
|
2023-02-12 15:08:07 +05:00
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
11.02.2023
|
|
|
|
|
Получаем страницу
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
|
2023-01-14 21:17:46 +05:00
|
|
|
|
$page = \DB::getAll("SELECT * FROM `pages` WHERE `id`=? LIMIT 1", $_GET['id']);
|
|
|
|
|
if ($page[0]['status']==0)header( 'Location: /403/' );
|
2022-12-11 13:55:49 +05:00
|
|
|
|
$page[0]['date']=date('d.m.Y', $page[0]['t']);
|
|
|
|
|
$smarty->assign('page', $page);
|
2023-02-12 15:08:07 +05:00
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
11.02.2023
|
|
|
|
|
Получаем данные о пользователе
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
$autor=\DB::getAll("SELECT * FROM `users` WHERE `id`=? LIMIT 1", $page[0]['user_id']);
|
|
|
|
|
if ($autor[0]['dostup']=='a')$autor[0]['dostup']='Администратор сайта';
|
|
|
|
|
$smarty->assign('autor', $autor);
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
|
11.02.2023
|
|
|
|
|
Получаем количество статей пользователя
|
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
|
$pageskolvo=\DB::getAll("SELECT count(*) FROM `pages` WHERE `user_id`=? AND `status`=1", $page[0]['user_id']);
|
|
|
|
|
$smarty->assign('pageskolvo', $pageskolvo[0]['count(*)']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-11 13:55:49 +05:00
|
|
|
|
//print_r($page);
|
2023-01-14 21:17:46 +05:00
|
|
|
|
/*
|
2022-12-11 13:55:49 +05:00
|
|
|
|
//Получаем данные о категории
|
|
|
|
|
if ( $page[0]['parent'] !=0 ) $cat_info = $mod -> get_cat_info ( $page[0]['parent'] );
|
|
|
|
|
|
|
|
|
|
//Получаем данные о пользователе
|
|
|
|
|
unset( $a );
|
|
|
|
|
$a['id'] = $page[0]['user_id'];
|
|
|
|
|
$user_info = $db -> get_val( 'users', $a, 'json' );
|
|
|
|
|
$smarty->assign('user_info', $db->from_j($user_info));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//получаем список категорий + статей в них
|
|
|
|
|
|
|
|
|
|
$cats=$mod->get_cat_list();
|
|
|
|
|
|
|
|
|
|
$smarty->assign('cats_lists', $cats);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$keywords = $mod -> gen_keywords ($page[0]['txt']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$smarty->assign('keys', $keywords);
|
|
|
|
|
$smarty->assign('comments', $mod -> comments);
|
|
|
|
|
//$smarty->assign('breadcrumb', $mod -> get_breadcrumb($page[0]['pages_cat']));
|
|
|
|
|
unset($tmp);
|
|
|
|
|
|
|
|
|
|
if ($page[0]['public']==0 && $_SESSION['dostup']!=='a')header( 'Location: /403/' );
|
|
|
|
|
|
|
|
|
|
//Получаем статьи этого пользователя
|
|
|
|
|
unset($b);
|
|
|
|
|
//echo $page[0]['avtor'];
|
|
|
|
|
$b['user_id']=$page[0]['user_id'];
|
|
|
|
|
$page_user=$db->get_massiv('pages', $b, 't', 20);
|
|
|
|
|
$smarty->assign('page_user', $page_user);
|
|
|
|
|
//загружаем список картинок
|
|
|
|
|
unset($c);
|
|
|
|
|
$db -> or_by_desc = '';
|
|
|
|
|
$c['page_id']=$page[0]['id'];
|
|
|
|
|
|
2023-01-14 21:17:46 +05:00
|
|
|
|
*/
|
2022-12-11 13:55:49 +05:00
|
|
|
|
?>
|