Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
mrix
Client



Joined: Dec 04, 2004
Posts: 757

PostPosted: Wed Oct 14, 2009 9:19 am Reply with quote

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
Sad

Thanks for any help all

mrix
 
View user's profile Send private message Visit poster's website
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Wed Oct 14, 2009 10:09 am Reply with quote

Have you tried this mod. http://www.phpbb.com/mods/db/index.php?i=misc&mode=display&contrib_id=1645 It looks simple.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
mrix







PostPosted: Wed Oct 14, 2009 10:11 am Reply with quote

Many thanks looks interesting.
Cheers
mrix
 
mrix







PostPosted: Sat Oct 17, 2009 6:38 am Reply with quote

Managed to find something that works great in this topic..

http://www.ravenphpscripts.com/postp142261.html?highlight=#142261

Cheers
mrix
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sat Oct 17, 2009 11:01 am Reply with quote

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.
 
View user's profile Send private message Send e-mail
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Sat Oct 17, 2009 3:43 pm Reply with quote

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 Smile
hence my mod using php and not javascript Sad
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! 
View user's profile Send private message Visit poster's website MSN Messenger
Guardian2003







PostPosted: Sat Oct 17, 2009 4:39 pm Reply with quote

@ eldorado - I was refering to the other topic which mrix linked to. That topic clearly uses JS window.onload Smile
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.
 
mrix







PostPosted: Sat Oct 17, 2009 5:15 pm Reply with quote

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 Very Happy
Cheers and thanks all
mrix
 
eldorado







PostPosted: Sun Oct 18, 2009 2:52 pm Reply with quote

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
 
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Mon May 30, 2011 1:50 pm Reply with quote

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
 
View user's profile Send private message
Guardian2003







PostPosted: Mon May 30, 2011 2:04 pm Reply with quote

@ 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.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©