aboutsummaryrefslogtreecommitdiff
path: root/src/frontend_blog/teaser.php
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-01-20 18:15:46 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-01-20 18:15:46 +0100
commit44b4a0b20e798756826d7e3175e453b439e758dc (patch)
tree50e13f2b902f572979ec002fbd821d99fa01d2e2 /src/frontend_blog/teaser.php
parent09b3cfee78cebd84cfec64ce28cd5d39be0a12d2 (diff)
downloadmerchant-44b4a0b20e798756826d7e3175e453b439e758dc.tar.gz
merchant-44b4a0b20e798756826d7e3175e453b439e758dc.tar.bz2
merchant-44b4a0b20e798756826d7e3175e453b439e758dc.zip
Adding most of blog-type website.
Diffstat (limited to 'src/frontend_blog/teaser.php')
-rw-r--r--src/frontend_blog/teaser.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/frontend_blog/teaser.php b/src/frontend_blog/teaser.php
new file mode 100644
index 00000000..e5f2e97b
--- /dev/null
+++ b/src/frontend_blog/teaser.php
@@ -0,0 +1,46 @@
+<html>
+<?php
+/*
+ This file is part of GNU TALER.
+ Copyright (C) 2014, 2015 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License along with
+ TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
+*/
+
+/**
+ * This file should:
+ *
+ * 1. fetch the article teaser and attach a 'read more' link to it
+ *
+ */
+$article = (isset($_GET['article']) ? $_GET['article'] : "No article");
+$content = file_get_contents("articles/$article.html");
+$doc = new DOMDocument();
+$doc->loadHTML($content);
+$teaser = $doc->getElementById("teaser");
+?>
+<head>
+ <title>
+ <?php echo $article ?>
+ </title>
+</head>
+<body>
+<?php if ($article == "No article")
+ echo "Please select some article";
+ else {
+ session_start();
+ $_SESSION['article'] = $article;
+ echo $teaser->nodeValue
+ . "<br><a href=\"/essay_checkout.php\">read more</a>";}; ?>
+
+<body>
+</html>