diff --git a/_config.php b/_config.php index 19eb962..814b09e 100644 --- a/_config.php +++ b/_config.php @@ -7,16 +7,16 @@ const BLOG_RAN = true; // Tytuł bloga - const BLOG_TITLE = "nowy blog"; + const BLOG_TITLE = "Nowy blog"; // Opis bloga - const BLOG_DESC = "o niczym"; + const BLOG_DESC = "Jest to nowy blog"; // Autor bloga/Nazwa wyświetlana dla głównego administratora bloga - const BLOG_AUTHOR = "Krzysiek Smaga"; + const BLOG_AUTHOR = "Krzysztof Smaga"; // Tagi bloga - const BLOG_TAGS = "asdf, sadf, wr"; + const BLOG_TAGS = "nowy, blog, zero"; // Domena bloga const BLOG_DOMAIN = "http://localhost"; @@ -38,7 +38,7 @@ const DB_PASS = ""; // Baza danych dla bloga - const DB_NAME = "blog_now"; + const DB_NAME = "blogengine"; /* * KONFIGURACJA NARZĘDZIA SERWEROWEGO @@ -81,4 +81,4 @@ const MAIL_PORT = ""; // Wymaga SSL'a - const MAIL_SSL = 0; \ No newline at end of file + const MAIL_SSL = 1; \ No newline at end of file diff --git a/be_panel.php b/be_panel.php index 5369a54..d41416f 100644 --- a/be_panel.php +++ b/be_panel.php @@ -11,7 +11,7 @@ if(!isset($_SESSION['uToken_BE'])) header("location: be_login.php"); - $site = ($_GET['s'] ?? "home"); + $site = ($_GET['s'] ?? "_home"); $elements = array(); $dashboard_tabs_dir = "vendor/blog-engine/php/Dashboard/Tabs"; diff --git a/blog_panel/be_post.php b/blog_panel/be_post.php index f2c9b12..1dd8c69 100644 --- a/blog_panel/be_post.php +++ b/blog_panel/be_post.php @@ -61,7 +61,7 @@ $postcon->CreatePost($_POST['title'], $_POST['content'], $_POST['name'], $_POST['tags'], $_POST['comments_status'], (isset($_POST['now_time']) ? true : $_POST['add_time']), "public"); if(isset($_POST['draft'])) - $postcon->DraftPost($_POST['draft'], $_POST['title'], $_POST['content'], $_POST['name'], $_POST['tags'], $_POST['comments_status']); + $postcon->DraftPost($_POST['draft'], $_POST['title'], $_POST['content'], $_POST['name'], $_POST['tags'], $_POST['comments_status'], (isset($_POST['now_time']) ? true : $_POST['add_time'])); if(isset($_POST['delete'])) $postcon->DeletePost($_POST['delete']); diff --git a/compile.php b/compile.php index ad5ba97..c193c50 100644 --- a/compile.php +++ b/compile.php @@ -99,18 +99,18 @@ if(pathinfo($file, PATHINFO_EXTENSION) == "html") { $name = basename($file); $site = file_get_contents($file); - foreach (array_keys($this->dictionary->page_tags) as $page_tag) { + foreach (array_keys($this->dictionary->PageTags()) as $page_tag) { if ($page_tag == "{CSS}") { for ($j = 2; $j < count($this->csss); $j++) - $this->dictionary->page_tags[$page_tag] .= "\n "; + $this->dictionary->PageTags()[$page_tag] .= "\n "; } if ($page_tag == "{JS}") { for ($j = 2; $j < count($this->jss); $j++) - $this->dictionary->page_tags[$page_tag] .= "\n "; + $this->dictionary->PageTags()[$page_tag] .= "\n "; } - $site = str_replace($page_tag, $this->dictionary->page_tags[$page_tag], $site); + $site = str_replace($page_tag, $this->dictionary->PageTags()[$page_tag], $site); } $site = str_replace("
", "\n", $site); @@ -174,21 +174,21 @@ switch($type){ case "dev": foreach ($json["dev"]["css"] as $css){ - $this->dictionary->page_tags["{CSS}"] .= "\n "; + $this->dictionary->PageTags()["{CSS}"] .= "\n "; echo "* Dodano '$css' do styli w '$type'!\n"; } foreach ($json["dev"]["js"] as $js){ - $this->dictionary->page_tags["{JS}"] .= "\n "; + $this->dictionary->PageTags()["{JS}"] .= "\n "; echo "* Dodano '$js' do skryptów w '$type'!\n"; } break; case "pub": foreach ($json["pub"]["css"] as $css){ - $this->dictionary->page_tags["{CSS}"] .= "\n "; + $this->dictionary->PageTags()["{CSS}"] .= "\n "; echo "* Dodano '$css' do styli w '$type'!\n"; } foreach ($json["pub"]["js"] as $js){ - $this->dictionary->page_tags["{JS}"] .= "\n "; + $this->dictionary->PageTags()["{JS}"] .= "\n "; echo "* Dodano '$js' do skryptów w '$type'!\n"; } break; diff --git a/dev/index.html b/dev/index.html index 5b11893..1539af3 100644 --- a/dev/index.html +++ b/dev/index.html @@ -2,23 +2,18 @@ -dsfsadf
+ +Jest to nowy blog
Zaloguj się do panelu - - - \ No newline at end of file diff --git a/dev/post.html b/dev/post.html new file mode 100644 index 0000000..7e4acba --- /dev/null +++ b/dev/post.html @@ -0,0 +1,24 @@ + + + + + +Jest to nowy blog
+ +{POST_CONTENT}
+{POST_VIEWS}
+ + + \ No newline at end of file diff --git a/post.php b/post.php index 80e35b1..798a606 100644 --- a/post.php +++ b/post.php @@ -3,10 +3,42 @@ require "vendor/blog-engine/php/Authentication/AuthController.php"; require "vendor/blog-engine/php/Posts/PostController.php"; - use BlogEngine\Posts\PostController; use BlogEngine\Authentication\AuthController; - + use BlogEngine\Posts\PostController; + session_start(); $auth = new AuthController(); - $conn = $auth->Connection(); \ No newline at end of file + $site = ""; + + if(file_exists("_config.php")){ + $topbar = ""; + if($_SERVER['SERVER_PORT'] == DEV_PORT) { + if(isset($_SESSION['uToken_BE'])){ + if($auth->CheckRole($_SESSION['uToken_BE']) == "administrator") + require "vendor/blog-engine/php/Sites/Views/be-topbar.php"; + } + $site = file_get_contents("dev/post.html"); + } else if($_SERVER['SERVER_PORT'] == PUB_PORT) { + if(isset($_SESSION['uToken_BE'])){ + if($auth->CheckRole($_SESSION['uToken_BE']) == "administrator") + require "vendor/blog-engine/php/Sites/Views/be-topbar.php"; + } + $site = file_get_contents("public/post.html"); + } else + echo "dsfsadf
+ +Jest to nowy blog
Zaloguj się do panelu - + \ No newline at end of file diff --git a/public/post.html b/public/post.html new file mode 100644 index 0000000..9da4f45 --- /dev/null +++ b/public/post.html @@ -0,0 +1,31 @@ + + + + + +Jest to nowy blog
+ +{POST_CONTENT}
+{POST_VIEWS}
+ + + + + + + \ No newline at end of file diff --git a/src/views/post.html b/src/views/post.html new file mode 100644 index 0000000..973f06e --- /dev/null +++ b/src/views/post.html @@ -0,0 +1,23 @@ + + + + + +{DESCRIPTION}
+ +{POST_CONTENT}
+{POST_VIEWS}
+ +{JS} + \ No newline at end of file diff --git a/vendor/blog-engine/php/Dashboard/Tabs/home.php b/vendor/blog-engine/php/Dashboard/Tabs/_home.php similarity index 100% rename from vendor/blog-engine/php/Dashboard/Tabs/home.php rename to vendor/blog-engine/php/Dashboard/Tabs/_home.php diff --git a/vendor/blog-engine/php/Dashboard/Tabs/posts.php b/vendor/blog-engine/php/Dashboard/Tabs/posts.php index 3cd1cc8..00510ad 100644 --- a/vendor/blog-engine/php/Dashboard/Tabs/posts.php +++ b/vendor/blog-engine/php/Dashboard/Tabs/posts.php @@ -51,7 +51,7 @@ -