Open attached images in popup window
#1
This is a really simple template edit. When you click on an attached images, it opens in a popup window.

Open template postbit_attachments_thumbnails_thumbnail.

Find:
<a href="attachment.php?aid={$attachment['aid']}" target="_blank">

Replace with:
<a href="attachment.php?aid={$attachment['aid']}" target="_blank" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/attachment.php?aid={$attachment['aid']}', 'attachment', 800, 600); return false;">

You can adjust the width (800) and height (600) to your needs. Users without Javascript enabled will use the default open method (new window/tab) instead.

Demo: http://phurl.de/p2627 (short URL based on this tutorial: http://community.mybb.com/thread-85532.html Wink)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)