7, 'user' => '', 'order' => 'reverse', // latest first 'month' => false, 'noheader' => 0 ); } function run($dbi, $argstr, &$request, $basepage) { if (is_array($argstr)) { // can do with array also. $args =& $argstr; if (!isset($args['order'])) $args['order'] = 'reverse'; } else { $args = $this->getArgs($argstr, $request); } $user = $request->getUser(); if (empty($args['user'])) { if ($user->isAuthenticated()) { $args['user'] = $user->UserName(); } else { $args['user'] = ''; } } if (!$args['user'] or $args['user'] == ADMIN_USER) { if (BLOG_DEFAULT_EMPTY_PREFIX) { $args['user'] = ''; // "Blogs/day" pages } else { $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages } } $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR); $prefix = $base = $parent . $this->blogPrefix('wikiblog'); if ($args['month']) $prefix .= (SUBPAGE_SEPARATOR . $args['month']); $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix . SUBPAGE_SEPARATOR, true, 'posix')); $html = HTML(); $i = 0; while (($page = $pages->next()) and $i < $args['count']) { $rev = $page->getCurrentRevision(false); if ($rev->get('pagetype') != 'wikiblog') continue; $i++; $blog = $this->_blog($rev); //$html->pushContent(HTML::h3(WikiLink($page, 'known', $rev->get('summary')))); $html->pushContent($rev->getTransformedContent('wikiblog')); } if ($args['user'] == $user->UserName() or $args['user'] == '') $html->pushContent(Button(array('action' => 'WikiBlog', 'mode' => 'add'), _("New entry"), $base)); if (!$i) return HTML(HTML::h3(_("No Blog Entries")), $html); if (!$args['noheader']) return HTML(HTML::h3(sprintf(_("Blog Entries for %s:"), $this->monthTitle($args['month']))), $html); else return $html; } } // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: