DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:gil

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:gil [2009-06-21 23:46] – comment on lack of CSS styling ryan.chappelleplugin:gil [2016-01-24 19:38] (current) Aleksandr
Line 1: Line 1:
-====== gil plugin ======+====== gil Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: Shows currency conversions +description: Perform and show currency conversions 
-author     : Luis Machuca B. +author     : Luis Machuca Bezzaza 
-email      : luis.machuca@gulix.cl+email      : luis.machuca [at] gulix.cl
 type       : Syntax type       : Syntax
-lastupdate : 2009-06-21+lastupdate : 2010-06-01
 compatible :  compatible : 
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : currency, info, convert+tags       : convert, currency, !experimental 
 +downloadurl: http://ryan.gulix.cl/dw/_media/desarrollo/dokuwiki/dw-plugin-gil-latest.zip 
 +sourcerepo:  #https://github.com/dokufreaks/plugin-bbcode 
 +bugtracker:  #https://github.com/dokufreaks/plugin-bbcode/issues
 ---- ----
  
-^  :!: This plugin is **Experimental**!   ^+^  :!: This plugin is **[[:Experimental]]**!   ^
  
-''**gil**'' is a plugin I've developed for DokuWiki that performs a simple task: allow one to show currency conversions in a wiki page. +''**gil**'' is a plugin I've developed for DokuWiki that performs a simple task: to show currency conversions in a wiki page. 
  
