Dotclear

Changeset 738


Ignore:
Timestamp:
02/03/09 01:54:12 (14 years ago)
Author:
Tomtom33
Message:

feedburner plugin - Version 1.0-RC2 :

  • Corrected blocks licence
  • Fixed OVH bug queries for statistics
  • Fixed typos
  • Added email subscription option on widget
  • Added tansparent redirection on feedburner feed from base feed URL
Location:
plugins/feedburner
Files:
2 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • plugins/feedburner/_admin.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1314 
  • plugins/feedburner/_define.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) { return; } 
    1314 
    1415$this->registerModule( 
    1516          /* 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' 
    2021); 
    2122 
  • plugins/feedburner/_feedburner.js

    r634 r738  
    11/* 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212*/ 
    1313 
    1414$(function() { 
    15      feeds = ['rss','rssco','atom','atomco']; 
     15     feeds = ['rss2','rss2_comments','atom','atom_comments']; 
    1616     $.each(feeds,function(i) {  
    1717          if ($("input[name='"+feeds[i]+"']").val().length > 0) { 
  • plugins/feedburner/_install.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
     
    2121# Création des settings 
    2222$feeds = array( 
    23      'rss' => '', 
    24      'rssco' => '', 
     23     'rss2' => '', 
     24     'rss2_comments' => '', 
    2525     'atom' => '', 
    26      'atomco' => '' 
     26     'atom_comments' => '' 
    2727); 
    2828$core->blog->settings->setNamespace('feedburner'); 
     
    3636     'http://zenstyle.free.fr/dc2/', 
    3737     '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 
    3843); 
    3944$core->blog->settings->put( 
  • plugins/feedburner/_prepend.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
  • plugins/feedburner/_public.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) { return; } 
    1314 
     15$core->addBehavior('publicBeforeDocument',array('feedburnerBehaviors','redirect')); 
    1416$core->url->register('feedburnerStatsExport','feedburnerStatsExport','^feedburner/stats/export$',array('feedburnerUrl','export')); 
     17 
     18class 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} 
    1535 
    1636class feedburnerUrl 
     
    2343} 
    2444 
    25 /** 
    26  * Class feedburnerPublic 
    27  */ 
    2845class feedburnerPublic 
    2946{ 
     
    4764          $datas = $fb->getDatas(); 
    4865 
    49           if (count($fb->getErrors()) > 0) { return; } 
    50  
    5166          $text = str_replace(array('%readers%','%clics%'),array('%1$s','%2$s'),$w->text); 
    5267 
     
    5469               '<div id="feedburner">'. 
    5570               '<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>'). 
    5773               '<p><a href="http://feeds.feedburner.com/'. 
    5874               $w->feed_id.'">'.$w->sign_up.'</a></p>'; 
    5975                
    60           if ($w->feed_int_id && is_numeric($w->feed_int_id)) { 
     76          if ($w->email) { 
    6177               $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.'">'. 
    6379                    $w->sign_up.' '.__('by mail').'</a>'; 
    6480          } 
  • plugins/feedburner/_widgets.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) { return; } 
    1314 
    1415$core->addBehavior('initWidgets',array('feedburnerWidgets','initWidgets')); 
    1516 
    16 /** 
    17  * Class feedburnerWidgets 
    18  */ 
    1917class feedburnerWidgets 
    2018{ 
     
    2624     public static function initWidgets(&$w) 
    2725     { 
     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 
    2833          $w->create('feedburner',__('Feedburner'),array('feedburnerPublic','widget')); 
    2934          $w->feedburner->setting('title',__('Title:'),__('RSS feed')); 
    3035          $w->feedburner->setting('text',__('Text:'),__('%readers% readers - %clics% clics')); 
    3136          $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'); 
    3540     } 
    3641 
  • plugins/feedburner/inc/amstock/export.php

    r634 r738  
    1515 
    1616// create image object 
    17 $img = imagecreatetruecolor($width, $height); 
     17try { 
     18     $img = imagecreatetruecolor($width, $height); 
    1819 
    19 // populate image with pixels 
    20 for ($y = 0; $y < $height; $y++) { 
    21   // innitialize 
    22   $x = 0; 
     20     // populate image with pixels 
     21     for ($y = 0; $y < $height; $y++) { 
     22          // innitialize 
     23          $x = 0; 
    2324   
    24   // get row data 
    25   $row = explode(',', $data['r'.$y]); 
     25          // get row data 
     26          $row = explode(',', $data['r'.$y]); 
    2627   
    27   // place row pixels 
    28   $cnt = sizeof($row); 
    29   for ($r = 0; $r < $cnt; $r++) { 
    30     // get pixel(s) data 
    31     $pixel = explode(':', $row[$r]); 
     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]); 
    3233     
    33     // get color 
    34     $pixel[0] = str_pad($pixel[0], 6, '0', STR_PAD_LEFT); 
    35     $cr = hexdec(substr($pixel[0], 0, 2)); 
    36     $cg = hexdec(substr($pixel[0], 2, 2)); 
    37     $cb = hexdec(substr($pixel[0], 4, 2)); 
     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)); 
    3839     
    39     // allocate color 
    40     $color = imagecolorallocate($img, $cr, $cg, $cb); 
    41      
    42     // place repeating pixels 
    43     $repeat = isset($pixel[1]) ? (int) $pixel[1] : 1; 
    44     for ($c = 0; $c < $repeat; $c++) { 
    45       // place pixel 
    46       imagesetpixel($img, $x, $y, $color); 
     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); 
    4748       
    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} 
     71catch (Exception $e) { 
     72     echo $e->getMessage(); 
    5273} 
    5374 
    54 // set proper content type 
    55 header('Content-type: image/'.$imgtype); 
    56 header('Content-Disposition: attachment; filename="chart.'.$imgtype.'"'); 
    57  
    58 // stream image 
    59 $function = 'image'.$imgtype; 
    60 if ($imgtype == 'gif') { 
    61   $function($img); 
    62 } 
    63 else { 
    64   $function($img, null, $imgquality); 
    65 } 
    66  
    67 // destroy 
    68 imagedestroy($img); 
    6975?> 
  • plugins/feedburner/inc/class.feedburner.parser.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
    13 /** 
    14  * Class feedburnerParser 
    15  */ 
    1613class feedburnerParser 
    1714{ 
     
    3633 
    3734          $this->_parse(); 
    38            
     35 
    3936          unset($data); 
    4037          unset($this->xml); 
  • plugins/feedburner/inc/class.feedburner.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
     
    1414{ 
    1515     protected $core; 
    16       
    1716     protected $primary_xml; 
    1817     protected $secondary_xml; 
    19       
    2018     protected $proxy; 
    2119     protected $datas; 
    2220     protected $errors; 
    2321     protected $feeds; 
    24       
     22 
    2523     /** 
    2624      * Feedburner object constructor 
     
    3028     public function __construct(&$core) 
    3129     { 
    32           $this->core                   =& $core; 
     30          $this->core              =& $core; 
    3331          $this->primary_xml       = $core->blog->settings->feedburner_primary_xml; 
    3432          $this->secondary_xml     = $core->blog->settings->feedburner_secondary_xml; 
     
    4846     protected function getXML($url) 
    4947     { 
    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; 
    5560               } 
     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          } 
    5674 
     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 { 
    5783               $this->datas = $parser->getDatas(); 
    5884               $this->errors = $parser->getError(); 
    59  
    6085               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; 
    6986          } 
    7087     } 
     
    106123          return $this->datas; 
    107124     } 
    108       
     125 
    109126     /** 
    110127      * Returns errors get by getXML 
     
    116133          return $this->errors; 
    117134     } 
    118       
     135 
     136     /** 
     137      * Returns feed list 
     138      * 
     139      * @return:    array 
     140      */ 
    119141     public function getFeeds() 
    120142     { 
    121143          return $this->feeds; 
    122144     } 
    123       
     145 
     146     /** 
     147      * Returns csv data for amstock 
     148      * 
     149      * @return:    csv 
     150      */ 
    124151     public function getCsv() 
    125152     { 
    126153          header('Content-Type: text/plain'); 
    127            
     154 
    128155          $tmp = 0; 
    129            
     156 
    130157          foreach ($this->datas as $k => $v) { 
    131158               if ($v['circulation'] != 0 && $v['hits'] != 0) { 
     
    135162               } 
    136163          } 
    137            
     164 
    138165          exit; 
    139166     } 
  • plugins/feedburner/inc/class.feedburner.reader.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
    13 /** 
    14  * Class feedburnerReader 
    15  */ 
    1613class feedburnerReader extends netHttp 
    1714{ 
    1815     protected $user_agent         = 'Dotclear feedburnerAPIReader/0.1'; 
    1916     protected $timeout            = 5; 
     17     protected $port               = 443; 
    2018     protected $validators         = null;                       /// <b>array</b>    HTTP Cache validators 
    2119     protected $cache_dir          = null;                       /// <b>string</b>   Cache temporary directory 
     
    2321     protected $cache_ttl          = '-1 day';                   /// <b>string</b>   Cache TTL 
    2422 
    25      /** 
    26       * Class constructor 
    27       */ 
    2823     public function __construct() 
    2924     { 
    30           parent::__construct(''); 
     25          parent::__construct('',$this->port); 
    3126     } 
    3227 
     
    4742                    return false; 
    4843               } 
    49                 
     44 
    5045               return new feedburnerParser($this->getContent()); 
    5146          } 
     
    6156               $parser->setProxy($proxy); 
    6257          } 
    63            
     58 
    6459          return $parser->parse($url); 
    6560     } 
    66       
     61 
    6762     public function setCacheDir($dir) 
    6863     { 
    6964          $this->cache_dir = null; 
    70            
     65 
    7166          if (!empty($dir) && is_dir($dir) && is_writeable($dir)) 
    7267          { 
     
    7469               return true; 
    7570          } 
    76            
     71 
    7772          return false; 
    7873     } 
    79       
     74 
    8075     public function setCacheTTL($str) 
    8176     { 
     
    8984          } 
    9085     } 
    91       
     86 
    9287     protected function getApiXML($url) 
    9388     { 
     
    9893          $this->useSSL($ssl); 
    9994          $this->setAuthorization($user,$pass); 
    100            
     95 
    10196          return $this->get($path); 
    10297     } 
    103       
     98 
    10499     protected function withCache($url) 
    105100     { 
     
    112107               $url_md5 
    113108          ); 
    114            
     109 
    115110          $may_use_cached = false; 
    116            
     111 
    117112          if (@file_exists($cached_file)) 
    118113          { 
     
    126121               $this->setValidator('IfModifiedSince', $ts); 
    127122          } 
    128            
     123 
    129124          if (!$this->getApiXML($url)) 
    130125          { 
     
    136131               return false; 
    137132          } 
    138            
     133 
    139134          switch ($this->getStatus()) 
    140135          { 
     
    150145                              return $modules; 
    151146                         } 
    152                           
     147 
    153148                         if (($fp = @fopen($cached_file, 'wb'))) 
    154149                         { 
     
    160155                    } 
    161156          } 
    162            
     157 
    163158          return false; 
    164159     } 
    165       
     160 
    166161     protected function buildRequest() 
    167162     { 
    168163          $headers = parent::buildRequest(); 
    169            
     164 
    170165          # Cache validators 
    171166          if (!empty($this->validators)) 
     
    183178               } 
    184179          } 
    185            
     180 
    186181          return $headers; 
    187182     } 
    188       
     183 
    189184     private function setValidator($key,$value) 
    190185     { 
     
    192187               $value = gmdate('D, d M Y H:i:s',$value).' GMT'; 
    193188          } 
    194            
     189 
    195190          $this->validators[$key] = $value; 
    196191     } 
  • plugins/feedburner/inc/lib.feedburner.ui.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
    13 /** 
    14  * Class feedburnerUi 
    15  */ 
    1613class feedburnerUi 
    1714{ 
    18      /* 
     15     /** 
    1916      * Diplays feeds table and form 
    2017      * 
     
    2724     { 
    2825          global $core; 
    29            
     26 
    3027          $res = 
    3128               '<form action="'.$url.'" method="post">'. 
     
    4239          foreach($feeds as $k => $v) 
    4340          { 
    44                if ($k == 'rss') { 
     41               if ($k == 'rss2') { 
    4542                    $label = __('RSS entries feed'); 
    4643                    $type = 'rss2'; 
    4744               } 
    48                if ($k == 'rssco') { 
     45               if ($k == 'rss2_comments') { 
    4946                    $label = __('RSS comments feed'); 
    5047                    $type = 'rss2/comments'; 
     
    5451                    $type = 'atom'; 
    5552               } 
    56                if ($k == 'atomco') { 
     53               if ($k == 'atom_comments') { 
    5754                    $label = __('ATOM comments feed'); 
    5855                    $type = 'atom/comments'; 
    5956               } 
    60                 
     57 
    6158               $res .= 
    6259                    '<tr class="line wide" id="feed_'.$k.'">'. 
     
    6562                    '</td>'."\n". 
    6663                    '<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). 
    6865                    form::field(array($k),30,255,$v). 
    6966                    '<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").'/'.$type 
     67                         __('You have to set source on feedburner website on this URL : %s'), 
     68                         '<strong>'.$core->blog->url.$core->url->getBase("feed").'/'.$type.'</strong>' 
    7269                    ).'</p>'. 
    7370                    '</td>'."\n". 
    7471                    '<td class="minimal">'; 
    7572               $res .= !empty($v) ? 
    76                     '<a href="http://feeds.feedburner.com/'.$v.'">'. 
     73                    '<a href="'.$core->blog->settings->feedburner_base_url.$v.'">'. 
    7774                    '<img src="index.php?pf=feedburner/feed.png" alt="'.$k.'" title="'.$v.'" /></a>' 
    7875                    : ''; 
     
    8582               '</tbody>'. 
    8683               '</table>'. 
    87                '<p class="form-note">'.__('NOTICE: You have to enable the PRO option for feeds 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>'. 
    8885               '<p class="col right">'. 
    8986               $core->formNonce(). 
    9087               '<input type="submit" value="'.__('Save setup').'" name="save" /></p>'. 
    9188               '</form>'; 
    92                 
     89 
    9390          echo $res; 
    9491     } 
     
    105102     { 
    106103          global $core; 
    107            
     104 
    108105          $res[__('-- Activated feeds --')] = ''; 
    109106          $default = !empty($_GET['id']) ? $_GET['id'] : ''; 
     
    114111 
    115112          echo 
    116                '<fieldset><legend>'.__('View statistics feed'). 
     113               '<fieldset><legend>'.__('Statistics'). 
    117114               '</legend>'. 
    118115               '<form method="get" action="'.$url.'">'. 
     
    126123               '</fieldset>'; 
    127124     } 
    128       
     125 
    129126     /** 
    130127      * Displays all statistics 
     
    133130     { 
    134131          if (empty($_GET['view'])) { return; } 
    135            
    136132          elseif(!empty($_GET['id'])) { 
    137133               feedburnerUi::statsDayView(); 
    138134               feedburnerUi::statsAllView(); 
    139135          } 
    140            
    141136          else { return; } 
    142137     } 
     
    148143     { 
    149144          global $core,$fb,$nb_per_page,$p_url,$page; 
    150            
     145 
    151146          $id = html::escapeHTML($_GET['id']); 
    152            
    153           echo '<h2>'.__('Statistics of yesterday - Global').'</h2>'; 
    154147 
    155148          $fb->check($id,'details'); 
     
    157150          $errors = $fb->getErrors(); 
    158151 
     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 
    159156          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>' : ''; 
    164160          } 
    165161 
    166162          echo getErrors($errors); 
    167163 
    168           echo '<h2>'.__('Statistics of yesterday - Details').'</h2>'; 
     164          echo '<h2>'.sprintf(__('Statistics of %s - Details'),$date).'</h2>'; 
    169165 
    170166          if (count($errors) == 0) { 
     
    182178          } 
    183179     } 
    184       
     180 
    185181     /** 
    186182      * Displays details statistics 
     
    189185     { 
    190186          global $p_url; 
    191            
     187 
    192188          $id = html::escapeHTML($_GET['id']); 
    193            
     189 
    194190          echo 
    195191               '<h2>'.__('Global statistics').'</h2>'."\n". 
    196192               '<script type="text/javascript" src="'.$p_url.'&amp;file=swfobject.js"></script>'."\n". 
    197193               '<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". 
    199195               '</div>'."\n". 
    200196               '<script type="text/javascript">'."\n". 
     
    235231 
    236232          if ($this->rs->isEmpty()) { 
    237                echo '<p><strong>'.__('No detail statistic for yesterday').'</strong></p>'; 
     233               echo '<p><strong>'.__('No detail statistics').'</strong></p>'; 
    238234          } 
    239235          else { 
     
    261257          } 
    262258     } 
    263       
     259 
    264260     /** 
    265261      * Returns day row 
  • plugins/feedburner/index.php

    r634 r738  
    11<?php 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
    1313# Initialisation des variables 
    1414$nb_per_page        = 5; 
    15 $p_url                   = 'plugin.php?p=feedburner'; 
    16 $page                    = !empty($_GET['page']) ? (integer)$_GET['page'] : 1; 
     15$p_url              = 'plugin.php?p=feedburner'; 
     16$page               = !empty($_GET['page']) ? (integer)$_GET['page'] : 1; 
    1717$default_tab        = !empty($_GET['tab']) ? trim(html::escapeHTML($_GET['tab'])) : 'feeds'; 
    18 $feeds                   = unserialize($core->blog->settings->feedburner_feeds); 
     18$feeds              = unserialize($core->blog->settings->feedburner_feeds); 
    1919 
    2020# Sert les fichiers de amchart 
     
    4343# Enregistrement de la configuration des flux 
    4444if (!empty($_POST['save'])) { 
    45      $feeds['rss'] = $feeds['rss'] != $_POST['rss'] ? $_POST['rss'] : $feeds['rss']; 
    46      $feeds['rssco'] = $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']; 
    4747     $feeds['atom'] = $feeds['atom'] != $_POST['atom'] ? $_POST['atom'] : $feeds['atom']; 
    48      $feeds['atomco'] = $feeds['atomco'] != $_POST['atomco'] ? $_POST['atomco'] : $feeds['atomco']; 
     48     $feeds['atom_comments'] = $feeds['atom_comments'] != $_POST['atom_comments'] ? $_POST['atom_comments'] : $feeds['atom_comments']; 
    4949     $core->blog->settings->setNamespace('feedburner'); 
    5050     $core->blog->settings->put( 
     
    7575      
    7676     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>'; 
    7878     } 
    79       
     79 
    8080     return $res; 
    8181} 
  • plugins/feedburner/locales/fr/main.po

    r634 r738  
    55msgstr "Content-Type: text/plain; charset=UTF-8\n" 
    66 
    7 #: _admin.php:17 
    8 #: _widgets.php:28 
     7#: _admin.php:18 
     8#: _widgets.php:33 
    99msgid "Feedburner" 
    1010msgstr "Feedburner" 
    1111 
    12 #: _public.php:63 
     12#: _public.php:79 
    1313msgid "by mail" 
    1414msgstr "par mail" 
    1515 
    16 #: _widgets.php:29 
     16#: _widgets.php:34 
    1717msgid "RSS feed" 
    18 msgstr "Flus RSS" 
    19  
    20 #: _widgets.php:30 
     18msgstr "Flux RSS" 
     19 
     20#: _widgets.php:35 
    2121msgid "%readers% readers - %clics% clics" 
    2222msgstr "%readers% abonnés - %clics% clics" 
    2323 
    24 #: _widgets.php:31 
     24#: _widgets.php:36 
    2525msgid "Sign up text:" 
    2626msgstr "Texte d'abonnement :" 
    2727 
    28 #: _widgets.php:31 
     28#: _widgets.php:36 
    2929msgid "Sign up now" 
    3030msgstr "Abonnez vous maintenant" 
    3131 
    32 #: _widgets.php:32 
    33 msgid "Feed ID:" 
    34 msgstr "Identifiant du flux :" 
    35  
    36 #: _widgets.php:33 
    37 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 
     33msgid "Feed:" 
     34msgstr "Flux :" 
     35 
     36#: _widgets.php:38 
     37msgid "Display link for feed email subscription:" 
     38msgstr "Afficher le lien pour l'abonnement par email :" 
    3939 
    4040#: inc/amstock/amstock_settings.php:109 
     
    199199msgstr "Sam" 
    200200 
    201 #: inc/lib.feedburner.ui.php:35 
     201#: inc/class.feedburner.php:78 
     202msgid "Impossible to retrieve the feed statistics" 
     203msgstr "Impossible de récupérer les statistiques de ce flux" 
     204 
     205#: inc/lib.feedburner.ui.php:32 
    202206msgid "Feed ID" 
    203207msgstr "Identifiant du flux" 
    204208 
    205 #: inc/lib.feedburner.ui.php:36 
     209#: inc/lib.feedburner.ui.php:33 
    206210msgid "Feed URL" 
    207211msgstr "URL du flux" 
    208212 
    209 #: inc/lib.feedburner.ui.php:37 
     213#: inc/lib.feedburner.ui.php:34 
    210214msgid "View feed" 
    211215msgstr "Voir le flux" 
    212216 
    213 #: inc/lib.feedburner.ui.php:45 
     217#: inc/lib.feedburner.ui.php:42 
    214218msgid "RSS entries feed" 
    215 msgstr "Flux RSS des billets" 
    216  
    217 #: inc/lib.feedburner.ui.php:49 
     219msgstr "flux RSS des billets" 
     220 
     221#: inc/lib.feedburner.ui.php:46 
    218222msgid "RSS comments feed" 
    219 msgstr "Flux RSS des commentaires" 
    220  
    221 #: inc/lib.feedburner.ui.php:53 
     223msgstr "flux RSS des commentaires" 
     224 
     225#: inc/lib.feedburner.ui.php:50 
    222226msgid "ATOM entries feed" 
    223 msgstr "Flux ATOM des billets" 
    224  
    225 #: inc/lib.feedburner.ui.php:57 
     227msgstr "flux ATOM des billets" 
     228 
     229#: inc/lib.feedburner.ui.php:54 
    226230msgid "ATOM comments feed" 
    227 msgstr "Flux ATOM des commentaires" 
     231msgstr "flux ATOM des commentaires" 
     232 
     233#: inc/lib.feedburner.ui.php:64 
     234msgid "Enter feed url for the %s : %s" 
     235msgstr "Entrer l'URL pour le %s : %s" 
    228236 
    229237#: 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:70 
    234 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>" 
     238msgid "You have to set source on feedburner website on this URL : %s" 
     239msgstr "Vous devez configurer la source du flux sur le site feedburner à cette URL : %s" 
     240 
     241#: inc/lib.feedburner.ui.php:84 
     242msgid "NOTICE: You have to enable the AWARENESS API option for ALL feeds to get statistics" 
     243msgstr "ATTENTION : Vous devez obligatoirement activer l'option AWARENESS API sur tous vos flux pour obtenir les statistiques" 
    236244 
    237245#: 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:90 
    242246msgid "Save setup" 
    243247msgstr "Enregistrer la configuration" 
    244248 
    245 #: inc/lib.feedburner.ui.php:108 
     249#: inc/lib.feedburner.ui.php:105 
    246250msgid "-- Activated feeds --" 
    247251msgstr "-- Flux activés --" 
    248252 
    249 #: inc/lib.feedburner.ui.php:116 
    250 msgid "View statistics feed" 
    251 msgstr "Voir les statistiques du flux" 
    252  
    253 #: inc/lib.feedburner.ui.php:121 
     253#: inc/lib.feedburner.ui.php:113 
     254msgid "Statistics" 
     255msgstr "Statistiques" 
     256 
     257#: inc/lib.feedburner.ui.php:118 
    254258msgid "Choose the feed:" 
    255259msgstr "Choisissez le flux :" 
    256260 
    257 #: inc/lib.feedburner.ui.php:124 
    258 #: inc/lib.feedburner.ui.php:176 
     261#: inc/lib.feedburner.ui.php:121 
     262#: inc/lib.feedburner.ui.php:172 
    259263msgid "View" 
    260264msgstr "Voir" 
    261265 
    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 
     267msgid "your feed" 
     268msgstr "votre flux" 
     269 
     270#: inc/lib.feedburner.ui.php:154 
     271msgid "Statistics of %s - Global" 
     272msgstr "Statistiques de %s - Global" 
     273 
     274#: inc/lib.feedburner.ui.php:157 
    267275msgid "Number of readers: %s" 
    268276msgstr "Nombre d'abonnés : %s" 
    269277 
    270 #: inc/lib.feedburner.ui.php:161 
     278#: inc/lib.feedburner.ui.php:158 
    271279msgid "Number of feed calling: %s" 
    272280msgstr "Nombre d'appel au flux : %s" 
    273281 
    274 #: inc/lib.feedburner.ui.php:162 
     282#: inc/lib.feedburner.ui.php:159 
    275283msgid "Read rate : %s%%" 
    276284msgstr "Taux de lecture : %s%%" 
    277285 
    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 
     287msgid "Statistics of %s - Details" 
     288msgstr "Statistiques de %s - Détails" 
     289 
     290#: inc/lib.feedburner.ui.php:191 
    287291msgid "Global statistics" 
    288292msgstr "Statistiques globales" 
    289293 
    290 #: inc/lib.feedburner.ui.php:228 
     294#: inc/lib.feedburner.ui.php:194 
     295msgid "You need to upgrade your Flash Player" 
     296msgstr "Vous devez mettre à jour votre Flash player" 
     297 
     298#: inc/lib.feedburner.ui.php:224 
    291299msgid "Read items" 
    292300msgstr "Items lus" 
    293301 
    294 #: inc/lib.feedburner.ui.php:229 
    295 #: inc/lib.feedburner.ui.php:285 
     302#: inc/lib.feedburner.ui.php:225 
     303#: inc/lib.feedburner.ui.php:281 
    296304msgid "Item views" 
    297305msgstr "Items vus" 
    298306 
    299 #: inc/lib.feedburner.ui.php:230 
    300 #: inc/lib.feedburner.ui.php:287 
     307#: inc/lib.feedburner.ui.php:226 
     308#: inc/lib.feedburner.ui.php:283 
    301309msgid "Click throughs" 
    302310msgstr "Clics" 
    303311 
    304 #: inc/lib.feedburner.ui.php:237 
    305 msgid "No detail statistic for yesterday" 
    306 msgstr "Pas de statistique détaillée aujourd'hui" 
    307  
    308 #: inc/lib.feedburner.ui.php:295 
     312#: inc/lib.feedburner.ui.php:233 
     313msgid "No detail statistics" 
     314msgstr "Aucun détail sur les statistiques" 
     315 
     316#: inc/lib.feedburner.ui.php:291 
    309317msgid "Referrer(s):" 
    310318msgstr "Référent(s) :" 
     
    334342msgid "Feed statistics" 
    335343msgstr "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  
    11/* 
    22# -- 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#  
    78# Licensed under the GPL version 2.0 license. 
    8 # See LICENSE file or 
     9# A copy of this license is available in LICENSE file or at 
    910# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    10 # 
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212*/ 
Note: See TracChangeset for help on using the changeset viewer.

Sites map