Looking for a Calculator mod

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
frontosa
Registered User
Posts: 26
Joined: Sat Oct 28, 2006 9:20 am

Looking for a Calculator mod

Post by frontosa »

hi all
hope this is the right place to put this.
im looking for a Calculator mod to put on my fish forum.
hope some one can help me out with this.
click the link below to see the calculators i mean.
thankyou..

Click Me To See Calculator
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10967
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: Looking for a Calculator mod

Post by battye »

I imagine it is something they have written themselves, or found the javascript elsewhere and arranged it themselves. I have never seen such a MOD where all of this has been included. Have you tried searching the web for the javascript they used? It may be open source so you can use it yourself.

http://www.google.com.au/search?hl=en&q ... arch&meta=
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
frontosa
Registered User
Posts: 26
Joined: Sat Oct 28, 2006 9:20 am

Re: Looking for a Calculator mod

Post by frontosa »

thx i will have a look.
thankyou for your help
User avatar
Jim_UK
Former Team Member
Posts: 18479
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: Looking for a Calculator mod

Post by Jim_UK »

Below is a length convertor. I am sure you could add to it/modify it to create what you want. This code is that to go between the <html> tags in your template for the page.

Code: Select all

<div class="forumlinemain">
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
	<tr>
		<th class="thHead" height="25" valign="middle">Page Title</th>
	</tr>
	<tr>
		<td class="row1" align="center">
		<table width="81%" cellspacing="2" cellpadding="2" border="0" align="center">
			<tr>
				<td>
				<p align="center"><br>
&nbsp;</p>
				<script language="JavaScript" type="text/javascript">
<!--
//    Script Editor:   Howard Chen
//    Browser Compatible for the script: IE 3.0 or Higher
//                                       Netscape 2.0 or Higher
//    This script is free as long as you keep its credits

/*The way this works is the converter converts the number
into the smallest unit in the converter, in this case it will
be centimeter, and then it converts the unit fram centimeterto
other units.*/

function nofocus()
{
   document.convert.InUnit.focus()
}

var cmValue = 1
var mValue = 100
var kmValue = 100000
var inValue = 2.54000843476
var ftValue = 30.4801012183
var ydValue = 91.440275784
var miValue = 160934.708789

function toCM()
{
   var i = document.convert.unit.selectedIndex
   var thisUnit = document.convert.unit.options[i].value
   if (thisUnit == "CM")
   {
      document.convert.cm.value = document.convert.InUnit.value
   }
   else if(thisUnit == "M")
   {
      document.convert.cm.value = document.convert.InUnit.value * mValue
   }
   else if(thisUnit == "KM" )
   {
      document.convert.cm.value = document.convert.InUnit.value * kmValue
   }
   else if(thisUnit == "IN" )
   {
      document.convert.cm.value = document.convert.InUnit.value * inValue
   }
   else if(thisUnit == "FT" )
   {
      document.convert.cm.value = document.convert.InUnit.value * ftValue
   }
   else if(thisUnit == "YD" )
   {
      document.convert.cm.value = document.convert.InUnit.value * ydValue
   }
   else if(thisUnit == "MI" )
   {
      document.convert.cm.value = document.convert.InUnit.value * miValue
   }
   toAll()
}
function toAll()
{

var m = document.convert.cm.value
document.convert.m.value = m / mValue
document.convert.km.value = m / kmValue
document.convert.inch.value = m / inValue
document.convert.ft.value = m / ftValue
document.convert.yd.value = m / ydValue
document.convert.mi.value = m / miValue

}
//-->
</script>
<div align="center"><h1>
	<img border="0" src="images/length.gif" width="394" height="69"></h1></div>
<p align="center">Simply choose the unit you want to use, type the value in the field next to it, and click the 'Convert' button.</p>
<div align="center"><form name="convert">
<table border=1>
<tr><th>Unit</th><th>Number</th></tr>
<tr><td>
<select name="unit">
<option value="CM">Centimetre
<option value="M">Metre
<option value="KM">Kilometre
<option value="IN">Inch
<option value="FT">Foot
<option value="YD">Yard
<option value="MI">Mile
</select></td>
<td><input type="text" name="InUnit" size="20" maxlength="20" value="0"></td></tr>

<tr><td>Centimetre:   </td>
<td><input type="text" name="cm" size="20" maxlength="20" value="0" onFocus="nofocus()"></td></tr>
<tr><td>Metre:</td>
<td><input type="text" name="m" size="20" maxlength="20" value="0" onFocus="nofocus()"></td></tr>
<tr><td>Kilometre:   </td>
<td><input type="text" name="km" size="20" maxlength="20" value="0" onFocus="nofocus()"></td></tr>
<tr><td>Inch:   </td>
<td><input type="text" name="inch" size="20" maxlength="20" value="0" onFocus="nofocus()"></td></tr>
<tr><td>Foot:   </td>
<td><input type="text" name="ft" size="20" maxlength="20" value="0" onFocus="nofocus()"></td></tr>
<tr><td>Yard:   </td>
<td><input type="text" name="yd" size="20" maxlength="20" value="0" onFocus="nofocus()"></td></tr>
<tr><td>Mile:   </td>
<td><input type="text" name="mi" size="20" maxlength="20" value="0" onFocus="nofocus()"></td></tr>
<tr><td align="center"><input type="Reset" value="Start Over"></td>
<td align="center"><input type="button" value="Convert" onClick="toCM()"></td></tr>
</table>
<p>
<img border="0" src="images/rule.gif" width="160" height="214"></p>
</form>
</div>




				<p align="center">
				<span class="genmed"><span style="font-size: 8pt"><br />
				</span></span></p></td>
			</tr>
		</table>
		<p><font size="1">Page Title</font></td>
	</tr>
</table>
</div>
Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!
Post Reply

Return to “[2.0.x] MOD Requests”