Thanks Hans, looking forward to using it. :)

Philippe

-----Original Message-----
From: pmwiki-users [mailto:[email protected]] 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,
 Hans                         
mailto:[email protected]
www.softflow.co.uk


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

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.  

-------------------------------------------------------------------------


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to