Changeset 513452
- Timestamp:
- 03/02/2012 11:25:10 AM (14 years ago)
- Location:
- ti-stat
- Files:
-
- 5 edited
-
tags/0.4/readme.txt (modified) (2 diffs)
-
tags/0.4/ti_stat.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/ti_stat.php (modified) (2 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ti-stat/tags/0.4/readme.txt
r512953 r513452 11 11 Tested up to: 3.2 12 12 13 Stable tag: 0. 3.813 Stable tag: 0.4 14 14 15 15 … … 53 53 54 54 == Changelog == 55 56 = 0.4 = 57 * NEW: Tabs for settings 58 * NEW: Some visualisation settings for Traffic and Hourly charts can be changed in admin menu 59 * FIX: Added timestamp in files links to override caching 55 60 56 61 = 0.3.8 = -
ti-stat/tags/0.4/ti_stat.php
r513401 r513452 4 4 Plugin URI: http://tigor.org.ua/ti-stat/ 5 5 Description: Show Yandex.Metrika statistic on pages. 6 Version: DEV6 Version: 0.4 7 7 Author: TIgor 8 8 Author URI: http://tigor.org.ua -
ti-stat/trunk/readme.txt
r509681 r513452 11 11 Tested up to: 3.2 12 12 13 Stable tag: 0. 3.813 Stable tag: 0.4 14 14 15 15 … … 53 53 54 54 == Changelog == 55 56 = 0.4 = 57 * NEW: Tabs for settings 58 * NEW: Some visualisation settings for Traffic and Hourly charts can be changed in admin menu 59 * FIX: Added timestamp in files links to override caching 55 60 56 61 = 0.3.8 = -
ti-stat/trunk/ti_stat.php
r512957 r513452 215 215 216 216 <?php 217 218 217 219 if ($auth->counter_id!= '') 218 220 { 219 221 220 222 echo 'debug'.$auth->counter_id; 221 223 222 224 } else { 223 225 echo 'debug_false'; 224 226 $counters = ti_counters($auth->token); 225 227 … … 1509 1511 } 1510 1512 1513 function ti_counters($token) 1514 { 1515 $xml = new SimpleXMLElement(ti_Y_API('http://api-metrika.yandex.ru/counters?oauth_token='.$token,'GET')); 1516 1517 $counters = $xml->counters; 1518 $count = (int)$counters->attributes()->count; 1519 1520 for ($i=0;$i<$count;$i++) 1521 { 1522 1523 $data[$i]['url']=(string) $counters->counter[$i]->site; 1524 $data[$i]['permission']=(string) $counters->counter[$i]->permission; 1525 $data[$i]['name']=(string) $counters->counter[$i]->name; 1526 $data[$i]['id']=(string) $counters->counter[$i]->id; 1527 } 1528 1529 return $data; 1530 } 1531 1532 1533 function ti_Y_API($url,$method) 1534 { 1535 1536 $ch = curl_init(); 1537 curl_setopt($ch, CURLOPT_URL, $url); 1538 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 1539 curl_setopt($ch, CURLOPT_HTTPHEADER, array($url, $method)); 1540 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 1541 $return = curl_exec($ch); 1542 1543 1544 if(curl_errno($ch)) 1545 { 1546 return false; 1547 echo 'Curl errno'; 1548 } 1549 1550 $http_code = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE); 1551 1552 if ($http_code != 200) 1553 { 1554 echo $http_code; 1555 return false; 1556 } 1557 else 1558 { 1559 return $return; 1560 1561 } 1562 } 1563 1564 1565 1566 1511 1567 ?> -
ti-stat/trunk/uninstall.php
r413655 r513452 17 17 delete_option('ti_reports'); 18 18 19 19 delete_option('ti_stat_graph'); 20 20 21 21 ?>
Note: See TracChangeset
for help on using the changeset viewer.