[pmwiki-users] 2.0.beta28 released w/improvements for attachments

Sebastian Siedentopf schlaefer at macnews.de
Fri Aug 12 07:04:57 CDT 2005


Am 08.04.2005 um 03:13 schrieb Patrick R. Michaud:


> On Thu, Apr 07, 2005 at 06:10:14PM +0200, Knut Alboldt wrote:
>
>
>> Patrick, sorry I didn't got that. My problem:
>>
>> The attachlist-directory (=uploaddirectory) is defined per group (by
>> default), e.g:
>>
>> SDV($UploadDir,'uploads');
>> SDV($UploadPrefixFmt,'/$Group');
>> SDV($UploadFileFmt,"$UploadDir$UploadPrefixFmt");
>>
>> => ./uploads/MyGroup
>>
>> when I create a page "MyGroup.MyPage" how does the attachment-markups
>> know which file belongs to that page ?
>>
>>
>
> ummm, it doesn't.  If you have per-group attachments, then all
> of the attachments in the group "belong" to all of the pages in the
> group.
>

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.

Sebastian







More information about the pmwiki-users mailing list