Plugin Directory

Changeset 513452


Ignore:
Timestamp:
03/02/2012 11:25:10 AM (14 years ago)
Author:
TIgor4eg
Message:
 
Location:
ti-stat
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ti-stat/tags/0.4/readme.txt

    r512953 r513452  
    1111Tested up to: 3.2
    1212
    13 Stable tag: 0.3.8
     13Stable tag: 0.4
    1414
    1515
     
    5353
    5454== 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
    5560
    5661= 0.3.8 =
  • ti-stat/tags/0.4/ti_stat.php

    r513401 r513452  
    44Plugin URI: http://tigor.org.ua/ti-stat/
    55Description: Show Yandex.Metrika statistic on pages.
    6 Version: DEV
     6Version: 0.4
    77Author: TIgor
    88Author URI: http://tigor.org.ua
  • ti-stat/trunk/readme.txt

    r509681 r513452  
    1111Tested up to: 3.2
    1212
    13 Stable tag: 0.3.8
     13Stable tag: 0.4
    1414
    1515
     
    5353
    5454== 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
    5560
    5661= 0.3.8 =
  • ti-stat/trunk/ti_stat.php

    r512957 r513452  
    215215           
    216216            <?php
     217           
     218           
    217219            if ($auth->counter_id!= '')
    218220                    {
    219221                   
    220                    
     222                echo 'debug'.$auth->counter_id;
    221223                   
    222224                } else {
    223                
     225                    echo 'debug_false';
    224226                    $counters = ti_counters($auth->token);
    225227                                   
     
    15091511}
    15101512
     1513function 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
     1520for ($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
     1529return $data;
     1530}
     1531
     1532
     1533function ti_Y_API($url,$method)
     1534{
     1535
     1536$ch = curl_init();
     1537curl_setopt($ch, CURLOPT_URL, $url);
     1538curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
     1539curl_setopt($ch, CURLOPT_HTTPHEADER, array($url, $method));
     1540curl_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
    15111567?>
  • ti-stat/trunk/uninstall.php

    r413655 r513452  
    1717delete_option('ti_reports');
    1818
    19 
     19delete_option('ti_stat_graph');
    2020
    2121?>
Note: See TracChangeset for help on using the changeset viewer.