From 51b3554ff2988ac61ba3f604431e09941cd95545 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Tue, 14 Mar 2023 03:10:19 +0200 Subject: main css classes for front/back-end --- html/app/views/simple/post.php | 236 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 html/app/views/simple/post.php (limited to 'html/app/views/simple/post.php') diff --git a/html/app/views/simple/post.php b/html/app/views/simple/post.php new file mode 100644 index 0000000..9e37cd9 --- /dev/null +++ b/html/app/views/simple/post.php @@ -0,0 +1,236 @@ +get_post($post_id); +$categories = $wiki->category_tree(); +$breadcrumbs = Render::all_breadcrumbs($categories); + +if ($post == false) { // when post not found + $post = [ // create a virtual record with error messages + 'id' => 0, + 'title' => 'Το άρθρο που αναζητήσατε δεν υπάρχει', + 'category_id' => 0, + 'intro' => 'Για να βρειτε το άρθρο που ψάχνετε χρησιμοποιήστε την αναζήτηση + του wiki ή πλοηγηθείτε στο δέντρο των κατηγοριών.', + 'body' => "" + ]; + +} else { // post found; prepare article's data to render + + $category_id = $post['category_id']; + + // find parent_ids of current category (to open the menu tree) + $category_path = []; + foreach($breadcrumbs[$category_id]['parents'] as $parent) { + $category_path[] = intval($parent['id']); + } + $category_path[] = intval($category_id); + +} + + +// format special parts of post +$parsedown = new Parsedown(); +$body_html = $parsedown->text($post['body']); // body: markdown to html + +// decode json output (tags + medias) +if ($post['tags_json'] != null) { $tags = json_decode($post['tags_json']); } +if ($post['medias_json'] != null) { $medias = json_decode($post['medias_json']); } + + +// then render the page ... +// ----------------------------------------------------------------------------- +?> + + + + Wiki + + false ]); ?> + + + + +
+ +
+ + +
+ +
+ +
+ +
+ + + +
+ + +
+ + +

+ + + + + + + + +

+ + + + + + +

+ + + +
+ +
+ + + +
+

Συνημμένα:

+
    + + reference == 1) : ?> +
  1. + + title?> + +
  2. + + +
+
+ + + + +
+ Επικέτες: + + name?> + +
+ + +
+ +
+ +
+
+ + + + + + + + + + + + + + -- cgit v1.2.3