[Pmwiki-users] Show image whose URI doesn't end in e.g. 'jpg'

Hochstrasser Benedikt bhoc
Tue Aug 31 05:59:39 CDT 2004


Christian Ridderstr?m wrote:

>>>
Q: How can I insert an image into a wiki page, when the URI of the image
   doesn't end int '.jpg', '.gif' etc? For example, the URI might look 
   like this:
	http://www.motorfreaks.nl/fsget.php?id=4235

The "hack" I came up with was to append '.jpg' to the URI. In order to 
make this work in practice I had to add it as '&.jpg'. Not a very nice 
solution IMO. Are there any other methods? Or is this a motivation for 
having a separate [:image:]-directive?
<<<

I added to following to my config.php:

# inline replacement for an external page counter ("[!someimage!]")
$InlineReplacements['/\\[\\!(.*?)\\!\\]/'] = 
                 "<img src='\$1' alt='external image' />";

Unfortunately, this doesn't work any more with external links (with leading http://) (I thought I had it working in 0.9x but never used it since...)

-- 
Ben



More information about the pmwiki-users mailing list