Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
New BB tag to do image thumbnails... Details »»
New BB tag to do image thumbnails...
Version: 1.00, by Zzed Zzed is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-26-2003 Last Update: Never Installs: 30
 
No support by the author.

This hack adds a new tag to your forums that will allow you to post images
in the form of a thumbnail.

The tag allows you to post pictures in the form of a thumbnail. Large images
can throw off the page, and the tag will scale the picture down to an 80x60
thumbnail preserving its original length and width ratio and turn it into a
hyperlink that you can click on and see the full image in a new browser window.
If the image being thumbnailed is smaller than 80x60, it will show up as is.

This tag is identical to the IMG tag. The new tag is THUMB

Tables affected: none
Templates affected: none
Files affected: admin/functions.php

Check out this link for a demo: http://www.ls1.com/forums/showthread...hreadid=276879

Note: This tag does not resize the actual picture. It just displays them at a smaller
scale. It will not help with bandwidth preservation.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 04-10-2003, 10:18 AM
qwertzu qwertzu is offline
 
Join Date: Sep 2002
Location: paris
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool
nice hack Zzed
thanks for that great one
i try it right now
Reply With Quote
  #63  
Old 04-10-2003, 10:49 AM
qwertzu qwertzu is offline
 
Join Date: Sep 2002
Location: paris
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i've got a little bug it works fine everywhere (post & signs)
exept for one member in his sign it displays only the link but if i put that pic in a post the thumb works :lick:
i'v find the solution by hosting on my server & renaming the pic
here is the original pic i have remove the % and change JPG in jpg http://membres.lycos.fr/seadoo1979/s...io%20sonny.JPG
do you think that's normal ??

and thanks again for this great hack
Reply With Quote
  #64  
Old 04-10-2003, 07:21 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

qwertzu, that only happens when getimagesize() can not determine the image height and width.

And thank you for your kind words.
Reply With Quote
  #65  
Old 04-11-2003, 08:06 PM
Katman's Avatar
Katman Katman is offline
 
Join Date: Oct 2002
Location: New Glarus, WI
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't get this to work! It still shows as the original image size. Is there something I'm missing or not doing right? vB 2.2.9

Example:
http://www.tlplanet.com/forums/showt...?threadid=2023
Reply With Quote
  #66  
Old 04-11-2003, 08:28 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 02:00 PM Katman said this in Post #64
I can't get this to work! It still shows as the original image size. Is there something I'm missing or not doing right? vB 2.2.9

Example:
http://www.tlplanet.com/forums/showt...1965#post21965
You are using the wrong tag. Instead of IMG you need to use THUMB.

I registered and posted a reply to your thread. Check it out.
Reply With Quote
  #67  
Old 04-11-2003, 08:31 PM
Katman's Avatar
Katman Katman is offline
 
Join Date: Oct 2002
Location: New Glarus, WI
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see that you made it work! Yes, I was using the [*img*] tag, that's the way I understood the hack to work. My mistake, sorry.

I guess my question now is, is there any way to make the IMG tag do this automatically?

Thanks for the help!
Reply With Quote
  #68  
Old 04-11-2003, 08:36 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In functions.php:
Look for:
PHP Code:
function bbcodeparse2($bbcode,$dohtml,$dobbimagecode,$dosmilies,$dobbcode)
// parses text for vB code, smilies and censoring

  
global $DB_site,$wordwrap,$allowdynimg$bbuserinfo;

  static 
$smilies,$bbcodes;
  global 
$regexcreated,$searcharray,$replacearray,$phpversionnum
Add the following directly below it:
Code:
$bbcode =  preg_replace("/img\]/i", "thumb]", $bbcode);
This will replace all your IMG tags with THUMB tags.
Reply With Quote
  #69  
Old 04-11-2003, 08:41 PM
Katman's Avatar
Katman Katman is offline
 
Join Date: Oct 2002
Location: New Glarus, WI
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do I have to add [ in front of the /img\] and thumb]? Because when I tried it as you have it I received an error.

Parse error: parse error in /home/tlplanet/www/html/forums/admin/functions.php on line 640

Fatal error: Call to undefined function: vbdate() in /home/tlplanet/www/html/forums/admin/sessions.php on line 400
Reply With Quote
  #70  
Old 04-11-2003, 09:03 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, I don't know why the PHP tag mutilated my preg_replace statement.

I have tried this on my board and it worked just fine.

Code:
$bbcode =  preg_replace("/img\]/i", "thumb]", $bbcode);
Reply With Quote
  #71  
Old 04-11-2003, 09:11 PM
Katman's Avatar
Katman Katman is offline
 
Join Date: Oct 2002
Location: New Glarus, WI
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know what it was but I tried it again and now it's working! Thank You! You are the master!

Now the only problem I can see is the images in the signatures, they're linked now, with a border, even after I changed border=1 to 0.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 02:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04595 seconds
  • Memory Usage 2,312KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete