Google Currency Converter - AJAX version
Written by kksou   
Tuesday, 26 August 2008

This module allows you to add the Google Currency Converter in a module position.

The module makes use of the Currency Converter from Google Finance. (Scroll to the bottom right and you'll see the Currency Converter.)

Prefer Yahoo Finance?

If you prefer to use the Currency Converter from Yahoo Finance as oppose to Google Finance, here it is:
Yahoo Currency Converter - AJAX version


Note that Google did not release any API for the Google Currency Converter (There are some APIs for Google Finance, but not for the Google Currency Converter).

Important

I've implemented the Google Currency Converter Mashup with the use of PHP's cURL library. So please make sure your PHP has the cURL library installed in order to use this module.

For those interested, the module uses cURL at the backend to convert the currency using the Google Currency Converter. The result is then passed back to the client (i.e. the browser) using AJAX. Since AJAX is used, no reloading of pages is required when the result is displayed.


Latest Version

v1.0.3 (for Joomla 1.0) and v1.5.3 (for Joomla 1.5)
Released September 3, 2008

Support for non-javascript browser and browsers which do not allow javascript!

For these browsers, since AJAX cannot run, there will be reloading of the page when the submit button is clicked. The same result will appear for both the AJAX and non-AJAX mode.

Live Demo

There are four demos available:

Unique Features

  • Performs currency conversion by connecting in real-time at the backend to the Currency Converter from Google Finance. So you get the most up-to-date currency rate as provided by Google Finance.
  • Uses AJAX to display the result - no reloading of pages required!
  • Full CSS support! This means that you can set the font family, font size, foreground and background color of the input field, submit button, etc.
  • The module can be included in a content item! (see below for details)

Including this module in Content Item or Article

Since this is a standard Joomla module, you can easily include this module into a content item or article with the use of {mosloadposition} (for Joomla 1.0.x) or {loadposition} (for Joomla 1.5.x).

You can take a look at the demo here.

Download

How to install

  1. First, make sure your PHP has the cURL library installed. You can do a quick check by doing a simple
  2. <?php
    phpinfo();
    ?>
    

    If your PHP has the cURL library installed, you should see something similar to the following:

    phpinfo.gif

    If you don't have the cURL library, there are numerous resources on the Internet that gives you very clear instructions on how to install cURL on various platform such as windows, linux, etc.

  3. Download and install the "Google Currency Converter" module.
  4. Make sure the module is published / enabled.
  5. Select a module position where you want to place the module.

That's it! You're now ready to use the Google Currency Converter right inside your Joomla website!

Parameters

You can set the following in the Parameters page:

  1. Currency From: This is the default "currency from" that will be displayed when the module is first loaded.
  2. Currency To: This is the default "currency to" that will be displayed when the module is first loaded.
  3. Label for Submit Button: Default is "Convert". You may change this to your language.
  4. Use CSS for highlight: When this is set to "No", result will be highlighted in the default yellow background. If you do not not like the default yellow background color and wish to change this to some other color, change this to "Yes". However, when you set this to "Yes", you need to define the color in the .css file of your template. Please see below for details.
  5. Layout style: There are three layout styles to choose from:
  6. Style 1 This one has the minimum width, and is ideal when you are positioning it in the left or right column.
    Goolge Currency Converter - Style 1
    Style 2 This is the same layout as used in Google Finance.
    Goolge Currency Converter - Style 2
    Style 3 This one shows everything in one line. Ideal for use in top or bottom banner-type module position, or in content item.
    Goolge Currency Converter - Style 3

Styling the Module using CSS

You can set the style of every item within the Google Currency Converter to the exact format you want through CSS. This means that you can set the font family, font size, foreground and background color of the input field, pulldown menu, submit button, etc.

For example, if you're using the default Joomla 1.5 template, define the following style in <joomla root folder>/templates/rhuk_milkyway/css/template.css. If you're using the default Joomla 1.0 template, define the following style in <joomla root folder>/templates/rhuk_solarflare_ii/css/template_css.css.

  1. Input Box
  2. div.googlecurrency input.inputbox {
    	font-family: Verdana;
    	font-size: 12pt;
    	font-style: italic;
    }
    
  3. Submit Button
  4. div.googlecurrency input.button {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  5. The options of the pulldown menu (i.e. the list of currencies)
  6. div.googlecurrency option {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  7. The selected option of the pulldown menu (i.e. the selected currency)
  8. div.googlecurrency select {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  9. Input Label (the text "Convert" and "Into")
  10. div.googlecurrency .input_label {
    	font-family: Verdana;
    	font-size: 12pt;
    }
    
  11. The result
  12. div.googlecurrency .result {
    	font-family: Verdana;
    	font-size: 12pt;
    }
    
  13. The highlight for the result. Note: Don't forget to set the "Use CSS" to "Yes" in the Parameters page in order to change the background color of the highliglht.
  14. div.googlecurrency .highlight {
    	color: #333366;
    	background-color: #0033ff;
    }
    
  15. Use this if you wish to set the background color of the entire module block:
  16. div.googlecurrency {
    	background: #33FF66;
    }
    

Version History

v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
Released August 28, 2008

Bug Fix. When you set the default "currency from" and "currency to", in the parameters page, these options will now be correctly displayed in the frontend. Thanks to Pablo for pointing this out.



User reviews   Average user ratings:    5.0   (from 1 user)
  1. ssnobben
    October 03, 2008 2:26am
    Like it a lot!

    This is a real nice converter with many options! Simple but nice and powerful.

    Good work as always kksou!!

Note: You have to be a registered member to leave a comment. Free registration here.

 
< Prev   Next >

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2008. kksou.com. All Rights Reserved