Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: riker - helmikuu 15, 2009, 05:30:33 AP

Otsikko: Click-able Attachment Image ?
Kirjoitti: riker - helmikuu 15, 2009, 05:30:33 AP
Does anyone know how to make it pop-up on a separate window/tab with a viewable attachment image displayed like here.  I've tried it but can only get a clickable to work with an attachment link with no image. 
Otsikko: Re: Click-able Attachment Image ?
Kirjoitti: riker - helmikuu 19, 2009, 05:35:49 AP
Guess it's something they only added to this forum
Otsikko: Re: Click-able Attachment Image ?
Kirjoitti: moonjo - helmikuu 19, 2009, 10:05:33 AP
I use this and it works for me (2.0b4 and 2.0rc1)
Look for this line in Themes/default/Display.template.php

<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';


Replace that with this:

<a href="#" onclick="reqWin(\'', $attachment['href'], ';image\', ', $attachment['real_width'], ', ', $attachment['real_height'], ', true);" ><img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /></a><br />';

Otsikko: Re: Click-able Attachment Image ?
Kirjoitti: Rumbaar - maaliskuu 10, 2009, 06:06:22 AP
It works on here if the size of the image is too large for the set maximum display.  You should get the same result on your forum for the same settings.  If you've not defined a maximum image size it will try to render inline.