UBB.Dev
Posted By: RandyM [6.3.x] [beta] The Thumb hack - 06/24/2002 6:28 AM
This adds a new ubb code (thumb). When a users posts an image with the thumb tag it is display with a fixed width of 400 pixels (you can change the code to have any width). When you click on the image it opens the original fullsize in a new window.

This DOES NOT reduce the size of the image, you are still downloading the whole pic. It does however ensure that people can't use IMG to post 1600x1200 images that stretch the topic page and look really ugly. This is great for gaming sites that have a lot of screenies.

I also added the reverse code so that it is quotable and editable (it broke if HTML is turned off before that).

demo: Click here

Download: Click here

Please report any bugs in this thread, and if anyone determines that has security issues please point them out.
Posted By: Josh Chapman Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 6:31 AM
Sounds cool... will try later smile
Posted By: LK Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 8:45 AM
You can use $orig instead of $2 in . tipsy

Also, add alt="Click to expand" or something like that in the , to make it XHTML compatible.
Sounds great! Trying now (from another gaming site UBB user) smile
Posted By: LK Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 9:10 AM
In the second part, you should add BELOW, not replace. You accidently replaced sub imageize with sub thumbize
Posted By: Lord Dexter Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 9:13 AM
Alot shorter then I thought this hack would be.

I will install it when you add LK's very helpful annual suggestions. tipsy wink
Posted By: Galactus Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 9:16 AM
Doesn't work at all on my 6.3.0 board. frown
Posted By: Galactus Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 9:23 AM
LK, you responded quick! I found out my mistake and corrected it, but with corrections, nothing happens and the full image displays.
Posted By: LK Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 10:12 AM
Did you use [thumb]URL[/thumb] or [img] URL [/img]? Use thumb.

Just a notice, it loads the full image, just DISPLAYS it smaller. I would suggest to get the image, make it 50% of its size (or [thumb=w,h]), and save it in that size. I dunno how to do it, but I'm sure it's possible. Oh, and then it would also upload the small image to your server - loads faster.
Posted By: Galactus Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 11:16 AM
DUH! TOTALLY overlooked the part of the description that said it adds a new UBB code "thumb". I thought the full image was automatically loaded at the restricted width size in the [img] tags. :rolleyes:
Posted By: Variables Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 1:06 PM
Very usefull XperT! smile
Posted By: RandyM Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 3:48 PM
quote:
Originally posted by LK:
In the second part, you should add BELOW, not replace. You accidently replaced sub imageize with sub thumbize

I added your other suggestions, thanks....I don't see what you mean by this one though. I had "add after" but I changed it to "below" so it would be more clear.
Posted By: LK Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 4:33 PM
It was a reply to Galactus' post (before he edited it)
Posted By: RandyM Re: [6.3.x] [beta] The Thumb hack - 06/24/2002 4:50 PM
Hahaha, sorry about that. I'm glad to see that it works and that it's safe. I like your idea about reducing the file size. I'm working on getting a real thumbnailer to work on the server.
Posted By: RandyM Re: [6.3.x] [beta] The Thumb hack - 06/30/2002 6:03 PM
Oooops, added code to make it 6.3.0.1 compliant.
Posted By: Greg Hard Re: [6.3.x] [beta] The Thumb hack - 07/01/2002 2:13 AM
Nice work. smile
Posted By: LK Re: [6.3.x] [beta] The Thumb hack - 07/01/2002 8:37 AM
Suggestion: change the height as well tipsy width="400" height="300"

Also, maybe make it Mod CP Addon compatible, then let the admin choose the width/height?

