[pmwiki-users] attachtable for PHP 5.5 ?

Krait, Philippe Philippe.Krait at thalesgroup.com.au
Tue Dec 9 18:57:16 CST 2014

Thanks Hans, looking forward to using it. :)


-----Original Message-----
From: pmwiki-users [mailto:pmwiki-users-bounces at pmichaud.com] On Behalf Of Hans Bracker
Sent: Wednesday, 10 December 2014 11:54 AM
To: Petko Yotov
Cc: PmWiki Users
Subject: Re: [pmwiki-users] attachtable for PHP 5.5 ?

thank  you  so  much,  Petko, for the detailed tuition in use of those helper functions!

I got it working, and uploaded to pmwiki.org http://www.pmwiki.org/wiki/Cookbook/Attachtable

This is the rewritten section:

foreach( $ls as $pn ) {
        $pg = RetrieveAuthPage( $pn, 'read', FALSE, READPAGE_CURRENT );
        if ($pg) {
                $txt = PHSC( $pg['text'], ENT_NOQUOTES );
                ## preserved text
                $txt = preg_replace("/(\n[^\\S\n]*)?\\[([=@])(.*?)\\2\\]/s", " ", $txt);
                ## links to attachments  
                $txt = PPRA(    array('/\[\[[^\]]*?\bAttach:([^"\]\|]*)/'  
                                        => PCCF("return '[['.AttachtableCountUploadLinks('$pn','',\$m[1]);")), $txt); 
                ## raw attachments                               
                $txt = PPRA(    array("/\\bAttach:([^\\s$UrlExcludeChars]*[^\\s.,?!$UrlExcludeChars])/"         
                                        => PCCF("return AttachtableCountUploadLinks('$pn','',\$m[1]);")), $txt);                                

There was a note in the function:
## FIXME: these really ought to be cached Without  caching  whenever  action=upload  the  references are getting pulled  out of all the pages, which means usually all the pages of the wiki group, and each page is opened and read and the text processed.
But I would not know how to do the caching.
And sofar I have not found it greatly detrimental without caching.
Mostly  a  user  wants  to upload a file, and the Attach Table list is secondary.

Best regards,
mailto:design at softflow.co.uk

pmwiki-users mailing list
pmwiki-users at pmichaud.com

This message contains OPEN information that is not sensitive and can be freely accessed by people both inside and outside of the Thales Group

This email was classified by Krait, Philippe  on Wednesday, 10 December 2014 11:57:16 AM

DISCLAIMER: This e-mail transmission and any documents, files and 
previous e-mail messages attached to it are private and confidential.  
They may contain proprietary or copyright material or information that 
is subject to legal professional privilege.  They are for the use of 
the intended recipient only.  Any unauthorised viewing, use, disclosure, 
copying, alteration, storage or distribution of, or reliance on, this 
message is strictly prohibited.  No part may be reproduced, adapted or 
transmitted without the written permission of the owner.  If you have 
received this transmission in error, or are not an authorised recipient, 
please immediately notify the sender by return email, delete this 
message and all copies from your e-mail system, and destroy any printed 
copies.  Receipt by anyone other than the intended recipient should not 
be deemed a waiver of any privilege or protection.  Thales Australia 
does not warrant or represent that this e-mail or any documents, files 
and previous e-mail messages attached are error or virus free.  


More information about the pmwiki-users mailing list