Previous Thread
Next Thread
Print Thread
Rate Thread
#154214 06/23/2002 11:28 PM
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
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.

Sponsored Links
Joined: Feb 2002
Posts: 76
Member
Member
Offline
Joined: Feb 2002
Posts: 76
Sounds cool... will try later smile

Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394

Joined: Feb 2000
Posts: 59
Member
Member
Offline
Joined: Feb 2000
Posts: 59
Sounds great! Trying now (from another gaming site UBB user) smile

Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
In the second part, you should add BELOW, not replace. You accidently replaced sub imageize with sub thumbize

Sponsored Links
Joined: May 2001
Posts: 6,708
Member
Member
Offline
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. tipsy wink

Joined: Feb 2000
Posts: 59
Member
Member
Offline
Joined: Feb 2000
Posts: 59
Doesn't work at all on my 6.3.0 board. frown

Joined: Feb 2000
Posts: 59
Member
Member
Offline
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
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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
Offline
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:

Sponsored Links
Joined: Dec 2000
Posts: 371
Member
Member
Offline
Joined: Dec 2000
Posts: 371
Very usefull XperT! smile

Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
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
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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
Offline
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
Offline
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
Offline
Joined: Feb 2000
Posts: 4,625
Nice work. smile

Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
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)

Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
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
Offline
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
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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 tipsy )

Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
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 wink


- Allen wavey
- What Drives You?
Joined: Jun 2002
Posts: 16
Junior Member
Junior Member
Offline
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
Offline
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
Offline
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
Offline
Joined: Jun 2001
Posts: 2,849
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.

Joined: Dec 2000
Posts: 151
Member
Member
Offline
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
Offline
Joined: Sep 2002
Posts: 16
Very nice laugh - working with 6.3.1.1

bobbel

Joined: May 2001
Posts: 50
Member
Member
Offline
Joined: May 2001
Posts: 50
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

Joined: May 2001
Posts: 50
Member
Member
Offline
Joined: May 2001
Posts: 50
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

Joined: Sep 2002
Posts: 16
Junior Member
Junior Member
Offline
Joined: Sep 2002
Posts: 16
Thanks, Fahd, now it's perfect *lol*
A button feature would be nice, too wink

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 smile Anyone put more thought to that?


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)