Also, maybe add [thumb=640,480] or whatever, that lets the user choose the width/height? (but ofcourse make sure it's <=1024 and <=768, else make it 400x300 or whatever)
Posted By: RandyM Re: [6.3.x] [beta] The Thumb hack - 07/08/2002 3:05 AM
LK, if I set the height too then it messes with the proportions of the image. Having it Mod CP Addon compatible is a really good idea though...
Posted By: dbode Re: [6.3.x] [beta] The Thumb hack - 08/15/2002 10:57 AM
This seems to be cool - I´ll try it later because we are posting all our reviews in UBB and I would not have to cut the images any more - so it will be just GREAT if it works !
Posted By: LK Re: [6.3.x] [beta] The Thumb hack - 08/15/2002 10:59 AM
XPerT, but if you don't change the height and the user isn't using IE 6/whatever, then instead of 800x600 it will be 400x600 (and then it REALLY messes with the proportions of the image tipsy )
Posted By: RandyM Re: [6.3.x] [beta] The Thumb hack - 08/15/2002 2:30 PM
Crap, I hadn't thought of that.
Posted By: AllenAyres Re: [6.3.x] [beta] The Thumb hack - 08/15/2002 6:31 PM
I thought everyone was using IE6 wink
Posted By: M_30-john Re: [6.3.x] [beta] The Thumb hack - 08/16/2002 10:43 AM
Does the thumb hack replace the [img] tag?
I would very much like that.
If the thumbs hack adds an additional code [i.e. thumb] might it be posible to set the thumb function to be used when using the [img] tag?
Posted By: RandyM Re: [6.3.x] [beta] The Thumb hack - 08/16/2002 2:42 PM
The thumb hack is an additional code. Turbanator at Quake3world.com came up with it to allow people to post in-game screenshots without stretching out tables and breaking pages. You just need to educate the members on how to use it.
Posted By: M_30-john Re: [6.3.x] [beta] The Thumb hack - 08/16/2002 2:52 PM
I understand, but isn`t it possible to make it so the thumb hack replaces the img tag?
Posted By: RandyM Re: [6.3.x] [beta] The Thumb hack - 08/16/2002 3:02 PM
Quote
quote:
Originally posted by M_30-john:
I understand, but isn`t it possible to make it so the thumb hack replaces the img tag?
Edit, on second thought if you do that then smaller pics will be forced to that size...not a good thing.
Posted By: CaCoffin Re: [6.3.x] [beta] The Thumb hack - 09/06/2002 4:27 PM
Is it possible that percentages are used for the height and width?

It will keep the large pictures in proportion that way.
Posted By: bobbel Re: [6.3.x] [beta] The Thumb hack - 09/06/2002 7:34 PM
Very nice laugh - working with 6.3.1.1

bobbel
Posted By: Fahd Re: [6.3.x] [beta] The Thumb hack - 10/01/2002 11:52 PM
I have a slight problem with this hack frown It seems then whenever a user edits their post the UBB [thumb] code is convereted to the HTML equivilent. This means that after the user has edited their post they get the html code come up. It might be that I've missed something... but I've hacked it twice and both the same result...

Using version 6.3.1.1
Posted By: Fahd Re: [6.3.x] [beta] The Thumb hack - 10/03/2002 8:18 PM
Found the problem...

In the hackfile.txt when it says:

Quote
code:
Code
Below that add...

###########################

# thumb
$match++ if $_[0] =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target="_fullview"><img src=")(S+)(" width="400" /></a>)/[THUMB]$6[/THUMB]/isg;

Instead add this below:

code:
[qb]
Code
# thumb
$match++ if $_[0] =~ s/(<a href=")(http|https|ftp)(://)(S+)(" target="_fullview"><img src=")(S+)(" width="400" alt="Click for fullsize image" /></a>)/[THUMB]$6[/THUMB]/isg;
[/qb]
Just had to compare the HTML code when editing my post to the ubb_lib_posting.cgi file entry.

/me being idiot wink
Posted By: bobbel Re: [6.3.x] [beta] The Thumb hack - 10/04/2002 10:42 AM
Thanks, Fahd, now it's perfect *lol*
A button feature would be nice, too wink

bobbel
Posted By: AllenAyres Re: [6.3.x] [beta] The Thumb hack - 10/07/2002 5:56 AM
a button and perlmagic usage smile Anyone put more thought to that?
© UBB.Developers