Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

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
  #12  
Old 01-15-2011, 10:16 PM
orange gold orange gold is offline
 
Join Date: Dec 2007
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry it's taking so long. My hard drive on my mac failed and I havent really been able to get online except for my iPhone, and then I forgot the password to this account hahahahaha... But now I am back, and my mac should be fixed by wednesday so I can post the math formatting code by friday hopefully.
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 04:52 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.07412 seconds
  • Memory Usage 2,221KB
  • Queries Executed 17 (?)
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
  • (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
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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