If you find this module useful, and would like to see further development of this project, be a proud sponsor of the Yahoo Currency Converter - AJAX version!
Performs currency conversion by connecting in real-time at the backend to the Currency Converter from Yahoo Finance. So you get the most up-to-date currency rate as provided by Yahoo 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)
Available for all Joomla versions: Joomla 1.0.x, native 1.5.x, 1.6.x, 1.7.x and 2.5.x!
Important Note: Yahoo Finance has changed its interface to pure AJAX module. As a result, it is no longer possible to retrieve the converted currencies using fread() or the cURL library direct from http://finance.yahoo.com/currency-converter.
In case you're wondering where does the program get the currency conversion rate from? First go to http://finance.yahoo.com/currency-converter, click the link "View 5 Day Trend", then on the left navigation bar, you will see one more link "Summary". Click on that link. This is where the program gets the rate for the currency conversion.
Thanks to feedback from Dusan and Alansticks, it turns out that Yahoo has recently changed its website again that allows us to retrieve the currency conversion rate.
The latest version now also handles the following 2 cases:
25,000 will now be correctly handled as 25000
Any empty spaces after a number will be automatically trimmed and handled correctly
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).
If you find the module useful and would like to use the module without the "Powered-by" links, you may do so by purchasing a "Powered-by" removal license for only USD $10 per site.
Secured payment is processed by 2checkout.com. All major credit cards are accepted, including Visa, Mastercard and American Express, etc. You can also pay by PayPal. Once the transaction is completed, you will be given a link to download the registered version with the "Powered by" links removed.
Use which method to retrieve data: There are now three methods to retrieve data from Yahoo Finance.
The default method uses fread().
You can also use file_get_contents(). Note that file_get_contents() is only available in PHP5 and above.
Use the cURL library. For this method, you need to make sure your PHP has the cURL library installed.
Use the default method fread() first. If it doesn't work, then try file_get_contents(), and then the cURL library.
Currency From: This is the default "currency from" that will be displayed when the module is first loaded.
Currency To: This is the default "currency to" that will be displayed when the module is first loaded.
Label for Submit Button: Default is "Convert". You may change this to your language.
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.
Layout style: There are three layout styles to choose from:
Style 1:
This one has the minimum width, and is ideal when you are positioning it in the left or right column.
You can set the style of every item within the Yahoo 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.
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.
v1.0.1 (for Joomla 1.0) and v1.5.1 (for Joomla 1.5)
Released September 3, 2008
Fixed a bug in Internet Explorer. The module will now work correctly in IE.
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.
v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
Released September 28, 2008
Thanks to Andre who pointed out that the converter keeps "spinning" when one enters a large amount e.g. 10,000. This is because the previous version did not test for the comma sign.
The new version has fixed this.
v1.0.3 (for Joomla 1.0) and v1.5.3 (for Joomla 1.5)
Released January 17, 2009
Yes, the Yahoo Currency Converter is back again!
Managed to find another Yahoo Finance page that allows us to grab the cuurency conversion rate.
v1.0.5 (for Joomla 1.0) and v1.5.5 (for Joomla 1.5)
Released September 1, 2009
Thanks to Juan Manuel Rico who informed me about Venezuelan's new currency. Have changed the code from Venezuelan Bolivar (VEB) to Venezuelan Bolivar Fuerte (VEF).
v1.0.4 (for Joomla 1.0) and v1.5.4 (for Joomla 1.5)
Released August 31, 2009
This is in response to Alamshahi's post titled "uncorrect results : missed digits".
The error occurred when Yahoo returns a conversion rate greater than 1,000. The original program was "confused" because of the ',' in 1,000. Have fixed the bug in this version.
In this new release, I've also added support for retrieving yahoo currency data using file_get_contents() or fread(). So for those people with no cURL library, you can now use the module using file_get_contents() or fread().
v1.0.6 (for Joomla 1.0), v1.5.6 (for Joomla 1.5), v1.6.6 (for Joomla 1.6) and v1.7.6 (for Joomla 1.7)
Released January 25, 2012
Support for native Joomla 1.6 and Joomla 1.7!
Have also updated the currency list to the latest from yahoo.com
Q1: I modified the stylesheet as outlined in Styling the Module using CSS. But the new styles do not seem to take effect.
A1: Note that after you have modified the stylesheet, you have to reload the page so that the stylesheet is reloaded.
I've also found that for some browsers, they still use the "cached" version of stylesheet even when you click the "Reload" button. In such case, you need to clear the cache so the the modified stylesheet gets reloaded.
Q2: I changed the format from Style 1 to Style 2. But the Yahoo Currency Converter are still displayed as Style 1.
A2: After you have changed the style in Modules Manager from Style 1 to Style 2, make sure you click the "Reload" button on the page in which the Yahoo Currency Converter is displayed.
Do you know where in the code is the place to control the size of the inputbox where the 1 is located? the first box in-front of: convert. I need to resize it smaller to accommodate it to my template.
its in mod_yahoocurrencyconverter_lib.php file, look for function that begins with "if ($style==2) { ... ...." it apears at 3 places, someting like "......"
I have changed those values (size=\"5\") to 2, 3, 4, and the box stays the same; I think that somehow the joomla template I'm using is not allowing to resize that box somehow.
I have delteted /cache content and also /administrator/cache and also /template/mytemplate/css-compiled contents and nothing changes in that box. I even went to the extreme of delteting this:
"class=\"inputbox\" maxlength=\"12\" size=\"5\"
from line 120, 142 and 156 of that file, and the yahoocurrency form still shows with the same boxes sizes and delivers the currency change.
it's located here http://www.radiotaxcarga.com/ I just want to cut the exess size to the right of the column to make it even but the template is sort of complicated.
I have been using opera's and chrome 'Inspect Element' and after I deleted those values from the yahoocurrencyconverter_lib.php they still show at the source code. so it has to be somewhere and I have deleted all the cache, or the ones I mentioned above, I don't know if there are other caches.
Think it's your Joomla template style sheet causing the effect.
To verify this, try setting up a fresh install of Joomla somewhere on your server and then test it with the standard Joomla template. You will see whether the module works ok with the standard Joomla template.
maby css of your template is overriding ccs of Curremcy Converter module. As kksou suggested try to instal fresh instal of joomla somwhere else and test it with other template, or try to tweek input width property but that could also change width od search inputbox
Thank you guys for all the input and help. apparently as Dusan and you Kksou said installing a fresh joomla and a default template shows the plugin working great.
I will have to live with it and in the mean time I just place a after the first 'convert' that was in front of the box, so now the box shows in aligned with the others, a quick fix until I can be able to dig into the ton of css files this template has.
Again, thanks for all your help and for the great contribution with these gadgets to Joomla.
Comments
is there a fix?
It turns out that Yahoo has recently changed its website again that allows us to retrieve the currency conversion rate.
Please download the latest version above: http://www.kksou.com/php-gtk2/Joomla-Gadgets/Yahoo-Currency-Converter-AJAX-version.php#download
Let me know if it works with the new version, ok?
Regards,
/kksou
Do you know where in the code is the place to control the size of the inputbox where the 1 is located? the first box in-front of: convert. I need to resize it smaller to accommodate it to my template.
thanks in advance for any reply.
its in mod_yahoocurren cyconverter_lib .php file, look for function that begins with "if ($style==2) { ... ...." it apears at 3 places, someting like "......"
size=\"5\"
Rocketero, did you manage to find it?
Regards,
/kksou
It could be your cache.
Try to clear the joomla cache as well as your browser cache and see if it works.
Regards,
/kksou
"class=\"inputbox\" maxlength=\"12\" size=\"5\"
from line 120, 142 and 156 of that file, and the yahoocurrency form still shows with the same boxes sizes and delivers the currency change.
Can you do a view source of your page - does it shows the old or the new value?
Regards,
/kksou
Think it's your Joomla template style sheet causing the effect.
To verify this, try setting up a fresh install of Joomla somewhere on your server and then test it with the standard Joomla template. You will see whether the module works ok with the standard Joomla template.
Regards,
/kksou
looking thru css at your page (and there is realy lots of it) i was able to find this:
inputbox{width: 90%;background-position:95% -69px;background -repeat:no-repeat;border-radius:25px;mar gin-bottom:0;paddin g:5px 14px;}
inputbox{width: 135%;}
maby css of your template is overriding ccs of Curremcy Converter module.
As kksou suggested try to instal fresh instal of joomla somwhere else and test it with other template, or try to tweek input width property but that could also change width od search inputbox
I will have to live with it and in the mean time I just place a after the first 'convert' that was in front of the box, so now the box shows in aligned with the others, a quick fix until I can be able to dig into the ton of css files this template has.
Again, thanks for all your help and for the great contribution with these gadgets to Joomla.
RSS feed for comments to this post