PDA

View Full Version : [bbcode] xe.com currency convertor (lite)


alkatraz
12-09-2004, 10:00 PM
Not really a hack, but a quick solution to a problem I always have on my forums. If this shouldn't be here feel free to move it, I searched and didn't find anything that did any type of currency conversion.
*If anyone knows how to make the currency conversion automatic please create a full hack for it! (My coding knowledge is next to nothing) I've started the Modification Request (https://vborg.vbsupport.ru/showthread.php?t=72712) for a full featured convertor. ;)


Description:
My members are always asking "what's that in US dollars?" or "how much is $__ in Canadian dollars?" Someone will go to xe.com for them and post up the currency conversion.

Now you can use this bbcode to specify USD or CAN and it will display a link that will open a new window with the converted currency.

Currency conversion is done by XE on the fly so the rates are always acurate. XE.com is the most popular currency conversion site out there, to my knowledge.


Usage:

18.49 typed inside a post results in,

$18.49 CAD. [Convert to USD. (http://www.xe.com/ucc/convert.cgi?From=CAD&To=USD&Amount=18.49)]


Example:

I'm looking for 15,000

I'm looking for $15,000 USD. [Convert to CAD. (http://www.xe.com/ucc/convert.cgi?From=USD&To=CAD&Amount=15,000)]

* Click on the link, it opens a new window with the converted currency.


Installation:
Download the TXT document attached.
Just 2 BBCodes to add, should only take a minute
Please click Install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=72710) if you use it.


Updates:
* Found a way to make link open a new window (not a popup) that calculates the currency without having to press the go button. Updated instructions.


Customization:
I've set this up for CAD to USD and USD to CAN, but you can put whatever currency codes you want.

You can either make additional bb codes for new currency codes or you simply replace the currency codes I've used. Just do a search and replace on instructions doc for "CAD" then "USD" and that should do it.

I've changed the code to open a new window with the currency already converted but you can change it so it opens a popup where some options can be changed. IE: with the popup, you can use a currency selector instead of the fixed currency selection.
Full instructions on XE's popup convertor:
http://www.xe.com/pca/customize.htm


Support:
It's a BB Code, there's nothing to support!


Suggestions
Post them here (https://vborg.vbsupport.ru/showthread.php?t=72712)

There are so many possibilities for this script in the right hands. I'm not a programmer by any means, this is just a simple bbcode and I don't think there's much else I can do to this with my skill level.

I've started a modification request here (https://vborg.vbsupport.ru/showthread.php?t=72712) for a much more integrated hack. Feel free to add to it, hopefully someone can help us out. ;)

:up:

Boofo
12-10-2004, 07:25 AM
Will this adjust for any currency rate changes that come along? ;)

alkatraz
12-10-2004, 07:27 AM
Yup, the currency conversion is done by XE on the fly. XE.com is the most popular currency conversion site out there, to my knowledge.

Mephisteus
12-10-2004, 07:43 AM
If you use a popup blocker, this thing aint gonna work. Any way to work around that? Other then that, nice work. Maybe its an idea to have it submit the go button aswell. Work around the regular stuff, and make the code [xe=USD] so it is of more use. Or a drop down list thing instead of a simple link to convert to a currency :)

So many possibilities :)

alkatraz
12-10-2004, 07:49 AM
So many possibilities in the right hands. I'm not a programmer by any means, this is just a simple bbcode and I don't think there's much else I can do to this with my skill level.

I've started a modification request here (https://vborg.vbsupport.ru/showthread.php?t=72712) for a much more integrated hack. Feel free to add to it, hopefully someone can help us out. ;)


If you use a popup blocker, this thing aint gonna work. Any way to work around that? Other then that, nice work. Maybe its an idea to have it submit the go button aswell. Work around the regular stuff,
Yup popup blockers going to stop it. The xe.com convertor is a tool for webmasters they list on their website, there's other ways to integrate it but this is the only way that didn't require file coding. (which I'm not skilled enough to do)

and make the code [xe=USD]
I thought of that idea too, but that would only specify the "from" currency option and not the "to" currency. You would have to program an if statement that would change both to and from based on the [xe=USD or CAD] option.

One solution to that would be to usd [cad=USD] and [usd=CAD] tags then you could have [cad=___] and put whatever 3 letter code in you wanted. Might add that later

alkatraz
12-10-2004, 09:08 AM
* Found a way to make link open a new window (not a popup) that calculates the currency without having to press the go button. Updated instructions.

SuperGLS
12-13-2004, 01:51 AM
Good stuff. Definately good for worldwide car sites like mine.

I made some easy changes to include KRW (Korean Won) to USD and AUD (Australian dollars) to USD.

Thanks.