Changeset 207
- Timestamp:
- 06/19/08 11:34:21 (15 years ago)
- Location:
- plugins/piwik
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/piwik/class.dc.piwik.php
r203 r207 23 23 class dcPiwik extends netHttp 24 24 { 25 protected $api_path; 26 protected $api_token; 27 25 28 public function __construct($uri) 26 29 { … … 57 60 $get = $this->methodCall('SitesManager.getSitesWithAdminAccess'); 58 61 $this->get($get['path'],$get['data']); 59 return $this->readResponse(); 62 $rsp = $this->readResponse(); 63 $res = array(); 64 foreach ($rsp as $v) { 65 $res[$v['idsite']] = $v; 66 } 67 return $res; 60 68 } 61 69 … … 144 152 } 145 153 154 public static function getVisitSummaryGraph($uri,$token,$site) 155 { 156 $flash_movie = dirname($uri).'/libs/open-flash-chart/open-flash-chart.swf'; 157 $flash_vars = array( 158 'module=VisitsSummary', 159 'action=getLastVisitsGraph', 160 'idSite='.$site, 161 'period=day', 162 'date='.date('Y-m-d',strtotime('-1 month')).','.date('Y-m-d'), 163 'viewDataTable=generateDataChartEvolution', 164 'token_auth='.$token 165 ); 166 167 $flash_vars = $uri.'?'.implode('&',$flash_vars); 168 169 return 170 '<object height="150" width="100%" type="application/x-shockwave-flash" '. 171 'data="'.$flash_movie.'">'. 172 '<param name="movie" value="'.$flash_movie.'" />'. 173 '<param name="quality" value="high" />'. 174 '<param name="allowScriptAccess" value="samedomain" />'. 175 '<param name="flashvars" value="data='.urlencode($flash_vars).'" />'. 176 '</object>'; 177 } 178 146 179 public static function getScriptCode($uri,$idsite,$action='') 147 180 { … … 152 185 return 153 186 "<!-- Piwik -->\n". 154 '<script language="javascript" src="'.html::escapeURL($js).'" type="text/javascript"></script>'."\n".187 '<script type="text/javascript" src="'.html::escapeURL($js).'"></script>'."\n". 155 188 '<script type="text/javascript">'. 156 189 "//<![CDATA[\n". -
plugins/piwik/index.php
r205 r207 94 94 95 95 # Get sites list 96 $ sites = $o->getSitesWithAdminAccess();96 $piwik_sites = $o->getSitesWithAdminAccess(); 97 97 98 if (count($ sites) < 1) {98 if (count($piwik_sites) < 1) { 99 99 throw new Exception(__('No Piwik sites configured.')); 100 100 } 101 101 102 foreach ($sites as $v) { 103 $sites_combo[$v['idsite'].' - '.$v['name']] = $v['idsite']; 102 foreach ($piwik_sites as $k => $v) { 103 $sites_combo[html::escapeHTML($k.' - '.$v['name'])] = $k; 104 } 105 106 if ($piwik_site && !isset($piwik_sites[$piwik_site])) { 107 $piwik_site = ''; 104 108 } 105 109 } … … 150 154 '</form>'; 151 155 156 if ($piwik_site && $piwik_uri) 157 { 158 echo 159 '<h3>'.sprintf(__('Last visits graph on %s'),html::escapeHTML($piwik_sites[$piwik_site]['name'])). 160 ' - <a href="'.$piwik_uri.'">'.__('View your blog statistics').'</a></h3>'. 161 '<p>'.dcPiwik::getVisitSummaryGraph($piwik_uri,$piwik_token,$piwik_site).'</p>'; 162 } 163 152 164 if ($piwik_uri) 153 165 { -
plugins/piwik/locales/_pot/main.pot
r203 r207 8 8 "Project-Id-Version: Dotclear 2 piwik module\n" 9 9 "Report-Msgid-Bugs-To: \n" 10 "POT-Creation-Date: 2008-06-1 8 11:19+0200\n"10 "POT-Creation-Date: 2008-06-19 11:13+0200\n" 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 16 16 "Content-Transfer-Encoding: 8bit\n" 17 17 18 #: plugins-test/piwik//class.dc.piwik.php:3 018 #: plugins-test/piwik//class.dc.piwik.php:33 19 19 msgid "Unable to read Piwik URI." 20 20 msgstr "" 21 21 22 #: plugins-test/piwik//class.dc.piwik.php: 8922 #: plugins-test/piwik//class.dc.piwik.php:97 23 23 msgid "Invalid Piwik Response." 24 24 msgstr "" 25 25 26 #: plugins-test/piwik//class.dc.piwik.php:10 026 #: plugins-test/piwik//class.dc.piwik.php:108 27 27 #, php-format 28 28 msgid "Piwik returned an error: %s" 29 29 msgstr "" 30 30 31 #: plugins-test/piwik//class.dc.piwik.php:1 2231 #: plugins-test/piwik//class.dc.piwik.php:130 32 32 msgid "Invalid Service URI." 33 33 msgstr "" … … 45 45 msgstr "" 46 46 47 #: plugins-test/piwik//index.php:1 1947 #: plugins-test/piwik//index.php:123 48 48 msgid "Piwik configuration" 49 49 msgstr "" 50 50 51 #: plugins-test/piwik//index.php:12 351 #: plugins-test/piwik//index.php:127 52 52 msgid "Your Piwik configuration" 53 53 msgstr "" 54 54 55 #: plugins-test/piwik//index.php:1 2755 #: plugins-test/piwik//index.php:131 56 56 msgid "Your Piwik URL:" 57 57 msgstr "" 58 58 59 #: plugins-test/piwik//index.php:1 2959 #: plugins-test/piwik//index.php:133 60 60 msgid "Your Piwik Token:" 61 61 msgstr "" 62 62 63 #: plugins-test/piwik//index.php:13 463 #: plugins-test/piwik//index.php:138 64 64 msgid "Your Piwik installation is not configured yet." 65 65 msgstr "" 66 66 67 #: plugins-test/piwik//index.php:1 3967 #: plugins-test/piwik//index.php:143 68 68 msgid "Piwik website to track:" 69 69 msgstr "" 70 70 71 #: plugins-test/piwik//index.php:14 171 #: plugins-test/piwik//index.php:145 72 72 msgid "Do not track following IP addresses:" 73 73 msgstr "" 74 74 75 #: plugins-test/piwik//index.php:14 375 #: plugins-test/piwik//index.php:147 76 76 msgid "Use fancy page names:" 77 77 msgstr "" 78 78 79 #: plugins-test/piwik//index.php:153 79 #: plugins-test/piwik//index.php:159 80 #, php-format 81 msgid "Last visits graph on %s" 82 msgstr "" 83 84 #: plugins-test/piwik//index.php:160 85 msgid "View your blog statistics" 86 msgstr "" 87 88 #: plugins-test/piwik//index.php:167 80 89 msgid "Create a new Piwik site for this blog" 81 90 msgstr "" 82 91 83 #: plugins-test/piwik//index.php:1 5592 #: plugins-test/piwik//index.php:169 84 93 msgid "Site name:" 85 94 msgstr "" 86 95 87 #: plugins-test/piwik//index.php:1 5796 #: plugins-test/piwik//index.php:171 88 97 msgid "Site URL:" 89 98 msgstr "" 90 99 91 #: plugins-test/piwik//index.php:1 59100 #: plugins-test/piwik//index.php:173 92 101 msgid "create site" 93 102 msgstr "" -
plugins/piwik/locales/en/help.html
r206 r207 1 <p> Piwik is an open source (GPL license) web analytics software. It gives1 <p><em>Piwik is an open source (GPL license) web analytics software. It gives 2 2 interesting reports on your website visitors, your popular pages, the search 3 engines keywords they used, the language they speak and so much more.</ p>3 engines keywords they used, the language they speak and so much more.</em></p> 4 4 <p>Please visit <a href="http://piwik.org/">piwik.org</a> for download and more 5 5 information.</p> -
plugins/piwik/locales/fr/main.po
r203 r207 7 7 "Project-Id-Version: Dotclear 2 piwik module\n" 8 8 "Report-Msgid-Bugs-To: \n" 9 "POT-Creation-Date: 2008-06-1 8 11:18+0200\n"10 "PO-Revision-Date: 2008-06-1 8 11:19+0100\n"9 "POT-Creation-Date: 2008-06-19 11:13+0200\n" 10 "PO-Revision-Date: 2008-06-19 11:14+0100\n" 11 11 "Last-Translator: Olivier Meunier <olivier@dotclear.net>\n" 12 12 "Language-Team: \n" … … 22 22 msgstr "Réponse Piwik invalide." 23 23 24 #, fuzzy,php-format24 #, php-format 25 25 msgid "Piwik returned an error: %s" 26 26 msgstr "Piwik a renvoyé une erreur : %s" … … 62 62 msgstr "Utiliser des noms de page améliorés :" 63 63 64 #, php-format 65 msgid "Last visits graph on %s" 66 msgstr "Graphique des dernières visites sur %s" 67 68 msgid "View your blog statistics" 69 msgstr "Voir les statistiques de votre blog" 70 64 71 msgid "Create a new Piwik site for this blog" 65 72 msgstr "Créer un nouveau site Piwik pour ce blog"
Note: See TracChangeset
for help on using the changeset viewer.