Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Ultimate Temperature BBCode Details »»
Ultimate Temperature BBCode
Version: 1.00, by orange gold orange gold is offline
Developer Last Online: Sep 2011 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.1.0 Rating:
Released: 12-29-2010 Last Update: Never Installs: 6
 
No support by the author.

This BBcode is so simple to use...
You enter a temperature in celsius, fahrenheit, kelvin, or rankine. And it will convert it to all 4 of thoose measurements.
Exmaple
If you entered 100.1234 for celsius this would be the final result:
[temp=c]100.1234[/temp] displays:
100.1234?C (212.22212?F / 373.2734K / 671.89212?Ra)

[temp=c]###[/temp] ~ Celsius
[temp=f]###[/temp] ~ Fahrenheit
[temp=k]###[/temp] ~ Kelvin
[temp=r]###[/temp] ~ Rankine

Here is the code:

Admin CP > BBCode > New:

Title:
Code:
Temperature Conversion
BBCode Tag Name:
Code:
temp
Replacement:
Code:
<script language="Javascript">

<!--

var option1 = "{option}";

if (option1 == "c" || option1 == "C") {
	
	text1a = "{param}?C (";
	var num2a = ((Math.round((({param}*1.8+32.00)*100)))/100);
	text2a = num2a.toString();
	text3a = "?F / ";
	var num4a = ((Math.round((({param}+273.15)*100)))/100);
	text4a = num4a.toString();
	text5a = "K / ";
	var num6a = ((Math.round((({param}*1.8+491.67)*100)))/100);
	text6a = num6a.toString();
	text7a = "?Ra)";
	document.write(text1a);
	document.write(text2a);
	document.write(text3a);
	document.write(text4a);
	document.write(text5a);
	document.write(text6a);
	document.write(text7a);
	
} else if (option1 == "f" || option1 == "F") {
	
	text1b = "{param}?F (";
	var num2b = ((Math.round(((({param}-32.00)*(5/9))*100)))/100);
	text2b = num2b.toString();
	text3b = "?C / ";
	var num4b = ((Math.round((((({param}-32.00)*(5/9))+273.15)*100)))/100);
	text4b = num4b.toString();
	text5b = "K / ";
	var num6b = ((Math.round((((({param}-32.00)*(5/9))*1.8+491.67)*100)))/100);
	text6b = num6b.toString();
	text7b = "?Ra)";
	document.write(text1b);
	document.write(text2b);
	document.write(text3b);
	document.write(text4b);
	document.write(text5b);
	document.write(text6b);
	document.write(text7b);
	
} else if (option1 == "k" || option1 == "K") {
	
	text1c = "{param}K (";
	var num2c = ((Math.round(((({param}-273.15)*1.8+491.67)*100)))/100);
	text2c = num2c.toString();
	text3c = "?Ra / ";
	var num4c = ((Math.round((({param}-273.15)*100)))/100);
	text4c = num4c.toString();
	text5c = "?C / ";
	var num6c = ((Math.round(((({param}-273.15)*1.8+32.00)*100)))/100);
	text6c = num6c.toString();
	text7c = "?F)";
	document.write(text1c);
	document.write(text2c);
	document.write(text3c);
	document.write(text4c);
	document.write(text5c);
	document.write(text6c);
	document.write(text7c);
	
} else if (option1 == "r" || option1 == "R" || option1 == "Ra" || option1 == "ra" || option1 == "RA" || option1 == "rA") {
	
	text1d = "{param}?Ra (";
	var num2d = ((Math.round((((({param}-491.67)*(5/9))+273.15)*100)))/100);
	text2d = num2d.toString();
	text3d = "K / ";
	var num4d = ((Math.round(((({param}-491.67)*(5/9))*100)))/100);
	text4d = num4d.toString();
	text5d = "?C / ";
	var num6d = ((Math.round((((({param}-491.67)*(5/9))*1.8+32.00)*100)))/100);
	text6d = num6d.toString();
	text7d = "?F)";
	document.write(text1d);
	document.write(text2d);
	document.write(text3d);
	document.write(text4d);
	document.write(text5d);
	document.write(text6d);
	document.write(text7d);
	
}

