<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>Am 12.08.2005 um 14:04 schrieb Sebastian Siedentopf:</DIV><BLOCKQUOTE type="cite"><DIV><BR></DIV><DIV>To show only the attachments used on a page I want to change the FmtUploadList in upload.php:</DIV><DIV><BR></DIV><DIV>...</DIV><DIV>if (@$opt['page']) {</DIV><DIV> $page=ReadPage($opt['page']);</DIV><DIV> preg_match_all("/(?<!\[@|\[=)Attach:([-\w.]*\.\w{3})/", $page['text'],$sideattachments,PREG_PATTERN_ORDER);</DIV><DIV> }</DIV><DIV>...</DIV><DIV>while (($file=readdir($dirp)) !== false) {</DIV><DIV> ...</DIV><DIV> if ($sideattachments && !in_array($file,$sideattachments[1])) continue;</DIV><DIV> ...</DIV><DIV> }</DIV><DIV><BR></DIV><DIV>So on Site/UploadQuickReference the following markup is used:</DIV><DIV><BR></DIV><DIV>(:attachlist page={$FullName}:)</DIV><DIV><BR></DIV><DIV>My problem is that $opt['page'] holds the correct pagename, but for unknown reasons I can not perform any operation on the value.</DIV><DIV><BR class="khtml-block-placeholder"></DIV></BLOCKQUOTE><BR></DIV><DIV>If I do</DIV><DIV> $opt = ParseArgs($args);</DIV><DIV> $temp = preg_split('/[\\/.]/', $opt['page']);</DIV><DIV>and </DIV><DIV> (:attachlist page=Main.PmWiki:) then preg_split returns "Main.PmWiki"</DIV><DIV> (:attachlist page=Main.Pmwiki:) then preg_split returns "Main"</DIV><DIV> (:attachlist page=Main.pmWiki:) then preg_split returns "Main"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>As long there is no second cap in the pagename it works. Why is the second cap important? </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Sebastian</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><FONT class="Apple-style-span" color="#0000DD"></FONT></DIV></BODY></HTML>