Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Replace large images in posts with links to the images Details »
Replace large images in posts with links to the images
Mod Version: 1.2, by buro9 (Member) buro9 is offline
Developer Last Online: Jul 2012 I like it Show Printable Version Email this Page

This thread is in the Modification Graveyard.
vB Version: 3.5.2 Rating: (0 vote - 0 average) Installs: 13
Released: 31 Oct 2005 Last Update: 01 Nov 2005 Downloads: 17
Not Supported Code Changes Additional Files  

No longer supported by the author.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Add-On Releases Forbid Users from Posting Links or Images if They Have Fewer than 15 Posts lisss001 vBulletin 3.7 Add-ons 128 19 Nov 2011 18:00
Forbid Users from Posting Links or Images if They Have Fewer than 15 Posts amykhar vBulletin 3.5 Add-ons 232 12 May 2011 15:18

Comments
  #2  
Old 31 Oct 2005, 19:27
buro9 buro9 is offline
 
Join Date: Feb 2002
First post reserved for notes, etc as I know some of you surf with the hacks collapsed.
Reply With Quote
  #3  
Old 31 Oct 2005, 19:42
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Real name: Josh
Excellent! Thanks for the hack!
Reply With Quote
  #4  
Old 31 Oct 2005, 21:13
buro9 buro9 is offline
 
Join Date: Feb 2002
Has vb.org got something weird in it that turns double spaces into tabs? My beautifully indented code comes out all strange.
Reply With Quote
  #5  
Old 31 Oct 2005, 23:16
Jenta Jenta is offline
 
Join Date: Dec 2004
Not sure but if you put the intructions in a txt file and zip up both the instructions and the php file, it will aleviate that.

Will also make it easier for end users as they now have a neatly packaged hack stored locally.
Reply With Quote
  #6  
Old 31 Oct 2005, 23:43
colicab-d's Avatar
colicab-d colicab-d is offline
 
Join Date: Dec 2002
Real name: Dave
One question what about un-registered users? Do they see the link or a large image?
Reply With Quote
  #7  
Old 01 Nov 2005, 04:24
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Real name: Jack
the JACKPOT hack will be when someone makes a "resize if >500px hack" or something


good try tho.
Reply With Quote
  #8  
Old 01 Nov 2005, 05:23
buro9 buro9 is offline
 
Join Date: Feb 2002
Originally Posted by colicab-d
One question what about un-registered users? Do they see the link or a large image?
They see whatever the post contains at that time.

The JavaScript will fire, but the script web service that I have that services that JavaScript won't change the post when a guest calls it.

I should note that in nearly all cases this means they see the link... because the moment a post is posted the author is returned to it, and it is they that trigger the conversion from [url] to [img]. So anyone who manages to see the post is usually just going to see a link. The exception to the above are historical posts, which require a registered user to go view for the conversion to occur.
Reply With Quote
  #9  
Old 01 Nov 2005, 05:27
buro9 buro9 is offline
 
Join Date: Feb 2002
Originally Posted by COBRAws
the JACKPOT hack will be when someone makes a "resize if >500px hack" or something


good try tho.
From your perspective maybe. But from mine the jackpot hack stops the vast majority of users from downloading a 1.7mb 2000px wide image that some doofus put in a post.

Yes CSS and HTML can be written to re-format the size, create scroll bars on it or resize the image dimensions in JavaScript. However every user still ends up having to download that 1.7mb image for the CSS and/JavaScript to resize it.

My idea of a jackpot hack for oversized images is to not have those users download the images in the first place. Of giving them the choice to download it. And as a result retain the perception that my forum is fast.

This means converting inline images to links, which my hack does.

So I guess whether you like this hack or not depends on point of view, whether you agree with my design decision that not having users download large images unawares is important, or whether you feel that the layout of the page is more important than the download experience for users.
Reply With Quote
  #10  
Old 01 Nov 2005, 05:29
buro9 buro9 is offline
 
Join Date: Feb 2002
Originally Posted by Jenta
Not sure but if you put the intructions in a txt file and zip up both the instructions and the php file, it will aleviate that.

Will also make it easier for end users as they now have a neatly packaged hack stored locally.
Yeah, I'll do that now
Reply With Quote
  #11  
Old 01 Nov 2005, 05:45
buro9 buro9 is offline
 
Join Date: Feb 2002
Screenshots for those who need such things now attached.

I've used this image as an example:
http://miam-miam.viabloga.com/images...ufs%20durs.jpg

Because it's 1024 pixels wide, it gets replaced by a link after the first view.
Reply With Quote
  #12  
Old 01 Nov 2005, 06:09
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Would be great if it does what promiced I've editted an already placed oversized image that whas reduced with the 3.xx BIMG tags but it did not turn into a link. Maybe it will only work with new posted images.
Reply With Quote
  #13  
Old 01 Nov 2005, 06:18
buro9 buro9 is offline
 
Join Date: Feb 2002
Originally Posted by NuclioN
Would be great if it does what promiced I've editted an already placed oversized image that whas reduced with the 3.xx BIMG tags but it did not turn into a link. Maybe it will only work with new posted images.
It should work with all [img] tags providing that they are [img]url[/img] or [IMG]url[/IMG].

The only thing it won't work with is pure HTML. But no-one allows users to post HTML because of security risks, right?

Anyhow, so long as you have a DOM capable browser that supports XmlHttp and either element.parentElement (IE6) or element.parentNode (Mozilla and the others, this is the W3C implementation)... then it will call the script.

Oh, but if you have edited your templates from the vb default and nuked the following from the postbit templates, then you will prevent the hack from working:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That's where I get the postId from... by walking up the DOM back to that DIV.
Reply With Quote
  #14  
Old 01 Nov 2005, 06:19
buro9 buro9 is offline
 
Join Date: Feb 2002
And if you're sure it's not working, just say and I'll add some trace/debug stuff to it so that you can optionally see it working before you switch it to run silently.
Reply With Quote
  #15  
Old 01 Nov 2005, 06:24
buro9 buro9 is offline
 
Join Date: Feb 2002
Originally Posted by NuclioN
Would be great if it does what promiced I've editted an already placed oversized image that whas reduced with the 3.xx BIMG tags but it did not turn into a link. Maybe it will only work with new posted images.
I think I read that wrong too.

With the hack installed you don't need to edit anything

You just view them.

Order of events:
  1. Registered user views a thread
  2. Thread contains large images in the post body
  3. Image gets detected by the JavaScript
  4. JavaScript SILENTLY calls the trimOversizedImages.php file
  5. The php file checks that the postId supplied is cool, and then converts the [img] bbcode to [url] bbcode
That user, still saw the image and wasn't even aware that he just caused the large image to be converted on the server. However the next refresh of that page goes like this:
  1. User views a thread
That's it Because the large image was converted to a link, so none of the above repeats itself.

So you don't need to edit anything. Just CTRL+F5 to ensure your browser has the latest version of vbulletin_global.js, and then view the thread. Once viewed, click CTRL+F5 again to refresh the page and the image should be gone.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 14:55.

Layout Options | Width: Wide Color: