Changeset 738
- Timestamp:
- 02/03/09 01:54:12 (14 years ago)
- Location:
- plugins/feedburner
- Files:
-
- 2 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/feedburner/_admin.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 if (!defined('DC_CONTEXT_ADMIN')) { return; } 13 14 -
plugins/feedburner/_define.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 if (!defined('DC_RC_PATH')) { return; } 13 14 14 15 $this->registerModule( 15 16 /* Name */ 'feedburner', 16 /* Description */ 'Display your feedburner statistics and readers',17 /* Author */ 'Thomas Bouron',18 /* Version */ '1.0-RC1',19 /* Permission */ 'usage,contentadmin'17 /* Description */ 'Displays your feedburner readers and statistics', 18 /* Author */ 'Tomtom (http://blog.zenstyle.fr/)', 19 /* Version */ '1.0-RC2', 20 /* Permission */ 'usage,contentadmin' 20 21 ); 21 22 -
plugins/feedburner/_feedburner.js
r634 r738 1 1 /* 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 */ 13 13 14 14 $(function() { 15 feeds = ['rss ','rssco','atom','atomco'];15 feeds = ['rss2','rss2_comments','atom','atom_comments']; 16 16 $.each(feeds,function(i) { 17 17 if ($("input[name='"+feeds[i]+"']").val().length > 0) { -
plugins/feedburner/_install.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 … … 21 21 # Création des settings 22 22 $feeds = array( 23 'rss ' => '',24 'rss co' => '',23 'rss2' => '', 24 'rss2_comments' => '', 25 25 'atom' => '', 26 'atom co' => ''26 'atom_comments' => '' 27 27 ); 28 28 $core->blog->settings->setNamespace('feedburner'); … … 36 36 'http://zenstyle.free.fr/dc2/', 37 37 'string','Secondary feedburner XML feed location',true,true 38 ); 39 $core->blog->settings->put( 40 'feedburner_base_url', 41 'http://feeds2.feedburner.com/', 42 'string','Base url for feedburner feeds',true,true 38 43 ); 39 44 $core->blog->settings->put( -
plugins/feedburner/_prepend.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 -
plugins/feedburner/_public.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 if (!defined('DC_RC_PATH')) { return; } 13 14 15 $core->addBehavior('publicBeforeDocument',array('feedburnerBehaviors','redirect')); 14 16 $core->url->register('feedburnerStatsExport','feedburnerStatsExport','^feedburner/stats/export$',array('feedburnerUrl','export')); 17 18 class feedburnerBehaviors 19 { 20 public static function redirect() 21 { 22 global $core; 23 24 $feeds = unserialize($core->blog->settings->feedburner_feeds); 25 26 preg_match('#^.*('.$core->url->getBase('feed').')/(rss2|atom)?/?(comments)?$#',$_SERVER['REQUEST_URI'],$matches); 27 28 $k = isset($matches[2]) ? $matches[2].(isset($matches[3]) ? '_'.$matches[3]: '') : ''; 29 30 if (array_key_exists($k,$feeds) && !empty($feeds[$k]) && !preg_match('#feedburner#i',$_SERVER['HTTP_USER_AGENT'])) { 31 http::redirect($core->blog->settings->feedburner_base_url.$feeds[$k]); 32 } 33 } 34 } 15 35 16 36 class feedburnerUrl … … 23 43 } 24 44 25 /**26 * Class feedburnerPublic27 */28 45 class feedburnerPublic 29 46 { … … 47 64 $datas = $fb->getDatas(); 48 65 49 if (count($fb->getErrors()) > 0) { return; }50 51 66 $text = str_replace(array('%readers%','%clics%'),array('%1$s','%2$s'),$w->text); 52 67 … … 54 69 '<div id="feedburner">'. 55 70 '<h2>'.$w->title.'</h2>'. 56 '<p>'.sprintf($text,$datas[0]['circulation'],$datas[0]['hits']).'</p>'. 71 (count($fb->getErrors()) > 0 ? '' : 72 '<p>'.sprintf($text,$datas[0]['circulation'],$datas[0]['hits']).'</p>'). 57 73 '<p><a href="http://feeds.feedburner.com/'. 58 74 $w->feed_id.'">'.$w->sign_up.'</a></p>'; 59 75 60 if ($w-> feed_int_id && is_numeric($w->feed_int_id)) {76 if ($w->email) { 61 77 $res .= 62 '<a href="http:// www.feedburner.com/fb/a/emailverifySubmit?feedId='.$w->feed_int_id.'">'.78 '<a href="http://feedburner.google.com/fb/a/mailverify?uri='.$w->feed_id.'">'. 63 79 $w->sign_up.' '.__('by mail').'</a>'; 64 80 } -
plugins/feedburner/_widgets.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 if (!defined('DC_RC_PATH')) { return; } 13 14 14 15 $core->addBehavior('initWidgets',array('feedburnerWidgets','initWidgets')); 15 16 16 /**17 * Class feedburnerWidgets18 */19 17 class feedburnerWidgets 20 18 { … … 26 24 public static function initWidgets(&$w) 27 25 { 26 global $core; 27 28 $feeds = unserialize($core->blog->settings->feedburner_feeds); 29 foreach ($feeds as $k => $v) { 30 if (empty($v)) { unset($feeds[$k]); } 31 } 32 28 33 $w->create('feedburner',__('Feedburner'),array('feedburnerPublic','widget')); 29 34 $w->feedburner->setting('title',__('Title:'),__('RSS feed')); 30 35 $w->feedburner->setting('text',__('Text:'),__('%readers% readers - %clics% clics')); 31 36 $w->feedburner->setting('sign_up',__('Sign up text:'),__('Sign up now')); 32 $w->feedburner->setting('feed_id',__('Feed ID:'),'');33 $w->feedburner->setting(' feed_int_id',__('Int feed ID (leave blank for disable):'),'');34 $w->feedburner->setting('homeonly',__('Home page only'), 1,'check');37 $w->feedburner->setting('feed_id',__('Feed:'),null,'combo',$feeds); 38 $w->feedburner->setting('email',__('Display link for feed email subscription:'),0,'check'); 39 $w->feedburner->setting('homeonly',__('Home page only'),0,'check'); 35 40 } 36 41 -
plugins/feedburner/inc/amstock/export.php
r634 r738 15 15 16 16 // create image object 17 $img = imagecreatetruecolor($width, $height); 17 try { 18 $img = imagecreatetruecolor($width, $height); 18 19 19 // populate image with pixels20 for ($y = 0; $y < $height; $y++) {21 22 20 // populate image with pixels 21 for ($y = 0; $y < $height; $y++) { 22 // innitialize 23 $x = 0; 23 24 24 25 25 // get row data 26 $row = explode(',', $data['r'.$y]); 26 27 27 28 29 30 31 28 // place row pixels 29 $cnt = sizeof($row); 30 for ($r = 0; $r < $cnt; $r++) { 31 // get pixel(s) data 32 $pixel = explode(':', $row[$r]); 32 33 33 34 35 36 37 34 // get color 35 $pixel[0] = str_pad($pixel[0], 6, '0', STR_PAD_LEFT); 36 $cr = hexdec(substr($pixel[0], 0, 2)); 37 $cg = hexdec(substr($pixel[0], 2, 2)); 38 $cb = hexdec(substr($pixel[0], 4, 2)); 38 39 39 40 41 42 43 44 45 46 40 // allocate color 41 $color = imagecolorallocate($img, $cr, $cg, $cb); 42 43 // place repeating pixels 44 $repeat = isset($pixel[1]) ? (int) $pixel[1] : 1; 45 for ($c = 0; $c < $repeat; $c++) { 46 // place pixel 47 imagesetpixel($img, $x, $y, $color); 47 48 48 // iterate column 49 $x++; 50 } 51 } 49 // iterate column 50 $x++; 51 } 52 } 53 } 54 55 // set proper content type 56 header('Content-type: image/'.$imgtype); 57 header('Content-Disposition: attachment; filename="chart.'.$imgtype.'"'); 58 59 // stream image 60 $function = 'image'.$imgtype; 61 if ($imgtype == 'gif') { 62 $function($img); 63 } 64 else { 65 $function($img, null, $imgquality); 66 } 67 68 // destroy 69 imagedestroy($img); 70 } 71 catch (Exception $e) { 72 echo $e->getMessage(); 52 73 } 53 74 54 // set proper content type55 header('Content-type: image/'.$imgtype);56 header('Content-Disposition: attachment; filename="chart.'.$imgtype.'"');57 58 // stream image59 $function = 'image'.$imgtype;60 if ($imgtype == 'gif') {61 $function($img);62 }63 else {64 $function($img, null, $imgquality);65 }66 67 // destroy68 imagedestroy($img);69 75 ?> -
plugins/feedburner/inc/class.feedburner.parser.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 /**14 * Class feedburnerParser15 */16 13 class feedburnerParser 17 14 { … … 36 33 37 34 $this->_parse(); 38 35 39 36 unset($data); 40 37 unset($this->xml); -
plugins/feedburner/inc/class.feedburner.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 … … 14 14 { 15 15 protected $core; 16 17 16 protected $primary_xml; 18 17 protected $secondary_xml; 19 20 18 protected $proxy; 21 19 protected $datas; 22 20 protected $errors; 23 21 protected $feeds; 24 22 25 23 /** 26 24 * Feedburner object constructor … … 30 28 public function __construct(&$core) 31 29 { 32 $this->core 30 $this->core =& $core; 33 31 $this->primary_xml = $core->blog->settings->feedburner_primary_xml; 34 32 $this->secondary_xml = $core->blog->settings->feedburner_secondary_xml; … … 48 46 protected function getXML($url) 49 47 { 50 try { 51 if (($parser = feedburnerReader::quickParse($this->primary_xml.$url,DC_TPL_CACHE,$this->proxy)) === false) { 52 if (($parser = feedburnerReader::quickParse($this->secondary_xml.$url,DC_TPL_CACHE,$this->proxy)) === false) { 53 return false; 54 } 48 $parser = false; 49 50 $urls = array( 51 'primary' => $this->primary_xml.$url, 52 'secondary' => $this->secondary_xml.$url 53 ); 54 55 $flag = false; 56 57 foreach ($urls as $k => $v) { 58 if ($flag) { 59 break; 55 60 } 61 try { 62 $parser = feedburnerReader::quickParse($v,DC_TPL_CACHE,$this->proxy); 63 $flag = true; 64 } 65 catch (Exception $e) { 66 $tab = explode(':',$e->getMessage()); 67 $this->errors = array( 68 'code' => trim($tab[0]), 69 'msg' => trim($tab[1]) 70 ); 71 $flag = false; 72 } 73 } 56 74 75 if ($parser === false) { 76 $this->errors = array( 77 'code' => 0, 78 'msg' => __('Impossible to retrieve the feed statistics') 79 ); 80 return false; 81 } 82 else { 57 83 $this->datas = $parser->getDatas(); 58 84 $this->errors = $parser->getError(); 59 60 85 return true; 61 }62 catch (Exception $e) {63 $tab = explode(':',$e->getMessage());64 $this->errors = array(65 'code' => trim($tab[0]),66 'msg' => trim($tab[1])67 );68 return false;69 86 } 70 87 } … … 106 123 return $this->datas; 107 124 } 108 125 109 126 /** 110 127 * Returns errors get by getXML … … 116 133 return $this->errors; 117 134 } 118 135 136 /** 137 * Returns feed list 138 * 139 * @return: array 140 */ 119 141 public function getFeeds() 120 142 { 121 143 return $this->feeds; 122 144 } 123 145 146 /** 147 * Returns csv data for amstock 148 * 149 * @return: csv 150 */ 124 151 public function getCsv() 125 152 { 126 153 header('Content-Type: text/plain'); 127 154 128 155 $tmp = 0; 129 156 130 157 foreach ($this->datas as $k => $v) { 131 158 if ($v['circulation'] != 0 && $v['hits'] != 0) { … … 135 162 } 136 163 } 137 164 138 165 exit; 139 166 } -
plugins/feedburner/inc/class.feedburner.reader.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 /**14 * Class feedburnerReader15 */16 13 class feedburnerReader extends netHttp 17 14 { 18 15 protected $user_agent = 'Dotclear feedburnerAPIReader/0.1'; 19 16 protected $timeout = 5; 17 protected $port = 443; 20 18 protected $validators = null; /// <b>array</b> HTTP Cache validators 21 19 protected $cache_dir = null; /// <b>string</b> Cache temporary directory … … 23 21 protected $cache_ttl = '-1 day'; /// <b>string</b> Cache TTL 24 22 25 /**26 * Class constructor27 */28 23 public function __construct() 29 24 { 30 parent::__construct('' );25 parent::__construct('',$this->port); 31 26 } 32 27 … … 47 42 return false; 48 43 } 49 44 50 45 return new feedburnerParser($this->getContent()); 51 46 } … … 61 56 $parser->setProxy($proxy); 62 57 } 63 58 64 59 return $parser->parse($url); 65 60 } 66 61 67 62 public function setCacheDir($dir) 68 63 { 69 64 $this->cache_dir = null; 70 65 71 66 if (!empty($dir) && is_dir($dir) && is_writeable($dir)) 72 67 { … … 74 69 return true; 75 70 } 76 71 77 72 return false; 78 73 } 79 74 80 75 public function setCacheTTL($str) 81 76 { … … 89 84 } 90 85 } 91 86 92 87 protected function getApiXML($url) 93 88 { … … 98 93 $this->useSSL($ssl); 99 94 $this->setAuthorization($user,$pass); 100 95 101 96 return $this->get($path); 102 97 } 103 98 104 99 protected function withCache($url) 105 100 { … … 112 107 $url_md5 113 108 ); 114 109 115 110 $may_use_cached = false; 116 111 117 112 if (@file_exists($cached_file)) 118 113 { … … 126 121 $this->setValidator('IfModifiedSince', $ts); 127 122 } 128 123 129 124 if (!$this->getApiXML($url)) 130 125 { … … 136 131 return false; 137 132 } 138 133 139 134 switch ($this->getStatus()) 140 135 { … … 150 145 return $modules; 151 146 } 152 147 153 148 if (($fp = @fopen($cached_file, 'wb'))) 154 149 { … … 160 155 } 161 156 } 162 157 163 158 return false; 164 159 } 165 160 166 161 protected function buildRequest() 167 162 { 168 163 $headers = parent::buildRequest(); 169 164 170 165 # Cache validators 171 166 if (!empty($this->validators)) … … 183 178 } 184 179 } 185 180 186 181 return $headers; 187 182 } 188 183 189 184 private function setValidator($key,$value) 190 185 { … … 192 187 $value = gmdate('D, d M Y H:i:s',$value).' GMT'; 193 188 } 194 189 195 190 $this->validators[$key] = $value; 196 191 } -
plugins/feedburner/inc/lib.feedburner.ui.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 /**14 * Class feedburnerUi15 */16 13 class feedburnerUi 17 14 { 18 /* 15 /** 19 16 * Diplays feeds table and form 20 17 * … … 27 24 { 28 25 global $core; 29 26 30 27 $res = 31 28 '<form action="'.$url.'" method="post">'. … … 42 39 foreach($feeds as $k => $v) 43 40 { 44 if ($k == 'rss ') {41 if ($k == 'rss2') { 45 42 $label = __('RSS entries feed'); 46 43 $type = 'rss2'; 47 44 } 48 if ($k == 'rss co') {45 if ($k == 'rss2_comments') { 49 46 $label = __('RSS comments feed'); 50 47 $type = 'rss2/comments'; … … 54 51 $type = 'atom'; 55 52 } 56 if ($k == 'atom co') {53 if ($k == 'atom_comments') { 57 54 $label = __('ATOM comments feed'); 58 55 $type = 'atom/comments'; 59 56 } 60 57 61 58 $res .= 62 59 '<tr class="line wide" id="feed_'.$k.'">'. … … 65 62 '</td>'."\n". 66 63 '<td class="maximal">'. 67 sprintf(__('Enter feed url for %s : http://feeds.feedburner.com/'),$label).64 sprintf(__('Enter feed url for the %s : %s'),$label,$core->blog->settings->feedburner_base_url). 68 65 form::field(array($k),30,255,$v). 69 66 '<p class="fb-note">'.sprintf( 70 __('You have to to set on feedburner website this feed URL : <strong>%s</strong>'),71 $core->blog->url.$core->url->getBase("feed").'/'.$type67 __('You have to set source on feedburner website on this URL : %s'), 68 '<strong>'.$core->blog->url.$core->url->getBase("feed").'/'.$type.'</strong>' 72 69 ).'</p>'. 73 70 '</td>'."\n". 74 71 '<td class="minimal">'; 75 72 $res .= !empty($v) ? 76 '<a href=" http://feeds.feedburner.com/'.$v.'">'.73 '<a href="'.$core->blog->settings->feedburner_base_url.$v.'">'. 77 74 '<img src="index.php?pf=feedburner/feed.png" alt="'.$k.'" title="'.$v.'" /></a>' 78 75 : ''; … … 85 82 '</tbody>'. 86 83 '</table>'. 87 '<p class="form-note">'.__('NOTICE: You have to enable the PRO option forfeeds to get statistics').'</p>'.84 '<p class="form-note">'.__('NOTICE: You have to enable the AWARENESS API option for ALL feeds to get statistics').'</p>'. 88 85 '<p class="col right">'. 89 86 $core->formNonce(). 90 87 '<input type="submit" value="'.__('Save setup').'" name="save" /></p>'. 91 88 '</form>'; 92 89 93 90 echo $res; 94 91 } … … 105 102 { 106 103 global $core; 107 104 108 105 $res[__('-- Activated feeds --')] = ''; 109 106 $default = !empty($_GET['id']) ? $_GET['id'] : ''; … … 114 111 115 112 echo 116 '<fieldset><legend>'.__(' View statistics feed').113 '<fieldset><legend>'.__('Statistics'). 117 114 '</legend>'. 118 115 '<form method="get" action="'.$url.'">'. … … 126 123 '</fieldset>'; 127 124 } 128 125 129 126 /** 130 127 * Displays all statistics … … 133 130 { 134 131 if (empty($_GET['view'])) { return; } 135 136 132 elseif(!empty($_GET['id'])) { 137 133 feedburnerUi::statsDayView(); 138 134 feedburnerUi::statsAllView(); 139 135 } 140 141 136 else { return; } 142 137 } … … 148 143 { 149 144 global $core,$fb,$nb_per_page,$p_url,$page; 150 145 151 146 $id = html::escapeHTML($_GET['id']); 152 153 echo '<h2>'.__('Statistics of yesterday - Global').'</h2>';154 147 155 148 $fb->check($id,'details'); … … 157 150 $errors = $fb->getErrors(); 158 151 152 $date = isset($datas[0]['date']) ? dt::str($core->blog->settings->date_format,strtotime($datas[0]['date'])) : __('your feed'); 153 154 echo '<h2>'.sprintf(__('Statistics of %s - Global'),$date).'</h2>'; 155 159 156 if (count($errors) == 0) { 160 echo '<h3>'.sprintf(__('Number of readers: %s'),$datas[0]['circulation']).'</h3>'; 161 echo '<h3>'.sprintf(__('Number of feed calling: %s'),$datas[0]['hits']).'</h3>'; 162 echo '<h3>'.sprintf(__('Read rate : %s%%'),$datas[0]['reach']).'</h3>'; 163 echo '<h3>'.sprintf(__('Date : %s'),dt::str($core->blog->settings->date_format,strtotime($datas[0]['date']))).'</h3>'; 157 echo isset($datas[0]['circulation']) ? '<h3>'.sprintf(__('Number of readers: %s'),$datas[0]['circulation']).'</h3>' : ''; 158 echo isset($datas[0]['hits']) ? '<h3>'.sprintf(__('Number of feed calling: %s'),$datas[0]['hits']).'</h3>' : ''; 159 echo isset($datas[0]['reach']) ? '<h3>'.sprintf(__('Read rate : %s%%'),$datas[0]['reach']).'</h3>' : ''; 164 160 } 165 161 166 162 echo getErrors($errors); 167 163 168 echo '<h2>'. __('Statistics of yesterday - Details').'</h2>';164 echo '<h2>'.sprintf(__('Statistics of %s - Details'),$date).'</h2>'; 169 165 170 166 if (count($errors) == 0) { … … 182 178 } 183 179 } 184 180 185 181 /** 186 182 * Displays details statistics … … 189 185 { 190 186 global $p_url; 191 187 192 188 $id = html::escapeHTML($_GET['id']); 193 189 194 190 echo 195 191 '<h2>'.__('Global statistics').'</h2>'."\n". 196 192 '<script type="text/javascript" src="'.$p_url.'&file=swfobject.js"></script>'."\n". 197 193 '<div id="flashcontent">'."\n". 198 '<strong> You need to upgrade your Flash Player</strong>'."\n".194 '<strong>'.__('You need to upgrade your Flash Player').'</strong>'."\n". 199 195 '</div>'."\n". 200 196 '<script type="text/javascript">'."\n". … … 235 231 236 232 if ($this->rs->isEmpty()) { 237 echo '<p><strong>'.__('No detail statistic for yesterday').'</strong></p>';233 echo '<p><strong>'.__('No detail statistics').'</strong></p>'; 238 234 } 239 235 else { … … 261 257 } 262 258 } 263 259 264 260 /** 265 261 * Returns day row -
plugins/feedburner/index.php
r634 r738 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 13 # Initialisation des variables 14 14 $nb_per_page = 5; 15 $p_url 16 $page 15 $p_url = 'plugin.php?p=feedburner'; 16 $page = !empty($_GET['page']) ? (integer)$_GET['page'] : 1; 17 17 $default_tab = !empty($_GET['tab']) ? trim(html::escapeHTML($_GET['tab'])) : 'feeds'; 18 $feeds 18 $feeds = unserialize($core->blog->settings->feedburner_feeds); 19 19 20 20 # Sert les fichiers de amchart … … 43 43 # Enregistrement de la configuration des flux 44 44 if (!empty($_POST['save'])) { 45 $feeds['rss '] = $feeds['rss'] != $_POST['rss'] ? $_POST['rss'] : $feeds['rss'];46 $feeds['rss co'] = $feeds['rssco'] != $_POST['rssco'] ? $_POST['rssco'] : $feeds['rssco'];45 $feeds['rss2'] = $feeds['rss2'] != $_POST['rss2'] ? $_POST['rss2'] : $feeds['rss2']; 46 $feeds['rss2_comments'] = $feeds['rss2_comments'] != $_POST['rss2_comments'] ? $_POST['rss2_comments'] : $feeds['rss2_comments']; 47 47 $feeds['atom'] = $feeds['atom'] != $_POST['atom'] ? $_POST['atom'] : $feeds['atom']; 48 $feeds['atom co'] = $feeds['atomco'] != $_POST['atomco'] ? $_POST['atomco'] : $feeds['atomco'];48 $feeds['atom_comments'] = $feeds['atom_comments'] != $_POST['atom_comments'] ? $_POST['atom_comments'] : $feeds['atom_comments']; 49 49 $core->blog->settings->setNamespace('feedburner'); 50 50 $core->blog->settings->put( … … 75 75 76 76 foreach ($errors as $k => $v) { 77 $res .= '<h3>'.sprintf(__('Error %1$s : %2$s'),$k, utf8_encode($v)).'</h3>';77 $res .= '<h3>'.sprintf(__('Error %1$s : %2$s'),$k,text::toUTF8($v)).'</h3>'; 78 78 } 79 79 80 80 return $res; 81 81 } -
plugins/feedburner/locales/fr/main.po
r634 r738 5 5 msgstr "Content-Type: text/plain; charset=UTF-8\n" 6 6 7 #: _admin.php:1 78 #: _widgets.php: 287 #: _admin.php:18 8 #: _widgets.php:33 9 9 msgid "Feedburner" 10 10 msgstr "Feedburner" 11 11 12 #: _public.php: 6312 #: _public.php:79 13 13 msgid "by mail" 14 14 msgstr "par mail" 15 15 16 #: _widgets.php: 2916 #: _widgets.php:34 17 17 msgid "RSS feed" 18 msgstr "Flu sRSS"19 20 #: _widgets.php:3 018 msgstr "Flux RSS" 19 20 #: _widgets.php:35 21 21 msgid "%readers% readers - %clics% clics" 22 22 msgstr "%readers% abonnés - %clics% clics" 23 23 24 #: _widgets.php:3 124 #: _widgets.php:36 25 25 msgid "Sign up text:" 26 26 msgstr "Texte d'abonnement :" 27 27 28 #: _widgets.php:3 128 #: _widgets.php:36 29 29 msgid "Sign up now" 30 30 msgstr "Abonnez vous maintenant" 31 31 32 #: _widgets.php:3 233 msgid "Feed ID:"34 msgstr " Identifiant du flux :"35 36 #: _widgets.php:3 337 msgid " Int feed ID (leave blank for disable):"38 msgstr " Identifiant du flux en chiffre - ex: 975478 (Laissez blanc pour désactiver cette option)"32 #: _widgets.php:37 33 msgid "Feed:" 34 msgstr "Flux :" 35 36 #: _widgets.php:38 37 msgid "Display link for feed email subscription:" 38 msgstr "Afficher le lien pour l'abonnement par email :" 39 39 40 40 #: inc/amstock/amstock_settings.php:109 … … 199 199 msgstr "Sam" 200 200 201 #: inc/lib.feedburner.ui.php:35 201 #: inc/class.feedburner.php:78 202 msgid "Impossible to retrieve the feed statistics" 203 msgstr "Impossible de récupérer les statistiques de ce flux" 204 205 #: inc/lib.feedburner.ui.php:32 202 206 msgid "Feed ID" 203 207 msgstr "Identifiant du flux" 204 208 205 #: inc/lib.feedburner.ui.php:3 6209 #: inc/lib.feedburner.ui.php:33 206 210 msgid "Feed URL" 207 211 msgstr "URL du flux" 208 212 209 #: inc/lib.feedburner.ui.php:3 7213 #: inc/lib.feedburner.ui.php:34 210 214 msgid "View feed" 211 215 msgstr "Voir le flux" 212 216 213 #: inc/lib.feedburner.ui.php:4 5217 #: inc/lib.feedburner.ui.php:42 214 218 msgid "RSS entries feed" 215 msgstr " Flux RSS des billets"216 217 #: inc/lib.feedburner.ui.php:4 9219 msgstr "flux RSS des billets" 220 221 #: inc/lib.feedburner.ui.php:46 218 222 msgid "RSS comments feed" 219 msgstr " Flux RSS des commentaires"220 221 #: inc/lib.feedburner.ui.php:5 3223 msgstr "flux RSS des commentaires" 224 225 #: inc/lib.feedburner.ui.php:50 222 226 msgid "ATOM entries feed" 223 msgstr " Flux ATOM des billets"224 225 #: inc/lib.feedburner.ui.php:5 7227 msgstr "flux ATOM des billets" 228 229 #: inc/lib.feedburner.ui.php:54 226 230 msgid "ATOM comments feed" 227 msgstr "Flux ATOM des commentaires" 231 msgstr "flux ATOM des commentaires" 232 233 #: inc/lib.feedburner.ui.php:64 234 msgid "Enter feed url for the %s : %s" 235 msgstr "Entrer l'URL pour le %s : %s" 228 236 229 237 #: inc/lib.feedburner.ui.php:67 230 msgid " Enter feed url for %s : http://feeds.feedburner.com/"231 msgstr " Entrez l'URL du flux pour %s : http://feeds.feedburner.com/"232 233 #: inc/lib.feedburner.ui.php: 70234 msgid " You have to to set on feedburner website this feed URL : <strong>%s</strong>"235 msgstr " Vous devez obligatoirement régler l'url source du flux sur le site de feedburner à l'adresse : <strong>%s</strong>"238 msgid "You have to set source on feedburner website on this URL : %s" 239 msgstr "Vous devez configurer la source du flux sur le site feedburner à cette URL : %s" 240 241 #: inc/lib.feedburner.ui.php:84 242 msgid "NOTICE: You have to enable the AWARENESS API option for ALL feeds to get statistics" 243 msgstr "ATTENTION : Vous devez obligatoirement activer l'option AWARENESS API sur tous vos flux pour obtenir les statistiques" 236 244 237 245 #: inc/lib.feedburner.ui.php:87 238 msgid "NOTICE: You have to enable the PRO option for feeds to get statistics"239 msgstr "ATTENTION ; Vous devez obligatoirement activer l'option PRO et API AWARENESS de feedburner pour TOUS vos flux"240 241 #: inc/lib.feedburner.ui.php:90242 246 msgid "Save setup" 243 247 msgstr "Enregistrer la configuration" 244 248 245 #: inc/lib.feedburner.ui.php:10 8249 #: inc/lib.feedburner.ui.php:105 246 250 msgid "-- Activated feeds --" 247 251 msgstr "-- Flux activés --" 248 252 249 #: inc/lib.feedburner.ui.php:11 6250 msgid " View statistics feed"251 msgstr " Voir les statistiques du flux"252 253 #: inc/lib.feedburner.ui.php:1 21253 #: inc/lib.feedburner.ui.php:113 254 msgid "Statistics" 255 msgstr "Statistiques" 256 257 #: inc/lib.feedburner.ui.php:118 254 258 msgid "Choose the feed:" 255 259 msgstr "Choisissez le flux :" 256 260 257 #: inc/lib.feedburner.ui.php:12 4258 #: inc/lib.feedburner.ui.php:17 6261 #: inc/lib.feedburner.ui.php:121 262 #: inc/lib.feedburner.ui.php:172 259 263 msgid "View" 260 264 msgstr "Voir" 261 265 262 #: inc/lib.feedburner.ui.php:153 263 msgid "Statistics of yesterday - Global" 264 msgstr "Statistiques d'hier - Globale" 265 266 #: inc/lib.feedburner.ui.php:160 266 #: inc/lib.feedburner.ui.php:152 267 msgid "your feed" 268 msgstr "votre flux" 269 270 #: inc/lib.feedburner.ui.php:154 271 msgid "Statistics of %s - Global" 272 msgstr "Statistiques de %s - Global" 273 274 #: inc/lib.feedburner.ui.php:157 267 275 msgid "Number of readers: %s" 268 276 msgstr "Nombre d'abonnés : %s" 269 277 270 #: inc/lib.feedburner.ui.php:1 61278 #: inc/lib.feedburner.ui.php:158 271 279 msgid "Number of feed calling: %s" 272 280 msgstr "Nombre d'appel au flux : %s" 273 281 274 #: inc/lib.feedburner.ui.php:1 62282 #: inc/lib.feedburner.ui.php:159 275 283 msgid "Read rate : %s%%" 276 284 msgstr "Taux de lecture : %s%%" 277 285 278 #: inc/lib.feedburner.ui.php:163 279 msgid "Date : %s" 280 msgstr "Date : %s" 281 282 #: inc/lib.feedburner.ui.php:168 283 msgid "Statistics of yesterday - Details" 284 msgstr "Statistiques d'hier - Détails" 285 286 #: inc/lib.feedburner.ui.php:195 286 #: inc/lib.feedburner.ui.php:164 287 msgid "Statistics of %s - Details" 288 msgstr "Statistiques de %s - Détails" 289 290 #: inc/lib.feedburner.ui.php:191 287 291 msgid "Global statistics" 288 292 msgstr "Statistiques globales" 289 293 290 #: inc/lib.feedburner.ui.php:228 294 #: inc/lib.feedburner.ui.php:194 295 msgid "You need to upgrade your Flash Player" 296 msgstr "Vous devez mettre à jour votre Flash player" 297 298 #: inc/lib.feedburner.ui.php:224 291 299 msgid "Read items" 292 300 msgstr "Items lus" 293 301 294 #: inc/lib.feedburner.ui.php:22 9295 #: inc/lib.feedburner.ui.php:28 5302 #: inc/lib.feedburner.ui.php:225 303 #: inc/lib.feedburner.ui.php:281 296 304 msgid "Item views" 297 305 msgstr "Items vus" 298 306 299 #: inc/lib.feedburner.ui.php:2 30300 #: inc/lib.feedburner.ui.php:28 7307 #: inc/lib.feedburner.ui.php:226 308 #: inc/lib.feedburner.ui.php:283 301 309 msgid "Click throughs" 302 310 msgstr "Clics" 303 311 304 #: inc/lib.feedburner.ui.php:23 7305 msgid "No detail statistic for yesterday"306 msgstr " Pas de statistique détaillée aujourd'hui"307 308 #: inc/lib.feedburner.ui.php:29 5312 #: inc/lib.feedburner.ui.php:233 313 msgid "No detail statistics" 314 msgstr "Aucun détail sur les statistiques" 315 316 #: inc/lib.feedburner.ui.php:291 309 317 msgid "Referrer(s):" 310 318 msgstr "Référent(s) :" … … 334 342 msgid "Feed statistics" 335 343 msgstr "Statistiques des flux" 336 337 msgid "Sign up now!"338 msgstr "Abonnez-vous maintenant!"339 340 msgid "Global statistics - Readers and Clics"341 msgstr "Statistiques globales - Abonnés et clics"342 343 msgid "Feed statistics : Readers and clics number"344 msgstr "Statistiques du flux : Nombre d'abonnés et de clics"345 346 msgid "Number of readers"347 msgstr "Nombre d'abonnés"348 349 msgid "Progress in %"350 msgstr "Progression depuis le début en %"351 352 msgid "Percent of feed reading / clicking: %s%%"353 msgstr "Pourcentage abonnés / clic du flux : %s%%"354 355 msgid "Collectiong data ..."356 msgstr "Récupération des données ..." -
plugins/feedburner/style.css
r634 r738 1 1 /* 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 4 # This file is part of plugin feedburner for Dotclear 2. 5 # Copyright (c) 2008 Thomas Bouron. 6 # 3 # This file is part of feedburner, a plugin for Dotclear. 4 # 5 # Copyright (c) 2009 Tomtom 6 # http://blog.zenstyle.fr/ 7 # 7 8 # Licensed under the GPL version 2.0 license. 8 # See LICENSE file or9 # A copy of this license is available in LICENSE file or at 9 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 #11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 */
Note: See TracChangeset
for help on using the changeset viewer.