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
  #42  
Old 03-28-2003, 06:48 PM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is the line number in an unmodified functions.php for version 2.2.9.

It is the last few lines of bbcodeparse2() function.

Or if you search for the following line:

// ###################### Start phphighlite #######################

and scroll up about 6-7 lines you will get there.
Reply With Quote
  #43  
Old 03-29-2003, 12:08 AM
Pikok Pikok is offline
 
Join Date: Jul 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
03-27-03 at 10:09 PM colicab-d said this in Post #9
how would i saw replace the image code with this? or even better add a THUMB button beside the IMG one?
To add a button you would need to edit 3 things.. The "vbcode_buttons" template, and the two JavaScripts "vbcode.js" and "vbcode_language.js".


In the "vbcode_buttons" template add this where you want the button to appear:
Code:
<input type="button" class="bginput" value="THUMB" title="Insert Thumbnail" onclick="vbcode(this.form,'THUMB','http://')" onmouseover="stat('thumb')">
In the "vbcode.js" you would need to add this just after the code for the IMG tag:
Code:
// *******************************************************

function vbcode(theform,vbcode,prompttext) {
// insert [x]yyy[/x] style markup
	if ((normalmode(theform)) || (vbcode=="THUMB")) {
		inserttext = prompt(tag_prompt+"\n["+vbcode+"]xxx[/"+vbcode+"]",prompttext);
		if ((inserttext != null) && (inserttext != ""))
			theform.message.value += "["+vbcode+"]"+inserttext+"[/"+vbcode+"] ";
		}
	else {
		donotinsert = false;
		for (i = 0; i < tags.length; i++) {
			if (tags[i] == vbcode)
				donotinsert = true;
			}
		if (donotinsert)
			stat("already_open");
		else {
			theform.message.value += "["+vbcode+"]";
			arraypush(tags,vbcode);
			}
		}
	theform.message.focus();
}
In the "vbcode_language.js" you would need to add this just after the code for the "img_text":
Code:
thumb_text = "Insert a thumbnail into your message";
Reply With Quote
  #44  
Old 03-30-2003, 12:20 AM
Larry@IOG Larry@IOG is offline
 
Join Date: May 2002
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I go about just getting my IMG tag to auto thumb every image?

I have my attachments like that already

Thanks

Larry
Reply With Quote
  #45  
Old 04-01-2003, 12:47 PM
ivanmcp ivanmcp is offline
 
Join Date: Nov 2002
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, this is cool hack.

I presume that I can change size of a thumbnail to my own prefference. So, for example, I might want to set image width to 600 max (so not to loose table formating), and any image larger that that would be scaled down to 600 pixels width, with the option to display original image size when clicked on appropriate link.

If so, I will implement this hack immediately .

Oh yes, I got to use this smiley :banana: .


Ivan
Reply With Quote
  #46  
Old 04-06-2003, 04:07 PM
Rose's Avatar
Rose Rose is offline
 
Join Date: Nov 2001
Location: K-Town, Germany
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack. I'm using it very nicely in a gallery-type format.

Is there a way to cache the images after initial loading, by chance?

Anyway, great hack and very useful.
Reply With Quote
  #47  
Old 04-06-2003, 04:52 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great Pikok. What is the code to place a thumb button by the quick reply in showtread template?
Reply With Quote
  #48  
Old 04-06-2003, 08:49 PM
Classy Classy is offline
 
Join Date: Apr 2003
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you ... works in 2.3.0 also. Clicked install
Reply With Quote
  #49  
Old 04-06-2003, 10:08 PM
Classy Classy is offline
 
Join Date: Apr 2003
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there a way to make it so when your posting people have the option to click the bbcode? Just like they do for [img] or [code]?
Hope this makes sense. Thanks.
Reply With Quote
  #50  
Old 04-07-2003, 06:50 PM
Blindchild02's Avatar
Blindchild02 Blindchild02 is offline
 
Join Date: Apr 2002
Location: USA
Posts: 741
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yea, i also want that... like in the newthread, so your able to click a button, like the IMG button and HTML button

also.. a problem i have, is that not all the images work with [thumb] ... why is that? o_O
Reply With Quote
  #51  
Old 04-07-2003, 06:51 PM
Classy Classy is offline
 
Join Date: Apr 2003
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm thinkin it has to do with the code in functions.php .... not sure though
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 09:59 PM.


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.10318 seconds
  • Memory Usage 2,307KB
  • 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
  • (3)bbcode_code
  • (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