|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
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.
|
|
|
|
Joined: Feb 2002
Posts: 76
Member
|
Member
Joined: Feb 2002
Posts: 76 |
Sounds cool... will try later 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
|
|
|
|
Joined: Feb 2000
Posts: 59
Member
|
Member
Joined: Feb 2000
Posts: 59 |
Sounds great! Trying now (from another gaming site UBB user) 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
In the second part, you should add BELOW, not replace. You accidently replaced sub imageize with sub thumbize
|
|
|
|
Joined: May 2001
Posts: 6,708
Member
|
Member
Joined: May 2001
Posts: 6,708 |
Alot shorter then I thought this hack would be. I will install it when you add LK's very helpful annual suggestions. 
|
|
|
|
Joined: Feb 2000
Posts: 59
Member
|
Member
Joined: Feb 2000
Posts: 59 |
Doesn't work at all on my 6.3.0 board. 
|
|
|
|
Joined: Feb 2000
Posts: 59
Member
|
Member
Joined: Feb 2000
Posts: 59 |
LK, you responded quick! I found out my mistake and corrected it, but with corrections, nothing happens and the full image displays.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
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.
|
|
|
|
Joined: Feb 2000
Posts: 59
Member
|
Member
Joined: Feb 2000
Posts: 59 |
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:
|
|
|
|
Joined: Dec 2000
Posts: 371
Member
|
Member
Joined: Dec 2000
Posts: 371 |
Very usefull XperT! 
|
|
|
|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
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.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
It was a reply to Galactus' post (before he edited it)
|
|
|
|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
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.
|
|
|
|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
Oooops, added code to make it 6.3.0.1 compliant.
|
|
|
|
Joined: Feb 2000
Posts: 4,625
Member
|
Member
Joined: Feb 2000
Posts: 4,625 |
Nice work. 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Suggestion: change the height as well  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)
|
|
|
|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
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...
|
|
|
|
Joined: May 2001
Posts: 180
Member
|
Member
Joined: May 2001
Posts: 180 |
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 !
Regards Dennis Bode ----------------------------- Webmaster of Hardwareluxx.com
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
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  )
|
|
|
|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
Crap, I hadn't thought of that.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
I thought everyone was using IE6 
|
|
|
|
Joined: Jun 2002
Posts: 16
Junior Member
|
Junior Member
Joined: Jun 2002
Posts: 16 |
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?
|
|
|
|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
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.
|
|
|
|
Joined: Jun 2002
Posts: 16
Junior Member
|
Junior Member
Joined: Jun 2002
Posts: 16 |
I understand, but isn`t it possible to make it so the thumb hack replaces the img tag?
|
|
|
|
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
|
Spotlight Winner
Joined: Jun 2001
Posts: 2,849 |
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.
|
|
|
|
Joined: Dec 2000
Posts: 151
Member
|
Member
Joined: Dec 2000
Posts: 151 |
Is it possible that percentages are used for the height and width?
It will keep the large pictures in proportion that way.
|
|
|
|
Joined: Sep 2002
Posts: 16
Junior Member
|
Junior Member
Joined: Sep 2002
Posts: 16 |
Very nice  - working with 6.3.1.1 bobbel
|
|
|
|
Joined: May 2001
Posts: 50
Member
|
Member
Joined: May 2001
Posts: 50 |
I have a slight problem with this hack  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
|
|
|
|
Joined: May 2001
Posts: 50
Member
|
Member
Joined: May 2001
Posts: 50 |
Found the problem... In the hackfile.txt when it says: 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]# 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 
|
|
|
|
Joined: Sep 2002
Posts: 16
Junior Member
|
Junior Member
Joined: Sep 2002
Posts: 16 |
Thanks, Fahd, now it's perfect *lol* A button feature would be nice, too bobbel
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
a button and perlmagic usage  Anyone put more thought to that?
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|