[pmwiki-users] AllMajorChanges functionality and clarification on how web feeds work

Markong markong at dismail.de
Sun May 11 09:37:40 PDT 2025


Hello list!

I'm having an hard time understanding how the generated web feeds work: 
what I'm trying to achieve is described here [1], in particular I'm 
trying to generate an rss/atom feed with all the major changes (wiki 
changes except minor edits).

The problem is that when I look at the Site.MajorChanges [2] page, I can 
see that correctly only major edits are listed, but if instead I try to 
generate a rss feed for that page e.g.: [3] the generated feed contains 
the major changes *and* also all the minor edits which I don't want to 
be added there !

I've reviewed quite thoroughly the web feeds doc. [4] and despite 
founding the page a bit convoluted, from what I understand [2] content 
structure represents a valid wikitrail like the companion standard [5] 
all changes page, yet its rss feed [3] contain extra entries.

The cookbook recipe starts with "Create group.MajorChanges pages and 
Site.AllMajorChanges to track all major changes.." which I think I have 
created (just inserted the URLs in the browser bar and saved the pages), 
is that enough to create those pages ?

What the cookbook page author means [1] with "If the page 
Site.AllMajorChanges is used as part of an RSS feed, the RSS feed will 
show all of the major changes made to a wiki." ?

Am I misunderstanding something or is there some more recent and easy 
ways to achieve what I'm trying to achieve ?

For reference, this is the relevant part of my local/config.php file 
with my additional mods:

> # Feeds format
> $FeedFmt['rss']['item']['link'] = '{$PageUrl}?when=$ItemISOTime';
> $FeedFmt['rss']['item']['description'] = '$LastModifiedSummary';
> $FeedFmt['rss']['item']['author'] = '$Author';
> $FeedFmt['atom']['item']['link'] =
>    "<link rel=\"alternate\" href=\"{\$PageUrl}?when=\$ItemISOTime\" />\n";
> $FeedFmt['atom']['item']['description'] = '$LastModifiedSummary';
>
> # Require Author Name
> $EnablePostAuthorRequired = 1;
>
> ## Require summary
> function RequireSummary($pagename, &$page, &$new) {
>     global $ChangeSummary, $MessagesFmt, $EnablePost;
>     if ($EnablePost && !$ChangeSummary) {
>         $MessagesFmt[] = "A summary is required.";
>         $EnablePost = 0;
>     }
> }
> array_unshift($EditFunctions, 'RequireSummary');
>
> # Add Major Changes, from: 
> https://www.pmwiki.org/wiki/Cookbook/MajorChanges
>
> # record every major change unless just different date/time
> if (@$_POST['diffclass'] != 'minor') {
>   $RecentChangesFmt['$SiteGroup.AllMajorChanges'] =
>     '* [[{$Group}.{$Name}]] . . . $[by] $AuthorLink: 
> [=$ChangeSummary=]  [$CurrentTime]';
>   $RecentChangesFmt['$Group.MajorChanges'] =
>     '* [[{$Group}/{$Name}]] . . . $[by] $AuthorLink: 
> [=$ChangeSummary=]  [$CurrentTime]';
> }
>
> if (@$_POST['diffclass'] == 'minor') {
>     unset($RecentChangesFmt['$SiteGroup.AllMajorChanges']);
>     unset($RecentChangesFmt['$Group.MajorChanges']);
> }
>
> # record uploads as major change
> if (@$_REQUEST['action'] == 'postupload') {
>   $RecentUploadsFmt['$SiteGroup.AllMajorChanges'] =
>     '* [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]]'
>     .' . . . $[by] $AuthorLink ($upsize) [$CurrentTime]';
>   $RecentUploadsFmt['$Group.MajorChanges'] =
>     '* [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]]'
>     .' . . . $[by] $AuthorLink ($upsize) [$CurrentTime]';
> }
>
> # add AllMajorChanges and MajorChanges to the normal pages Search 
> should ignore
> $SearchPatterns['normal']['recent'] = 
> '!\.(All)?(Recent|Major)(Changes|Uploads)$!';
>
> # END: Add Major Changes, from: 
> https://www.pmwiki.org/wiki/Cookbook/MajorChanges
>
> $pagename = ResolvePageName($pagename);
> $group = PageVar($pagename, '$Group');
> $name = PageVar($pagename, '$Name');
>
> # Prevent AllMajorChanges changes to be listed in AllRecentChanges,
> # see: https://www.pmwiki.org/wiki/Cookbook/CustomRecentChanges#omit
>
> if ($pagename == 'Site.AllMajorChanges') {
>   unset ($RecentChangesFmt['$SiteGroup.AllRecentChanges']);
> }


Thank you very much for any help.


[1] https://www.pmwiki.org/wiki/Cookbook/MajorChanges

[2] https://pre2005.altervista.org/wiki/Site/AllMajorChanges

[3] https://pre2005.altervista.org/wiki/Site/AllMajorChanges?action=rss

[4] https://www.pmwiki.org/wiki/PmWiki/WebFeeds

[5] https://pre2005.altervista.org/wiki/Site/AllRecentChanges

-- 
Markong

Pre2005 Internet Project: https://pre2005.altervista.org




More information about the pmwiki-users mailing list