//-->

</script>
Example:
Code:
[temp=c]100[/temp]
Description:
Code:
Converts a given temperature in Celsius, Fahrenheit, Kelvin, and/or Rankine to the other units of measurement. 

Example (Celsius): 
The final outcome is formatted as:
a?C (b?F / cK / d?Ra)
so, [temp=c]100.1234[/temp] displays:
100.1234?C (212.22212?F / 373.2734K / 671.89212?Ra)
Use {Option}:
Code:
Yes.
Leave everything else the same... Enjoy!

Show Your Support

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

Comments
  #2  
Old 12-30-2010, 07:21 PM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

More useful / useless code. LOL

Thanks.

Installed
4.1 PL2

edit: This was actually better then I expected. It shows all the temps & does the math for you.
Reply With Quote
  #3  
Old 12-30-2010, 07:23 PM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just sit around bored all day trying to come up with pointless code that is still really neat hahaha
I had fun making this one!
Reply With Quote
  #4  
Old 12-30-2010, 07:28 PM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by orange gold View Post
I just sit around bored all day trying to come up with pointless code that is still really neat hahaha
I had fun making this one!
This one was better then I expected. Converts and reads out all the conversions for you. Nice.

Thought it only added the ?F or ?C symbols. Nope shows them all and does the math for you....

Example;

100?C (212?F / 373.15K / 671.67?Ra)


Edit: If you really want a challenge. Could you please make some mods or tweaks for vBulletin and its Blogs? You'd be surprised to learn that since the release of vBulletin 4 ... Only 1 Mod has been released.

Two most sought after Mods for blogs

1) The power to block individual members from leaving comments in an authors blog
https://vborg.vbsupport.ru/showthread.php?t=256199

2) Add a playlist (example, Mixpod.com) in their blog profile.
Reply With Quote
  #5  
Old 12-30-2010, 07:52 PM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I have no clue.. You would probably have to edit a php file somewhere int he blog directory. I don't mess with those though ahah.. Don't want to screw my forum.. :P
Reply With Quote
  #6  
Old 12-30-2010, 07:56 PM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Was worth a shot to get someone to look into it.

I'm sure the blocking individual members from commenting on someone's blog, can be tweaked / added through the hook system, as that basically would be along the lines of ignoring someone and there is already a block mod for the forums.

But a php file edit maybe needed for the playlist mod.....

Been trying myself, but its not so easy to code vBulletin as it is phpBB (but what do you expect when they keep releasing new versions).
Reply With Quote
  #7  
Old 12-30-2010, 11:56 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would change this:

Quote:
*100
to this:
Quote:
*100, 2

2 decimal places is more than enough for temps.
Reply With Quote
  #8  
Old 12-31-2010, 04:11 PM
Dr.osamA's Avatar
Dr.osamA Dr.osamA is offline
 
Join Date: Aug 2004
Location: Syrie
Posts: 979
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

insalled

thanxxx
Reply With Quote
  #9  
Old 01-01-2011, 07:20 AM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Osama! And since you seem to like alot of my BBCode keep your eyes peeled for the next few days.. I'm about to release the ultimate bbcode for math. IT literaly formats everything to look like equations and it's all automated, I've been working on it for about 7 hours now and I'm almost done. HEHE
Reply With Quote
  #10  
Old 01-01-2011, 06:21 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by orange gold View Post
Thanks Osama! And since you seem to like alot of my BBCode keep your eyes peeled for the next few days.. I'm about to release the ultimate bbcode for math. IT literaly formats everything to look like equations and it's all automated, I've been working on it for about 7 hours now and I'm almost done. HEHE
lol..great stuff man
Reply With Quote
Reply

Thread Tools

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 03:01 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07226 seconds
  • Memory Usage 2,314KB
  • Queries Executed 24 (?)
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
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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