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-10-05 02:10] – updated new version (0.3b), notes on technical cost ryan.chappelleplugin:gil [2016-01-24 19:38] (current) Aleksandr
Line 1: Line 1:
-====== gil plugin ======+====== gil Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 6: Line 6:
 email      : luis.machuca [at] gulix.cl email      : luis.machuca [at] gulix.cl
 type       : Syntax type       : Syntax
-lastupdate : 2009-10-04+lastupdate : 2010-06-01
 compatible :  compatible : 
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : currency, info, convert, experimental+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 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. 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.
Line 23: Line 26:
  
 :!: 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 ===== ===== Installation and Usage =====
  
 ==== Install ==== ==== Install ====
-^  {{https://informatica.temuco.udelmar.cl/~lmachuca/dokuwiki-lucho/_media/desarrollo/dokuwiki/dw-plugin-gil-latest.zip|Link for the Plugin Manager}}\\ (always points to the latest version)   ^+ 
 +Give the Install link above for the Plugin Manager to eat.
  
 If the link doesn't work, check the [[#Demo]] page which contains links. If the link doesn't work, check the [[#Demo]] page which contains links.
Line 51: Line 53:
   $$1500   $$1500
  
-:!: Optionally, introduce an alternative source unit as follows (take into consideration that this will incur in extra traffic and load overhead):+Optionally, introduce an alternative source unit as follows (take into consideration that this will incur in extra traffic and load overhead):
  
   $$EUR1500   $$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 65: Line 66:
 ==== Demo ==== ==== Demo ====
  
-:!: [[https://informatica.temuco.udelmar.cl/~lmachuca/dokuwiki-lucho/desarrollo/dokuwiki/plugin-gil|Demo site is up]].+:!: [[http://ryan.gulix.cl/dw/desarrollo/dokuwiki/plugin-gil|(Neo) Demo site is up]].
  
 Note language is **Spanish** but online translators shall do a good job with it. Note language is **Spanish** but online translators shall do a good job with it.
  
-^  {{https://informatica.temuco.udelmar.cl/~lmachuca/files/dokuwiki/scr-plugin-gil-01.png?nolink}} +^  {{http://ryan.gulix.cl/archivos/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]]) |+|    An example visualization of the ''gil'' plugin with the default configuration\\ (conversion from [[wp>US Dollar]] to [[wp>Euro]]) |
  
 +Another demo site, very simple and in English: http://ryan.gulix.cl/tests/doku.php/gil
  
 ===== Other Details ===== ===== Other Details =====
  
-==== Conversion cost ====+==== Browser Support ====
  
-Remember that each __currency combination__ requires one request to Yahoo Finances. That is, if you have 5 target currenciesfive request will need to be performed. If you use the syntax for alternative source (for exampleyour Wiki is configures to use ''EUR'' as a source but you need to convert a particular ''GBP'' amount)your source becomes a target and thus six requests will be needed. Even furtherif you combine default and alternative sources in one page, the amount of requests __grows proportionally__ to ''sources × targets'' where //sources// is the number of different sources you use. Take this into consideration when using this plugin in a production environment rich in finantial information or with limited traffic capabilities.+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. 
 + 
 +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. 
 + 
 +==== Connection Costs ==== 
 + 
 +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]]). 
 + 
 +Each __currency combination__ requires one data request to Yahoo Finances. That is, if you have conversions from Euro to DollarsEuro to YenPound to Yen and Sterling to Dollarfour requests will be madeno matter how many conversion //instances// you have in page -- you can have a spreadsheet complete with __Over Nine Thousand__ currency conversionsbut 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]]**. **Remember this plugin is [[:experimental]]**.
Line 84: Line 96:
 ==== Known Issues ==== ==== Known Issues ====
  
-What the plugin does is to retrieve currency conversion data live from Yahoo Finances. Because 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**.+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.
  
 <del>For the moment, no caching whatsoever is implemented for the currency conversion data.</del> Basic caching implemented in ''0.3b''. <del>For the moment, no caching whatsoever is implemented for the currency conversion data.</del> Basic caching implemented in ''0.3b''.
  
-<del>Also for the moment, **the plugin takes integer amounts** for currency **only**.</del> Partially solved.+<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. 
 + 
 +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 106: Line 124:
 ==== Other Developments ==== ==== Other Developments ====
  
-^ Other Plugins by\\ Luis Machuca B.:   | [[doku>plugin:progrecss]]\\ [[doku>plugin:tooltip]]\\ [[doku>plugin:clock]]\\ [[doku>plugin:divalign2]]\\ [[doku>plugin:hide]]   |+^ 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 
----- 
  
 ===== Discussion ===== ===== Discussion =====
Line 119: 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.1254701408.txt.gz · Last modified: 2009-10-05 02:10 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