[pmwiki-users] Amending ctime from Within PmWiki

Ian Barton lists at manor-farm.org
Tue Jul 18 03:27:44 CDT 2006


Ian Barton wrote:
> Patrick R. Michaud wrote:
>> On Mon, Jul 17, 2006 at 08:05:55PM +0100, Ian Barton wrote:
>>>>> Is there a way from within PmWiki to amend the ctime of a page? I am 
>>>>> using newpagebox plus to create the page, so I guess a I need to create 
>>>>> a function within it to update the ctime to the reflect the date 
>>>>> specified by the page name. Any ideas or pointers appreciated.
>>>>>
>>>> Now I have looked at the source for NewPageBoxPlus it seems to be 
>>>> straightforward to do what I need.
>>>>
>>> I seem to have hit a problem. If I amend the following in 
>>> newpageboxplus.php by hard coding in a ctime:
>>>
>>>            if ($p['text'] > '') $new['text'] = $p['text'];
>>>            $new['author'] = $Author;
>>>
>>> 	  # Should be 21 July 2006
>>>            $new['ctime'] = 1153436400;
>>>
>>>            #$new['ctime'] = $Now;
>>>            }
>>>          SaveAttributes($newpage, $new, $new);
>>>          PostPage($newpage, $new, $new);
>>>          PostRecentChanges($newpage, $new, $new);
>>>          Redirect($newpage);
>>>         }
>>>
>>> The page is always created with a ctime of $Now. I assume that PmWiki is 
>>> overwriting the ctime set in the script. 
>> PmWiki *never* overwrites the ctime, so that's not the issue.  
>>
>>> Any ideas of how I can modify this behaviour?
>> The problem must be somewhere else (although at this moment
>> I'm not sure where).
>>
>> Pm
> 
> Thanks Patrick. I have now found the problem, but not the solution:) I 
> was using a template with NewPageBoxPlus. If I don't use a template, I 
> can set the ctime OK. I would guess that if I use a template the page 
> already has a ctime, so PmWiki won't update it. Is there any way to 
> modify this behaviour?
> 

Having just changed the page back again to use a template with 
newpageboxplus, it now seems to be working correctly. Not sure what was 
happening before, unless there was some weird and wonderful interaction 
with my Squid proxy.

Anyway, when I have finished I'll post my changes to newpageboxplus on 
the Wiki.

Ian.

Ian.





More information about the pmwiki-users mailing list