[pmwiki-users] Rebuilding $SiteGroup.AllRecentChanges and/or $Group.RecentChanges

Petko Yotov 5ko at 5ko.fr
Fri Jan 12 09:48:41 CST 2018


On 11/01/2018 21:45, Robert Riebisch wrote:
>>> how do I rebuild *RecentChanges after, let's say, copying in pages 
>>> from
>>> another PmWiki installation?
>> 
>> It's more like a "log".  So you might have to copy it from another
>> system or backup and possibly even massage the data (for example if 
>> you
>> change the "logging" format and want everything uniform).
> 
> What I have in mind:
> 1) Loop through all the pages (per group),
> 2) Extract all author + csum + ctime (+ host) information per page,
> 3) Sort all entries by time to reconstruct the timeline.
>    (Not sure, but sorting entries in RAM could be problematic for large
> wiki. Dunno, if PHP cares.)
> 4) Write to *RecentChanges files.
> 
> Is there any such recipe?

There is no such recipe yet, but something similar can be achieved in 
real time, without writing it to RecentChanges, with a PageList:

Try in your WikiSandbox:

(:pagelist order=-time group=Main fmt=#rc:)

(:pagelist order=-time group=Main fmt=#rcode:)

(:if false:)
[[#rc]]
* [[{=$FullName}]] . . . {=$LastModified} by {=$LastModifiedBy}: 
{=$LastModifiedSummary}
[[#rcend]]

[[#rccode]]
  [=* [[=]{=$FullName}]] . . . {=$LastModified} by {=$LastModifiedBy}: 
{=$LastModifiedSummary}
[[#rccodeend]]
(:ifend:)

The second template #rccode will print the wiki code because the line is 
preceded with a space and the start-of-link part of the markup is 
escaped with the [=...=] PmWiki escape characters.

To list all pages in all groups, remove the "group=Main" part.

If you must write it to *RecentChanges, you may be able to copy the 
generated code, remove the initial white space on every line, and place 
it in the *RecentChanges page(s).

Read more at:
   http://www.pmwiki.org/wiki/PmWiki/PageLists
   http://www.pmwiki.org/wiki/PmWiki/PageListTemplates
   http://www.pmwiki.org/wiki/PmWiki/PageVariables

Petko



More information about the pmwiki-users mailing list