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?>
Επικέτες: name?>