Customizing SMF > SMF Coding Discussion

Open resized images in new window

<< < (3/4) > >>

Arantor:
Hrm. If it works, great. I just didn't remember seeing that in the code, but I tend to avoid the JS (there's enough in the other thousands upon thousands of lines to remember ;))

Yağız...:

--- Quote from: Arantor on April 04, 2010, 09:18:15 AM ---Hrm. If it works, great. I just didn't remember seeing that in the code, but I tend to avoid the JS (there's enough in the other thousands upon thousands of lines to remember ;))

--- End quote ---
Changelog says that they have added this on January:

--- Quote ---+ Allow toggling of full size versions of resized images. (theme.js)
--- End quote ---
:)

Arantor:
That'd be why; I've not had to go back through the code (nor turned it on in a forum) since before the new year came in... so I'd never have noticed it...

rfirevtre:
I did like Yağız suggested and it worked just like I wanted :)
Thanks for the quick response

Ashelia:

--- Quote from: Arantor on April 04, 2010, 08:45:46 AM ---It's in Sources/Subs-Post.php.

All you need to do is modify the bbcode generated which includes the new size.


--- Code: (find) ---$replaces[$matches[0][$match]] = '[img' . (!empty($desired_width) ? ' width=' . $desired_width : '') . (!empty($desired_height) ? ' height=' . $desired_height : '') . ']' . $matches[4][$match] . '[/img]';
--- End code ---


--- Code: (replace) ---$replaces[$matches[0][$match]] = '[url=' . $matches[4][$match] . '][img' . (!empty($desired_width) ? ' width=' . $desired_width : '') . (!empty($desired_height) ? ' height=' . $desired_height : '') . ']' . $matches[4][$match] . '[/img][/url]';
--- End code ---

This wraps the code inside a the URL bbcode to force it to open in a new window. Will only apply on newly posted images though.

--- End quote ---

Sorry for bumping an old thread.. but I just tried using this code, and it worked. My problem is that while images do open in new tabs when clicked, they still enlarge inside the post too.

Is there a way for it to only show the full image in a new tab, instead of inside the post?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version