Changeset 446350
- Timestamp:
- 10/02/2011 10:27:44 AM (14 years ago)
- Location:
- cbrcurrency/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (2 diffs)
-
cbrcurrency.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cbrcurrency/trunk/README.txt
r446281 r446350 5 5 Requires at least: 2.6 6 6 Tested up to: 3.2.1 7 Stable tag: 2.3. 27 Stable tag: 2.3.3 8 8 9 9 Show exchange rate Central Bank Russian Federation RUR, RUB, EUR, USD. … … 44 44 45 45 == Changelog == 46 47 = 2.3.3 = 48 49 * 02/10/2011 50 * Fixed bug with getting date of currency 46 51 47 52 = 2.3.2 = -
cbrcurrency/trunk/cbrcurrency.php
r446281 r446350 4 4 Plugin URI: http://www.f4ber.net/ 5 5 Description: Виджет курса валют ЦБ РФ на текущий день c динамикой. 6 Version: 2.3. 26 Version: 2.3.3 7 7 Author: f4ber 8 8 Author URI: http://www.f4ber.net/ … … 17 17 extract($args); 18 18 $title = 'Курс ЦБ '; 19 20 function getcurdate(){ 21 22 # URL для запроса данных 23 $requrldate = "http://www.cbr.ru/scripts/XML_daily.asp"; 24 25 $docdate = file($requrldate); 26 $docdate = implode($docdate, ''); 27 28 # инициализируем массив 29 $dt = array(); 30 31 # ищем <Date="xx.xx.xxxx"> 32 if(preg_match("/Date=\"(\d{2})\.(\d{2})\.(\d{4})\"/is", $docdate, $dt)) 33 $curdate = "{$dt[1]}/{$dt[2]}/{$dt[3]}"; 34 35 return array ($curdate); 36 } 19 37 20 38 function getcurrency($code){ … … 81 99 list ($rate_d, $delta_d, $znak_d, $zcolor_d, $date_d) = getcurrency('R01235'); 82 100 list ($rate_e, $delta_e, $znak_e, $zcolor_e, $date_e) = getcurrency('R01239'); 101 list ($date) = getcurdate(); 83 102 84 echo $before_widget . $before_title . $title . $date _d. $after_title;103 echo $before_widget . $before_title . $title . $date . $after_title; 85 104 86 105 echo '
Note: See TracChangeset
for help on using the changeset viewer.