diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-01-20 18:15:46 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-01-20 18:15:46 +0100 |
commit | 44b4a0b20e798756826d7e3175e453b439e758dc (patch) | |
tree | 50e13f2b902f572979ec002fbd821d99fa01d2e2 /src/frontend_blog/blog_lib.php | |
parent | 09b3cfee78cebd84cfec64ce28cd5d39be0a12d2 (diff) | |
download | merchant-44b4a0b20e798756826d7e3175e453b439e758dc.tar.gz merchant-44b4a0b20e798756826d7e3175e453b439e758dc.tar.bz2 merchant-44b4a0b20e798756826d7e3175e453b439e758dc.zip |
Adding most of blog-type website.
Diffstat (limited to 'src/frontend_blog/blog_lib.php')
-rw-r--r-- | src/frontend_blog/blog_lib.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/frontend_blog/blog_lib.php b/src/frontend_blog/blog_lib.php new file mode 100644 index 00000000..4238e993 --- /dev/null +++ b/src/frontend_blog/blog_lib.php @@ -0,0 +1,26 @@ +<?php + +/** + * Take a (article's) filename and return its + * teaser. It has the articles folder hardcoded + */ +function get_teaser($name){ + $content = file_get_contents("articles/$name.html"); + $doc = new DOMDocument(); + $doc->loadHTML($content); + $teaser = $doc->getElementById("teaser"); + return $teaser; +} + +/** + * Take a (article's) filename and return its + * DOM. It has the articles folder hardcoded + */ +function get_article($name){ + $content = file_get_contents("articles/$name.html"); + $doc = new DOMDocument(); + $doc->loadHTML($content); + return $doc; +} + +?> |