Where to find Attachment Pop-Up Code Page

Started by sanax, July 18, 2010, 01:59:48 PM

Previous topic - Next topic

sanax

I've been trying to locate the pop-up code page which contains the 'enlarged' image of the attachment in a post. I want to add a 'Print this Image' code so that if they 'click to enlarge' the print option will show in the pop-up...

Any ideas?

sanax


Kays

Have you tried looking in Display.template.php?

Knowing which version SMF might be helpful.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sanax

Quote from: Kays on July 21, 2010, 12:43:25 PM
Have you tried looking in Display.template.php?

Knowing which version SMF might be helpful.

Sorry... I have version 1.1.11

I looked in the Display.template.php but couldn't find the exact code. I thought it would be nice to have a 'Print' button in the pop-up...

TIA

Kays

In Display.template.php.


<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';


And $attachment['thumbnail']['javascript'] can be found in Display.php


// If the image is too large to show inline, make it a popup.
if (((!empty($modSettings['max_image_width']) && $attachmentData[$i]['real_width'] > $modSettings['max_image_width']) || (!empty($modSettings['max_image_height']) && $attachmentData[$i]['real_height'] > $modSettings['max_image_height'])))
$attachmentData[$i]['thumbnail']['javascript'] = "return reqWin('" . $attachmentData[$i]['href'] . ";image', " . ($attachment['width'] + 20) . ', ' . ($attachment['height'] + 20) . ', true);';
else
$attachmentData[$i]['thumbnail']['javascript'] = 'return expandThumb(' . $attachment['ID_ATTACH'] . ');';


I don't quite know how to add a print button to the popup though.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

sanax

Thank you, Kays... I saw that but wasn't sure. How will you add a small code into this code for a 'Print Button'?

Advertisement: