Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: gevv on June 16, 2012, 01:53:33 PM

Title: [Tip/Trick] Resize image alert and click resized image open new window
Post by: gevv on June 16, 2012, 01:53:33 PM
smf default image resizer system useful features

1: resize alert
2: add click this image to open new window


find Sources/subs.php (line 1267)

'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',



replace;

'content' => '<table id="ncode_imageresizer_warning_1" class="ncode_imageresizer_warning" width="500"><tbody><tr><td class="td1" width="20"><img alt="resized" src="http://media.simplemachinesweb.com/smf/default/images/split_select.gif" width="17" border="0" height="17"></td><td class="td2">This image has been resized. Click this image to view the full image.</td></tr></tbody></table><a href="$1" target="_blank"><img src="$1" alt="{alt}"{width}{height} class="bbc_img " /></a>',


add code  theme index.css

table.ncode_imageresizer_warning, table.ncode_imageresizer_warning td
{
background-color: #fefee1; /* the bgcolor behind the text and image */
}
table.ncode_imageresizer_warning {
color: #000000; /* the font color */
border: 1px solid #CCCDCD; /* the border around the whole thing */

cursor: pointer;
}
table.ncode_imageresizer_warning td {
font-size: 10px;
vertical-align: middle;
text-decoration: none;
}

table.ncode_imageresizer_warning td.td1 {
padding: 5px;
}


Note:   

change icon url (http://media.simplemachinesweb.com/smf/default/images/split_select.gif)

(http://s16.postimage.org/512r0eqdh/Untitled_6.png) (http://postimage.org/)






To set the size of  table width (width="500")

(http://s7.postimage.org/42945otpj/Untitled_7.jpg) (http://postimage.org/image/42945otpj/)







before

(http://s18.postimage.org/a5ub7f7p5/before_noalert.png) (http://postimage.org/)
hosting images (http://postimage.org/)

after

(http://s16.postimage.org/blerrq7ph/after_resize_alert.png) (http://postimage.org/)
upload pictures (http://postimage.org/)
Title: Re: [Tip/Trick] Resize image alert and click resized image open new window
Post by: Imutep on July 08, 2012, 04:25:55 AM
Hi, thx for this snippet. Works perfect. :)
Is it possible to open the full image on the parent side. Like vb?