From ba55dd5470e5f9953d3ef1a041dc159b4c5cf5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Fri, 20 Sep 2019 11:34:04 +0200 Subject: [PATCH] add Open Graph meta tags (fancy TG, FB etc. previews) --- www/_templates/front_wrap.php | 19 +++++++++++++++++++ www/index.php | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/www/_templates/front_wrap.php b/www/_templates/front_wrap.php index 95278d0..0adb473 100644 --- a/www/_templates/front_wrap.php +++ b/www/_templates/front_wrap.php @@ -10,6 +10,25 @@ + + + + + + + + + + + + + + + + + + diff --git a/www/index.php b/www/index.php index e5c175a..87eb694 100644 --- a/www/index.php +++ b/www/index.php @@ -13,6 +13,7 @@ if (isset($_GET["item"])) { $doc_template = new Template(); $doc_template->doc = $doc; + $selected_doc = $doc; $content = $doc_template->render('front_doc_overview.php'); } elseif (isset($_GET["tag"])) { $doc_list_template = new Template(); @@ -27,6 +28,7 @@ if (isset($_GET["item"])) { } $docs = $db->listDocs($tag["ID"]); $tag["Description"] = $pd->text($tag["Description"]); + $selected_tag = $tag; $doc_list_template->tag = $tag; } $doc_list_template->docs = $docs; @@ -43,5 +45,7 @@ $page->none_count = $db->getUntaggedDocCount(); $page->tags = $db->getTags(); $page->content = $content; $page->logged = isset($_SESSION["ID"]); +$page->selected_doc = $selected_doc; +$page->selected_tag = $selected_tag; echo $page->render('front_wrap.php'); ?>