#66 WikiBlog Plugin now sorts logs correctly

1.3.x
closed
nobody
None
5
2012-10-11
2004-02-05
Pablo Martinez
No

WikiBlog was not showing the Blog in the correct
chronological order. This patch fixes that issue:

Index: WikiBlog.php

RCS file:
/cvsroot/phpwiki/phpwiki/lib/plugin/WikiBlog.php,v
retrieving revision 1.7
diff -u -r1.7 WikiBlog.php
--- WikiBlog.php 17 Nov 2003 16:23:55 -0000 1.7
+++ WikiBlog.php 5 Feb 2004 16:18:45 -0000
@@ -249,6 +249,8 @@
$html = HTML();

     if ($blogs) {
  • // First reorder
  • usort($blogs, array("WikiPlugin_WikiBlog",
    "cmp"));
    if ($args['order'] == 'reverse')
    $blogs = array_reverse($blogs);

@@ -310,6 +312,10 @@
return new Template('blogform', $request,
array('PAGENAME' =>
$args['page']));
}
+
+ function cmp($a, $b) {
+ return(strcmp($a->get('mtime'),
$b->get('mtime')));
+ }
};

// $Log: WikiBlog.php,v $

Discussion