[pmwiki-users] icons for attached files?

marc gmane at auxbuss.com
Mon Nov 6 07:24:33 CST 2006


Anno said...
> Something like this:
> 
> Markup('attachicon', 'inline',
>   '/Attach:(.*?)\\.(\\w{1,4})/',
> 'http://www.server.com/pub/icons/$2.png Attach:$1.$2');
> 
> Replace http://www.server.com/pub/icons with the link to your pub/icons 
> directory
> 
> Get your icons from here:
> http://www.stylegala.com/features/bulletmadness/
> 
> Rename them to be named like this:
> pdf.png
> xls.png
> doc.png
> .....
> and place them in the icons directory.

Nice one, Anno.

Rather than embedding the whole URL, you could use:

Markup('attachicon', 'inline',
  '/AttachIcon:(.*?)\\.(\\w{1,4})/',
"$FarmPubDirUrl/icons/$2.png Attach:$1.$2");

I also changed the markup, so that Attach is retained. Thus:

  AttachIcon:somedoc.pdf

(I think the regex can be simplified a bit:
  '/AttachIcon:(.+)\\.(\\w{1,})/',
 but I'm no regex guru.)

-- 
Best,
Marc





More information about the pmwiki-users mailing list