[pmwiki-users] detecting minor edit
sgp
acs322000 at yahoo.com
Tue Feb 13 11:15:29 CST 2007
Patrick R. Michaud wrote:
> On Tue, Feb 13, 2007 at 05:51:32PM +0100, sgp wrote:
>> Patrick R. Michaud wrote:
>>
> Then edit a page, select "minor edit", and press "Preview".
> You should see "Minor edit" and possibly a couple of PHP warnings
> at the very top of the resulting page. (Note that by "very top"
> I mean "above the skin headers".)
>
> If you see that, then you know the code to detect minor edits
> is working. If you don't see it, then something else odd is
> happening.
That helped. I didn't know that I could select "minor edit" while previewing.
So, with the below code inside my local/News.php, when I preview a minor edit of News.Temp1 I see
"UUUUUUUU" on my screen.
if (@$_POST['diffclass'] == 'minor') {
print "UUUUUUUUUUUUUUUUUUUUUUUUUUU";
unset($RecentChangesFmt['$SiteGroup.AllRecentChanges']);
unset($RecentChangesFmt['$Group.RecentChanges']);
}
Should I also see it when saving a "minor edit"? Because I don't, and I don't think it gets executed
when saving, as opposed to previewing. My News.Feed page contains only this line:
(:pagelist group=News name=-News,-*SandBox*,-*SideBar*,-*RightBar* list=normal count=20 fmt=simple
order=-time:)
When I minor edit News.Temp1 then refresh News.Feed - I can see that News.Temp1 jumps on top of
the list, sure sign that the if-body in local/News.php wasn't executed.
More information about the pmwiki-users
mailing list