[pmwiki-users] detecting minor edit

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 13 08:53:51 CST 2007

On Tue, Feb 13, 2007 at 03:47:08PM +0100, sgp wrote:
> I've searched the list and found the following way to detect minor edit,
> in local/config.php line 2, I added 
> if(@$_POST['diffclass'] == 'minor') { ... ; }
> The trouble is that I never ever see anything inside the braces being
> executed. In dispair I even added {print 1/0;} to force an error but it
> never happens. What am I doing wrong?

I don't know -- the if line you give ought to work.  I just tested
it on pmwiki.org and it seems to work fine.

You might try adding a space between "if" and the opening paren, although
I don't think that's it.  Or, perhaps send a copy of your local/config.php
and we can look at it.

> Also, can I detect minor edits just for a group, like adding the above
> code - when it works - to a local/Group.php file? 

Yes, this works just fine.

> Ultimately I want
> to leave minor edits out of Group.RecentChanges.
> Recipe Cookbook/CustomRecentChanges:
> if (@$_POST['diffclass'] == 'minor') {
>      unset($RecentChangesFmt['$SiteGroup.AllRecentChanges']);
>      unset($RecentChangesFmt['$Group.RecentChanges']);
> }

Should work.  


More information about the pmwiki-users mailing list