-For that purpose, conversion data made available by Yahoo Finances (™, (C) and/or whatever) is accesed and used to convert a singular amount of currency in an indicated ("//source//") currency to a list of intended ("//target//") currencies. The result is shown as a (X)HTML tooltip so that clients can hover over the amount and check the conversions.+For that purpose, conversion data made available by Yahoo Finances (™, (C) and/or whatever) is accessed and used to convert a singular amount of currency in an indicated ("//source//") currency to a list of intended ("//target//") currencies. The result is shown as a (X)HTML tooltip so that clients can hover over the amount and check the conversions.
  
 The plugin name "gil" is inspired by the [[http://finalfantasy.wikia.com/wiki/Gil|homonymous, meta-universal currency]] used in the games of the [[wp>Final Fantasy]] franchise. Yes, you guessed it: I'm a fan. ^_^ The plugin name "gil" is inspired by the [[http://finalfantasy.wikia.com/wiki/Gil|homonymous, meta-universal currency]] used in the games of the [[wp>Final Fantasy]] franchise. Yes, you guessed it: I'm a fan. ^_^
Line 24: Line 27:
 :!: This plugin is based off of work from Sridhar Kuppalli, a developer who in his blog shows the audience [[http://kuppalli.wordpress.com/2008/11/15/get-live-currency-value-using-yahoo-api/|how to use PHP to access the currency data from the online service and use it for conversion]]. **Credits and original idea therefore go to the man**. I've just adapted the idea to work in DokuWiki because I thought the nature and intended use of this software may make a plugin like this useful. :!: This plugin is based off of work from Sridhar Kuppalli, a developer who in his blog shows the audience [[http://kuppalli.wordpress.com/2008/11/15/get-live-currency-value-using-yahoo-api/|how to use PHP to access the currency data from the online service and use it for conversion]]. **Credits and original idea therefore go to the man**. I've just adapted the idea to work in DokuWiki because I thought the nature and intended use of this software may make a plugin like this useful.
  
-===== Syntax =====+===== Installation and Usage =====
  
 +==== Install ====
 +
 +Give the Install link above for the Plugin Manager to eat.
 +
 +If the link doesn't work, check the [[#Demo]] page which contains links.
 +
 +==== Configure ====
 +
 +To configure the plugin, just access the [[config|configuration manager]] and modify the following settings so that they suit your needs:
 +
 +^ Plugin Parameter   | Default Value    | Usage             |
 +| ''gil_source''       ''USD''        | The **source currency** from which conversions will be performed.   |
 +| ''gil_targets''    |   ''EUR''        | A comma-delimited list of **target currencies** to which conversions will be performed,\\ and whose results will appear as the tooltip content. An example value would be:\\ ''EUR,GBP,QAR''  |
 +| ''gil_showsource''  |  false          | **Unused**. If enabled, the ISO code of the source currency will be shown before the amount\\ for easier identification.  |
 +
 +The variables ''gil_source'' and ''gil_targets'' use the __National Currency Codes__ defined by [[wp>Currency_codes#Active_codes|ISO 4217]] (three-letter currency codes). You can check [[http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=46121|here]] for the official catalogue, if you feel like you have the <del>gil</del> money to buy, that is; or you can use the Wikipedia link provided above which contains a listing of National Currency Codes sorted by country.
 +
 +The plugin comes preconfigured to use ''USD'' ([[wp>US Dollar]]) to ''EUR'' ([[wp>Euro]]) conversion. 
 +
 +==== Syntax ====
 To show currency conversions for a certain amount of national money, just precede it with two dollar signs, with no spacing whatsoever. To show currency conversions for a certain amount of national money, just precede it with two dollar signs, with no spacing whatsoever.
  
   $$1500   $$1500
 +
 +Optionally, introduce an alternative source unit as follows (take into consideration that this will incur in extra traffic and load overhead):
 +
 +  $$EUR1500
  
 As a result, the text is shown in the form "... __XXX$1500__ ..." with the text "YYY$nnnn" as the tooltip, where ''XXX'' is the currency code used as source and ''YYY'' the one used as target; ''nnnn'' is the result of the conversion from the source 1500 units shown in the example to the target currency. See the picture below for an example. As a result, the text is shown in the form "... __XXX$1500__ ..." with the text "YYY$nnnn" as the tooltip, where ''XXX'' is the currency code used as source and ''YYY'' the one used as target; ''nnnn'' is the result of the conversion from the source 1500 units shown in the example to the target currency. See the picture below for an example.
Line 35: Line 62:
  
   * The plugin syntax takes no parameters.   * The plugin syntax takes no parameters.
-  * Configuration is available via the **Configuration Manager**.+  * Configuration (now localized) is available via the **Configuration Manager**. 
 +  
 +==== Demo ====
  
-===== Install and Configure =====+:!: [[http://ryan.gulix.cl/dw/desarrollo/dokuwiki/plugin-gil|(Neo) Demo site is up]].
  
-^  Download and Install via Plugin Manager  ^+Note language is **Spanish** but online translators shall do a good job with it.
  
-To download and install this plugin point your DokuWiki's [[plugin:plugin|Plugin Manager]] to the following URL: {{https://informatica.temuco.udelmar.cl/~lmachuca/dokuwiki-lucho/_media/desarrollo/informatica/dokuwiki/dw-plugin-gil-latest.zip}} --- this link always points to the __most recent release__. Or you can check up the [[#Demo]] page.+^  {{http://ryan.gulix.cl/archivos/dokuwiki/scr-plugin-gil-01.png?nolink}}  ^ 
 +|    An example visualization of the ''gil'' plugin with the default configuration\\ (conversion from [[wp>US Dollar]] to [[wp>Euro]]) |
  
-To configure the pluginjust access the [[config|configuration manager]] and modify the following settings:+Another demo sitevery simple and in Englishhttp://ryan.gulix.cl/tests/doku.php/gil
  
-^ Plugin Parameter   | Default Value    | Usage             | +===== Other Details =====
-| ''gil_source''       ''USD''        | The **source currency** from which conversions will be performed.   | +
-| ''gil_targets''    |   ''EUR''        | A comma-delimited list of **target currencies** to which conversions will be performed,\\ and whose results will appear as the tooltip content.   | +
-| ''gil_showsource''  |  false          | If enabled, the ISO code of each currency will be shown before the amount\\ for easier identification.  |+
  
-The variables ''gil_source'' and ''gil_targets'' use the __National Currency Codes__ defined by [[wp>Currency_codes#Active_codes|ISO 4217]] (three-letter currency codes). You can check [[http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=46121|here]] for the official catalogue, if you feel like having the <del>gil</del> money to buy, that is; or you can use the Wikipedia link provided above which contains a listing of National Currency Codes sorted by country.+==== Browser Support ====
  
-The plugin comes preconfigured to use ''USD'' ([[wp>US Dollar]]) to ''EUR'' ([[wp>Euro]]) conversion. +To show the conversions, a tooltip is implemented, which all browsers compliant to CSS 2.0 will be able to render. The plugin has been tested in Opera 10.10 and Firefox 3.0 without problems. If your particular browser ([[wp>Internet Explorer|*ahem...*]]) renders incorrectly or not-at-all, it is a bug on //their// part -- take the chance to **switch to a better browser**!
  
 +As of version 0.4, the plugin also implements the adequate CSS for print-preview, so the currency conversions are available when printing.
  
-===== Other Details =====+As with any of my plugins, there is **no** official Internet Explorer support, in particular for IE6 as part of the [[http://www.freelists.org/post/dokuwiki/end-of-IE6 end-of-IE6]] devel campaign.
  
-==== Demo ====+==== Connection Costs ====
  
-:!: [[https://informatica.temuco.udelmar.cl/~lmachuca/dokuwiki-lucho/desarrollo/informatica/dokuwiki/plugin-gil|Demo site is up]].+Upon loading (that is, once every time a page is requested), this plugin will try to connect to Yahoo Finances and, if it can not establish a connection, send a warning via DokuWiki's ''msg'' function to let clients know that conversions may not show or may be out-of-date. The message is localized (but see [[#Localization]]).
  
-Note language is **Spanish** but online translators shall do a good job with it.+Each __currency combination__ requires one data request to Yahoo Finances. That is, if you have conversions from Euro to Dollars, Euro to Yen, Pound to Yen and Sterling to Dollar, four requests will be made, no matter how many conversion //instances// you have in a page -- you can have a spreadsheet complete with __Over Nine Thousand__ currency conversions, but if they are all from Euro to Yen, only //one// request to Yahoo Finances will be made. Take this into consideration when using this plugin in a production environment rich in financial information or with limited traffic capabilities. 
 + 
 +**Remember this plugin is [[:experimental]]**.
  
-^  {{https://informatica.temuco.udelmar.cl/~lmachuca/files/dokuwiki/scr-plugin-gil-01.png?nolink}}  ^ 
-|    An example visualization of the ''gil'' plugin with the default configuration\\ (convertion from [[wp>US Dollar]] to [[wp>Euro]]) | 
  
 ==== Known Issues ==== ==== Known Issues ====
  
-__Remember this plugin is in [[:experimental]] stage.__+What the plugin does is to retrieve currency conversion data live from Yahoo Finances. If you put too many conversions in a page or are trying to convert to many different currencies, page loading will be **quite slow**. Caching should not be affected.
  
-What the plugin does is to retrieve currency conversion data live from Yahoo FinancesBecause of the nature of the plugin, caching of the page is **disabled**Remember that because it means if you put too many conversions in a page or are trying to convert to many different currencies, page loading will be **quite slow**.+<del>For the moment, no caching whatsoever is implemented for the currency conversion data.</del> Basic caching implemented in ''0.3b''.
  
-For the moment, no caching whatsoever is implemented for the currency conversion data.+<del>Also for the moment, **the plugin takes integer amounts** for currency **only**.</del> The plugin also takes fractional amounts, and can accept both period (''.'') and comma ('','') as decimal separator.
  
-Also for the moment, **the plugin takes integer amounts** for currency **only**.+The plugin does **not** currently check for the validity of currency units. 
 + 
 +==== Localization ==== 
 + 
 +The plugin incorporates localized content for its description, configuration options and warning messages. However only English and Spanish messages are available. If you want to contribute a localization, submit it down here on Discussion or mail it to me. You will be credited accordingly and previous versions of the plugin will be retrofitted to include your contributions.
  
 ==== Source Code ==== ==== Source Code ====
Line 84: Line 116:
 The following improvements are planned for the next release: The following improvements are planned for the next release:
  
-  * Decimal currency support, of course. 
   * Using the national currency symbol instead of the generic ''$''.   * Using the national currency symbol instead of the generic ''$''.
-  * Verification of source currency validity ((ie.: things like disallowing decimal units in currencies that do not have fractional units, or disallowing conversions from the testing-purpose-only ''X??'' codes)). +  * Verification of source currency validity ((i.e.: things like disallowing decimal units in currencies that do not have fractional units, or disallowing conversions from the testing-purpose-only ''X??'' codes)). 
 +  * ...Ability to use another service? 
 +  
 When will the major be released? Whenever it's ready. When will the major be released? Whenever it's ready.
  
 ==== Other Developments ==== ==== Other Developments ====
  
-^ Other Plugins by\\ Luis Machuca B.:   | [[doku>plugin:progrecss]]\\ [[doku>plugin:tooltip]]\\ [[doku>plugin:clock]]\\ [[doku>plugin:divalign2]]\\ [[doku>plugin:gil]]   |+^ Other Plugins by\\ Luis Machuca B.:   | [[plugin:progrecss]]\\ [[plugin:tooltip]]\\ [[plugin:clock]]\\ [[plugin:divalign2]]\\ [[plugin:countdown]]\\ [[plugin:hide]]\\ [[plugin:noiewarning]]\\ [[plugin:linkbonus]]   |
  
----- datarelated ---- 
-cols  : author 
-title : Other Projects 
-max   : 5 
----- 
  
 ===== Discussion ===== ===== Discussion =====
Line 106: Line 133:
 The currency shown in the text needs some CSS formatting, maybe a dotted underline so the web page user moves their mouse over. The currency shown in the text needs some CSS formatting, maybe a dotted underline so the web page user moves their mouse over.
 > It currently doesn't have one because the syntax makes use of the ''<ABBR>'' tag by the browser... I'll try and provide a sensible CSS styling for the next release. Much thanks! -  --- //[[luis.machuca@gulix.cl|Luis Machuca B.]] 2009/06/21 23:45// > It currently doesn't have one because the syntax makes use of the ''<ABBR>'' tag by the browser... I'll try and provide a sensible CSS styling for the next release. Much thanks! -  --- //[[luis.machuca@gulix.cl|Luis Machuca B.]] 2009/06/21 23:45//
 +>>Solved with the newest release.  --- //[[luis.machuca@gulix.cl|Luis]] 2010/06/04 02:50//
 ---- ----
- 
- 
- 
  
plugin/gil.1245620810.txt.gz · Last modified: 2009-06-21 23:46 by ryan.chappelle

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki