Author |
Message |
mrix
Client
![](modules/Forums/images/avatars/blank.gif)
Joined: Dec 04, 2004
Posts: 757
|
Posted:
Wed Oct 14, 2009 9:19 am |
|
Hello not sure if I am using the correct forum here but as I am using 2.4 thought it was the best place.
Basically I was wondering if anyone knows of a Image re-size mod for the forums to stop members posting huge pictures etc that's compatible with 2.4.
I have tried one but didn't get any joy
Thanks for any help all
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
nuken
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/3234de284ee21bd39eecd.jpg)
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Wed Oct 14, 2009 10:09 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 14, 2009 10:11 am |
|
Many thanks looks interesting.
Cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 17, 2009 6:38 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Sat Oct 17, 2009 11:01 am |
|
I just looked at that topic, it isn't actually very efficient as it basically looks like it is re-writing the whole page and although it limits the physical size of the image displayed, you could still have some very large image file sizes wasting bandwidth. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
eldorado
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/52f4453749f5c4a233463.gif)
Joined: Sep 10, 2008
Posts: 424
Location: France,Translator
|
Posted:
Sat Oct 17, 2009 3:43 pm |
|
Guardian2003 wrote: | I just looked at that topic, it isn't actually very efficient as it basically looks like it is re-writing the whole page and although it limits the physical size of the image displayed, you could still have some very large image file sizes wasting bandwidth. |
Ah but actually the purpose was to actually resize the image on the board and make it larger when you click on it
hence my mod using php and not javascript
Code:# Original image replacement code, commented so it does not execute
# $patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i";
# $replacements[] = $bbcode_tpl['img'];
$ims='400';//Change image max size
$pattern1 = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i";
preg_match_all($pattern1, $text, $imageURL);
foreach ($imageURL[1] as $key => $val){
if ($val){
$imageSize = getimagesize($val);
if ($imageSize[0] > $ims){$imageWidth = $ims; $imageHeight = $imageSize[1] * ($ims / $imageSize[0]);}
else {$imageWidth = $imageSize[0]; $imageHeight = $imageSize[1];}
$pattern1 = "#\[img:$uid\]($val)\[/img:$uid\]#i";
$replacement1 = "<a href=\"$val\"><img src=\"$val\" height=\"$imageHeight\" width=\"$imageWidth\" border=\"0\" /></a>";
$text = preg_replace($pattern1, $replacement1, $text);
}
}
|
you could actually use the gd library and resize it , but that would take a longer time wouldn't it? |
_________________ Only registered users can see links on this board! Get registered or login! (My RN site)- Only registered users can see links on this board! Get registered or login!(cod4 clan) - Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 17, 2009 4:39 pm |
|
@ eldorado - I was refering to the other topic which mrix linked to. That topic clearly uses JS window.onload
I thought there were plenty of Forum mods about that limit both file size and physical dimensions but maybe my memory isn't what it used to be. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Oct 17, 2009 5:15 pm |
|
I looked high and low and mods that I did find seemed old and out dated.
If anyone knows of such a mod that is better please reply to this topic
Cheers and thanks all
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
eldorado
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Oct 18, 2009 2:52 pm |
|
Guardian2003 wrote: | but maybe my memory isn't what it used to be. |
:p nevermind , at least I copied and paste the php code above.
gardian , I suggested using the GD library if the image is located on the website.
But since 99% of user posted images are located elsewhere , it wouldn't be a waste of bandwidth. ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
dad7732
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Mar 18, 2007
Posts: 1242
|
Posted:
Mon May 30, 2011 1:50 pm |
|
Just found this thread and fix and it works like a charm ..
However, when the smaller adjusted image is clicked on it not only shows the larger original image in a separate window, it also brings up the link where it originated, ie;, Photobucket.com, flicker and so on. Is there a way to mod this so that only the original image comes up rather than the link as well?
In fact if I could eliminate viewing the original image that would work.
Thanks |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon May 30, 2011 2:04 pm |
|
@ dad7732 - the only practical solution for that is to cache the images locally on the server but then your back to use using your own bandwidth, unless you could possibly use an on click event or something to run to fire whatever function is written to grab the file and then cache it locally. In theory you could then browser images to the remote site but only store them when they are clicked on.
HTML5 should actually make this a bit easier as it allows the website to store images directly in the browser cache and they could be manipulated from there directly within the browser so in theory the image 'originates' from the browser cache. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|