[pmwiki-users] problem with ParseArgs() - WAS 2.0.beta28 released w/improvements for attachments
Sebastian Siedentopf
schlaefer at macnews.de
Sat Aug 13 06:19:02 CDT 2005
Am 12.08.2005 um 14:04 schrieb Sebastian Siedentopf:
>
> To show only the attachments used on a page I want to change the
> FmtUploadList in upload.php:
>
> ...
> if (@$opt['page']) {
> $page=ReadPage($opt['page']);
> preg_match_all("/(?<!\[@|\[=)Attach:([-\w.]*\.\w{3})/",
> $page['text'],$sideattachments,PREG_PATTERN_ORDER);
> }
> ...
> while (($file=readdir($dirp)) !== false) {
> ...
> if ($sideattachments && !in_array($file,$sideattachments[1]))
> continue;
> ...
> }
>
> So on Site/UploadQuickReference the following markup is used:
>
> (:attachlist page={$FullName}:)
>
> My problem is that $opt['page'] holds the correct pagename, but for
> unknown reasons I can not perform any operation on the value.
>
If I do
$opt = ParseArgs($args);
$temp = preg_split('/[\\/.]/', $opt['page']);
and
(:attachlist page=Main.PmWiki:) then preg_split returns
"Main.PmWiki"
(:attachlist page=Main.Pmwiki:) then preg_split returns "Main"
(:attachlist page=Main.pmWiki:) then preg_split returns "Main"
As long there is no second cap in the pagename it works. Why is the
second cap important?
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20050813/957ce9ba/attachment.html
More information about the pmwiki-users
mailing list