From 13aa08cee07d6d1b8378db59e8c12681725f82bf Mon Sep 17 00:00:00 2001 From: Slava Date: Sun, 27 Jul 2025 15:23:11 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +1 \ No newline at end of file -- 2.49.1 From 235d6a3a18f9a709ddc9d2558f500e765be8856b Mon Sep 17 00:00:00 2001 From: Slava Date: Thu, 6 Nov 2025 19:20:41 +0200 Subject: [PATCH 2/4] init --- index.php | 210 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 index.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..3100012 --- /dev/null +++ b/index.php @@ -0,0 +1,210 @@ +saveXML(); } else{ */ + +/** @brief Массив элементов меню страницы */ +$menu = explode(',', $ansv['page']['PageMenu']); + +/** @brief Верхнее меню сайта */ +$config['TopMenu'] = GetXMLMenu($ansv['XML']->index, $REQUEST_URI, $menu[0], 'h'); + +/** @brief Боковое меню сайта */ +$config['sideMenu'] = GetSideXMLMenu($ansv['XML']->index, $REQUEST_URI, $menu[0]); + +/** @brief Основное меню сайта */ +$config['SiteMenu'] = GetXMLMenu($ansv['XML']->index, $REQUEST_URI, $menu[1], 'h'); + +/* && $config['REQUEST_URI']=='/' */ +if (empty($config['TopMenu'])) { + if ($_SESSION['Login'] == 'false') { + $_SESSION['formType'] = 'log_err'; + } else { + $_SESSION['formType']= 'log_on'; + } +} + +if (is_file($path . $config['page_url'].".page.php")) { + $xmlstr = simplexml_load_file($path . $config['page_url'].".page.php"); +} else { + error405(true, $config['encoding']); +} + +/* $EditPage['url'] = $path .'content/scan/index.page.php'; $EditPage['page'] = simplexml_load_file($EditPage['url']); */ + +/** @brief Полное название сайта с текущей страницей */ +$config['sitename'] .= ' > ' . $config['title']; + +/** @brief CSS-класс заголовка контента */ +$config['ctitle'] = $xmlstr->content['tclass']; + +/** @brief CSS-класс блока контента */ +$config['cfloat'] = $xmlstr->content['bclass']; + +/** @brief Права доступа текущего пользователя к странице */ +$access = FindPageUser($ansv['page']['users'], $_SESSION['username']); + +if ($access) { + $config['left'] = GetBlock($xmlstr->lblock->block, 'left'); + $config['left'] .= getNews($xmlstr->lblock->block, 'left'); + $config['left'] = "
" . $config['left'] . "
"; + + $config['right'] = GetBlock($xmlstr->rblock->block, 'right'); + $config['right'] .= getNews($xmlstr->rblock->block, "right"); + $config['right'] = "
" . $config['right'] . "
"; + + $center = '
' . GetBlock($xmlstr->cblock->block, 'center') . '
'; + $config['content'] = $xmlstr->content->{$config['lng']}; +} else { + if ($_SESSION['log_in']) { + $xmlstr = simplexml_load_file($path . 'content/adm/user.page.php'); + } else { + $xmlstr = simplexml_load_file($path . 'content/adm/access.page.php'); + } + + $config['left'] = ''; + $config['right'] = ''; + $center = '
' . GetBlock($xmlstr->cblock->block, 'center') . '
'; + $config['content'] = $xmlstr->content->$config['lng']; +} +foreach ($config as $key=>$value) if ($key!="request_url") +$config['content'] =str_replace('%'.$key.'%', $value, $config['content']); +$config['content'] =str_replace('%center%', $center, $config['content']); +$config['home'] ='index.html'; + +if (isset($_SESSION['username'])) { + $config['User'] = $_SESSION['username']; +} else { + $config['User'] = 'Гость'; +} +setcookie('User', $config['User'], time() + 2419200, '/'); + +$html .= ''; +$html .= file_get_contents($path . 'data/top.php'); +$html .= file_get_contents($path . 'template/'.$config['template'].'/page.php'); +/* $html .= file_get_contents($path . 'data/foot.php'); */ +$html .= ''; + +$lang = include $path . 'data/lang.php'; +$lng = $_SESSION['lng'] ?? 'en'; +$Js = file_get_contents($path . 'data/Basic_functions.js'); +foreach ($lang[$lng] as $key => $value) { + $Js = str_replace('{{' . $key . '}}', $value, $Js); +} +$html .= ''; + +$html .= loadPluginsInCenterBlock(); +$html .= includePlugin(['plugin' => 'siteSettings']); +$html .= includePlugin(['plugin' => 'auth']); +/* $html .= includePlugin(['plugin' => 'editor']); */ +/* $html .= includePlugin(['plugin' => 'manager']); */ +/* $html .= includePlugin(['plugin' => 'site_tree']); */ +/* $html .= includePlugin(['plugin' => 'pickr']); */ + +$html .= '
'.getNews($xmlstr->rblock->block, "center").'
'; + +foreach ($config as $key=>$value)if ($key!="request_url") + $html =str_replace('%'.$key.'%', $value, $html); + +header('Content-type: text/html; charset='. $config['encoding']); + +echo $html; + +/* var_dump($REQUEST_URI); echo password_hash("gena", PASSWORD_DEFAULT); //a004b486e740bb4580a04125975893b0 gettype( } */ +?> \ No newline at end of file -- 2.49.1 From 66e502d183d61c8a0507479b56a8f9a4acc75fb7 Mon Sep 17 00:00:00 2001 From: Slava Date: Thu, 6 Nov 2025 19:22:51 +0200 Subject: [PATCH 3/4] add index.php --- index.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 index.php diff --git a/index.php b/index.php old mode 100644 new mode 100755 -- 2.49.1 From 2d7d202f40ccc6f41d4f27e112dc399b0faf506d Mon Sep 17 00:00:00 2001 From: Slava Date: Thu, 6 Nov 2025 19:29:37 +0200 Subject: [PATCH 4/4] add error.txt --- error.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 error.txt diff --git a/error.txt b/error.txt new file mode 100755 index 0000000..e69de29 -- 2.49.1