Closed Klap-in closed 1 year ago
I got an error :
PHP Fatal error: Uncaught Error: Class 'dokuwiki\Utf8\Sort' not found in /xxx/doku/lib/plugins/pagelist/helper.php:630
Seems there is a new class in some new version of dokuwiki? I am using "Hogfather".
I updated my doku to "Jack Jackrum" and tested sort by date. It works.
But seems:
arsort
in finishList() should be replaced by krsort
for reverses works. like:
public function finishList()
{
if ($this->sort) {
Sort::ksort($this->pages);
if ($this->rsort) {
krsort($this->pages);
}
}
page_exists
check is necessary. like: public function addPage($page)
{
$id = $page['id'];
if (!$id) return false;
if (!page_exists($id)) { return false; }
Point 3 locks out listing of nonexisting pages in other usages of the pagelist plugin. I did not yet look into the authorstats plugin, do you have an example of the syntax I can test?
I have no special example for this. Just using this authorstats plugin. Seems , this plugin will collect pages created/edited by each user. And nonexisting pages are in the range of created-pages.
point 1. Good spotted. The krsort I did not test yet, is now fixed including support of different languages.
point 3. With <AUTHORSTATS>
and the config setting plugin»authorstats»enable-pagelist
, I got the pagelist.
The flags used are from the general pagelist flags.
Pagelist has no filtering of non-exising pages. I will not implement default filtering in pagelist. The current approach is that the source of the pages does the filtering. In this case it means that the authorstats should do the filtering. Also I do not understand why you would remove deleted pages from these list. I guess that with such filtering the list shown if you click on one of the Deletes
fields in the authorstats table will be almost empty?
Alternatively, an extra flag could be introduced for the pagelist plugin for filtering (I have not the intention to do so). However, I wonder if it is really useful?
@zeerd thanks for your first proposal and input!
You are welcome!
The point of deleted
pages is right. I had ignored it.
Replaces #152
sortby=<column>
enables sorting and set which column, for example:id
,date
,desc
,user
,desc
,comments
,linkbacks
,tags
, etc)title
,exists
,draft
,priority
,file
,section
, and other entries you actually filled in theaddPage([..])
array.)sort
without sortby will sort with pageidid
column,nosort
disables(depends on order of flags, it might be overruled by the sortby)rsort
reverses the sorting.Sorting of non-existing pages might be annoying, these have a key that might sort higher than a lot of other keys. Now chosen to use a high number such that these are at least grouped.