Home arrow Articles arrow Stories arrow Inline Currency Conversion Sunday, 05 September 2010 
Main Menu
Home
Articles
Mambo Open Directory
Downloads
FAQ
Web Links
Contact Us
Currency Converter Live
Exchange rate on 2010.09.03

EUR EUR  USD USD
100.00  128.34
Currency rate today higher than yesterday 0.125 %

Edit - About - More
Earlier rates - Graphic

Login Form
Username

Password

Remember me
Forgotten your password?
No account yet? Create one
MambWeather
Copenhagen
14°C
Copenhagen 14°C
Inline Currency Conversion PDF Print E-mail
Written by Administrator   
Thursday, 22 January 2004

The Currency Convertor Live module for Mambo offers rates updated from the European Central Bank daily at 2:15 PM CET.

Author: Werner Knudsen, version: 1.11.

Configuration: You can set your default currencies in the config file located at modules/mod_cucolive/config.php.

Use: The module output shows the currently selected conversion. Links are provided to Edit, About and More.

  • Edit: Choose and convert between 26 different currencies.
  • About: Read the About information.
  • More: Open the Personal Currency Assistent from XE.com for more currencies.

Inline Conversion: With the module installed you can do Javascript based inline currency conversions in any Mambo content. In HTML edit mode you insert the appropriate script tags using modules/mod_cucolive/currency.php as the script source. The output is controlled by a number of parameters:

  • amount: The amount you wish to convert.
  • from: The currency you convert from, eg. USD. See the supported currency codes at http://www.ecb.int/stats/eurofxref/eurofxref-xml.html.
  • to: The currency you convert from, eg. EUR.
  • action=script&sub=showall: The sub-action showall displays the current conversion like eg. USD 100.00 = EUR 79.77.
  • action=script&sub=convert: The sub-action convert displays only the converted amount, eg. 79.77.
  • action=script&sub=set: The sub-action set displays nothing but sets 4 Javascript variables that you can display later with document.write: fromC and fromA contains the currency and amount you are converting from while toC and toA contains the currency and amount you are converting to.

Inline Conversion Example: The beginning of this Mambo content item contains the following script:

<script src="modules/mod_cucolive/currency.php?action=script&sub=set&amount=100&from=USD&to=EUR"> </script>

With the Javascript variables set the following script writes a formatted conversion:

<script> document.write(fromC + " " + fromA + " converts into " + toC + " " + toA); </script>

The result can be seen here:

Warning: Be careful when your content includes Javascript - it can cause problems when combined with the HTMLarea content editor. The tags presented on this page seem to be rather harmless though.

Last Updated ( Thursday, 09 December 2004 )
< Prev
: Home :: Articles :: Mambo Open Directory :: Downloads :: FAQ :: Web Links :: Contact Us :
powered by mambo open source design by peekmambo.com site content by cmsinfo.dk