summaryrefslogtreecommitdiff
path: root/platform/www/lib/plugins/blog/syntax/blog.php
diff options
context:
space:
mode:
Diffstat (limited to 'platform/www/lib/plugins/blog/syntax/blog.php')
-rw-r--r--platform/www/lib/plugins/blog/syntax/blog.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/platform/www/lib/plugins/blog/syntax/blog.php b/platform/www/lib/plugins/blog/syntax/blog.php
index 2ca56d8..10ab45d 100644
--- a/platform/www/lib/plugins/blog/syntax/blog.php
+++ b/platform/www/lib/plugins/blog/syntax/blog.php
@@ -22,11 +22,11 @@ class syntax_plugin_blog_blog extends DokuWiki_Syntax_Plugin {
global $ID;
$match = substr($match, 7, -2); // strip {{blog> from start and }} from end
- list($match, $flags) = explode('&', $match, 2);
+ list($match, $flags) = array_pad(explode('&', $match, 2), 2, null);
$flags = explode('&', $flags);
array_unshift($flags, 'link'); // always make the first header of a blog entry a permalink (unless nolink is set)
- list($match, $refine) = explode(' ', $match, 2);
- list($ns, $num) = explode('?', $match, 2);
+ list($match, $refine) = array_pad(explode(' ', $match, 2), 2, null);
+ list($ns, $num) = array_pad(explode('?', $match, 2), 2, null);
if (!is_numeric($num)) {
if (is_numeric($ns)) {
@@ -46,9 +46,11 @@ class syntax_plugin_blog_blog extends DokuWiki_Syntax_Plugin {
}
function render($mode, Doku_Renderer $renderer, $data) {
+ global $INPUT;
+
list($ns, $num, $flags, $refine) = $data;
- $first = $_REQUEST['first'];
+ $first = $INPUT->int('first');
if (!is_numeric($first)) $first = 0;
// get the blog entries for our namespace
@@ -114,16 +116,24 @@ class syntax_plugin_blog_blog extends DokuWiki_Syntax_Plugin {
// close current section
if ($clevel && !$include_flags['inline']) $renderer->doc .= '</div>'.DOKU_LF;
- $renderer->doc .= '<div class="hfeed">'.DOKU_LF;
+ $renderer->doc .= '<div class="bloglist hfeed">'.DOKU_LF;
+
+
}
// now include the blog entries
foreach ($entries as $entry) {
if ($mode == 'xhtml' || $mode == 'code') {
- if(auth_quickaclcheck($entry['id']) >= AUTH_READ) {
- // prevent blog include loops
- if(!$this->included_pages[$entry['id']]) {
+ if(isset($entry['id']) && (auth_quickaclcheck($entry['id']) >= AUTH_READ)) {
+ // prevent blog include loop
+
+ // hack to disply formated dates per blog post
+ $d = strftime("%d", $entry['date']);
+ $m = strftime("%m", $entry['date']);
+ $y = strftime("%Y", $entry['date']);
+ $renderer->doc .= "<div class='date-frontpage date'><div class='date-dm'>$d/$m</div><div class='date-y'>$y</div>";
+ if(!array_key_exists($entry['id'], $this->included_pages) || !$this->included_pages[$entry['id']]) {
$this->included_pages[$entry['id']] = true;
$renderer->nest($include->_get_instructions($entry['id'], '', 'page', $clevel, $include_flags));
$this->included_pages[$entry['id']] = false;