Changeset 445163
- Timestamp:
- 09/29/2011 10:38:39 AM (15 years ago)
- Location:
- cbrcurrency/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (4 diffs)
-
cbrcurrency.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cbrcurrency/trunk/README.txt
r445159 r445163 1 === Cbr Currency ===1 === Cbr Currency === 2 2 Contributors: f4ber 3 3 Donate link: http://www.f4ber.net/ … … 5 5 Requires at least: 2.6 6 6 Tested up to: 3.2.1 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 9 9 Show the exchange rate of USD, RUR, EUR of The Central Bank of the Russian Federation. 10 Виджет курса валют ЦБ РФ на текущий день c динамикой изменения курса. 10 11 11 12 == Description == 12 13 13 14 Show the exchange rate of The Central Bank of the Russian Federation. 15 Отображает текущий курс валют Евро и Доллар по отношению с Рублю, а также динамику изменения курса. 14 16 15 17 **Supported Languages:** … … 23 25 3. To add the CbrCurrency widget to the sidebar go to 'Appearance->Widgets', and add the CbrCurrency to your blog. 24 26 27 Для включения виджета, после активации плагина переходим в: 28 Внешний вид - Виджеты - Перетаскиваем виджет Cbr Currency на панель справа. 25 29 26 30 == Frequently Asked Questions == 27 Nothing 31 Please, send your questions about this widget to my e-mail: f4ber@yandex.ru 32 Пожалуйста, все ваши вопросы по работе виджета направляйте на мой ящик: f4ber@yandex.ru 28 33 29 34 == Screenshots == … … 34 39 35 40 == Changelog == 41 42 = 1.2.2 = 43 44 * 29/09/2011 45 * Updated code and added russian comments in code 36 46 37 47 = 1.2.1 = -
cbrcurrency/trunk/cbrcurrency.php
r445159 r445163 1 1 <?php 2 2 /* 3 Plugin Name: Cbr Currency4 Plugin URI: http:// f4ber.net/3 Plugin Name: Cbr Currency 4 Plugin URI: http://www.f4ber.net/ 5 5 Description: Виджет курса валют ЦБ РФ на текущий день c динамикой. 6 Version: 1.2. 16 Version: 1.2.2 7 7 Author: f4ber 8 Author URI: http:// f4ber.net/8 Author URI: http://www.f4ber.net/ 9 9 License: GPL2 10 10 */ … … 14 14 # (c) 2001, Mikhail Turenko, http://www.turenko.net, <mikhail@turenko.net> 15 15 16 17 16 function CbrCurrencyWidget($args){ 18 17 extract($args); 19 18 $title = 'Курс ЦБ '; 20 echo21 19 22 20 function getcurrency($code){ … … 25 23 $scripturl = 'http://www.cbr.ru/scripts/XML_dynamic.asp'; 26 24 27 # Начальная дата для запроса (сегодня - 2 дня 172800)28 $date_1=date('d/m/Y', time()- 259200);25 # Начальная дата для запроса (сегодня - 2 дня 259200) 26 $date_1=date('d/m/Y', time()-172800); 29 27 30 28 # Конечная дата (чтобы учитывать завтра добавьте параметр time()+86400) … … 35 33 36 34 # Код валюты в архиве данных cbr.ru 35 //$currency_code='R01235'; 37 36 $currency_code=$code; 38 //$currency_code='R01235';39 37 40 38 # URL для запроса данных … … 68 66 $last = array_pop($d); # последний известный день 69 67 $prev = array_pop($d); # предпосл. известный день 70 $date = $last[ 0]; # отображаемая дата68 $date = $last[2]; # отображаемая дата 71 69 $rate = sprintf("%.2f",$last[2]); # отображаемый курс 72 70 # отображаемое изменение курса, например, "+0.02"
Note: See TracChangeset
for help on using the changeset viewer.