Dotclear

Changeset 2447


Ignore:
Timestamp:
07/05/10 11:49:25 (13 years ago)
Author:
Tomtom33
Message:

feedburner 1.0.5 :

  • DC 2.2 compliance
  • Updates license blocks
Location:
plugins/feedburner/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • plugins/feedburner/trunk/_admin.php

    r1634 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/feedburner/trunk/_define.php

    r1634 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    1717          /* Description */        'Displays your feedburner readers and statistics', 
    1818          /* Author */             'Tomtom (http://blog.zenstyle.fr/)', 
    19           /* Version */            '1.0.4', 
     19          /* Version */            '1.0.5', 
    2020          /* Permission */         'usage,contentadmin' 
    2121); 
  • plugins/feedburner/trunk/_install.php

    r1634 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    2626     'atom_comments' => '' 
    2727); 
    28 $core->blog->settings->setNamespace('feedburner'); 
    29 $core->blog->settings->put( 
     28$core->blog->settings->addNamespace('feedburner'); 
     29$core->blog->settings->feedburner->put( 
    3030     'feedburner_primary_xml', 
    3131     'https://feedburner.google.com/api/awareness/1.0/', 
    3232     'string','Primary feedburner XML feed location',true,true 
    3333); 
    34 $core->blog->settings->put( 
     34$core->blog->settings->feedburner->put( 
    3535     'feedburner_secondary_xml', 
    3636     'http://zenstyle.free.fr/dc2/', 
    3737     'string','Secondary feedburner XML feed location',true,true 
    3838); 
    39 $core->blog->settings->put( 
     39$core->blog->settings->feedburner->put( 
    4040     'feedburner_base_url', 
    4141     'http://feeds2.feedburner.com/', 
    4242     'string','Base url for feedburner feeds',true,true 
    4343); 
    44 $core->blog->settings->put( 
     44$core->blog->settings->feedburner->put( 
    4545     'feedburner_feeds', 
    4646     serialize($feeds), 
    4747     'string','Feeds list',false,true 
    4848); 
    49 $core->blog->settings->put( 
     49$core->blog->settings->feedburner->put( 
    5050     'feedburner_proxy', 
    5151     '', 
    52      'string','Proxy host to get feedburner API XML',true,true 
     52     'string','Proxy host to get feedburner API XML',false,true 
    5353); 
    5454 
  • plugins/feedburner/trunk/_prepend.php

    r1634 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/feedburner/trunk/_public.php

    r1688 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    2121          global $core; 
    2222 
    23           $feeds = unserialize($core->blog->settings->feedburner_feeds); 
     23          $feeds = unserialize($core->blog->settings->feedburner->feedburner_feeds); 
    2424 
    2525          preg_match('#^.*('.$core->url->getBase('feed').')/(rss2|atom)?/?(comments)?$#',$_SERVER['REQUEST_URI'],$matches); 
     
    2828 
    2929          if (array_key_exists($k,$feeds) && !empty($feeds[$k]) && !preg_match('#feedburner#i',$_SERVER['HTTP_USER_AGENT'])) { 
    30                http::redirect($core->blog->settings->feedburner_base_url.$feeds[$k]); 
     30               http::redirect($core->blog->settings->feedburner->feedburner_base_url.$feeds[$k]); 
    3131          } 
    3232     } 
     
    6464 
    6565          $text = str_replace(array('%readers%','%clics%'),array('%1$s','%2$s'),$w->text); 
     66           
     67          $title = strlen($w->title) > 0 ? '<h2>'.$w->title.'</h2>' : ''; 
    6668 
    6769          $res = 
    6870               '<div id="feedburner">'. 
    69                '<h2>'.$w->title.'</h2>'. 
     71               $title 
    7072               (count($fb->getErrors()) > 0 ? '' :  
    7173               '<p>'.sprintf($text,$datas[0]['circulation'],$datas[0]['hits']).'</p>'). 
  • plugins/feedburner/trunk/_widgets.php

    r1634 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    2626          global $core; 
    2727 
    28           $feeds = unserialize($core->blog->settings->feedburner_feeds); 
     28          $feeds = unserialize($core->blog->settings->feedburner->feedburner_feeds); 
    2929          foreach ($feeds as $k => $v) { 
    3030               if (empty($v)) { unset($feeds[$k]); } 
  • plugins/feedburner/trunk/inc/class.feedburner.parser.php

    r738 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/feedburner/trunk/inc/class.feedburner.php

    r1366 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    2828     public function __construct($core) 
    2929     { 
    30           $this->core              =& $core; 
    31           $this->primary_xml       = $core->blog->settings->feedburner_primary_xml; 
    32           $this->secondary_xml     = $core->blog->settings->feedburner_secondary_xml; 
    33           $this->proxy             = $core->blog->settings->feedburner_proxy; 
    34           $this->feeds             = unserialize($core->blog->settings->feedburner_feeds); 
     30          $this->core              = $core; 
     31          $this->primary_xml       = $core->blog->settings->feedburner->feedburner_primary_xml; 
     32          $this->secondary_xml     = $core->blog->settings->feedburner->feedburner_secondary_xml; 
     33          $this->proxy             = $core->blog->settings->feedburner->feedburner_proxy; 
     34          $this->feeds             = unserialize($core->blog->settings->feedburner->feedburner_feeds); 
    3535          $this->datas             = array(); 
    3636          $this->errors            = array(); 
     
    6666                    $tab = explode(':',$e->getMessage()); 
    6767                    $this->errors = array( 
    68                          'code' => trim($tab[0]), 
    69                          'msg' => trim($tab[1]) 
     68                         'code' => (isset($tab[0]) ? trim($tab[0]) : ''), 
     69                         'msg' => (isset($tab[1]) ? trim($tab[1]) : '') 
    7070                    ); 
    7171                    $flag = false; 
  • plugins/feedburner/trunk/inc/class.feedburner.reader.php

    r738 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    9090               return false; 
    9191          } 
     92          $this->setTimeout($this->timeout); 
    9293          $this->setHost($host,$port); 
    9394          $this->useSSL($ssl); 
  • plugins/feedburner/trunk/inc/lib.feedburner.ui.php

    r1688 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    6262                    '</td>'."\n". 
    6363                    '<td class="maximal">'. 
    64                     sprintf(__('Enter feed url for the %s : %s'),$label,$core->blog->settings->feedburner_base_url). 
     64                    sprintf(__('Enter feed url for the %s : %s'),$label,$core->blog->settings->feedburner->feedburner_base_url). 
    6565                    form::field(array($k),30,255,$v). 
    6666                    '<p class="fb-note">'.sprintf( 
     
    7171                    '<td class="minimal">'; 
    7272               $res .= !empty($v) ? 
    73                     '<a href="'.$core->blog->settings->feedburner_base_url.$v.'">'. 
     73                    '<a href="'.$core->blog->settings->feedburner->feedburner_base_url.$v.'">'. 
    7474                    '<img src="index.php?pf=feedburner/feed.png" alt="'.$k.'" title="'.$v.'" /></a>' 
    7575                    : ''; 
     
    150150          $errors = $fb->getErrors(); 
    151151 
    152           $date = isset($datas[0]['date']) ? dt::str($core->blog->settings->date_format,strtotime($datas[0]['date'])) : __('your feed'); 
     152          $date = isset($datas[0]['date']) ? dt::str($core->blog->settings->system->date_format,strtotime($datas[0]['date'])) : __('your feed'); 
    153153 
    154154          echo '<h2>'.sprintf(__('Statistics of %s - Global'),$date).'</h2>'; 
     
    160160          } 
    161161 
    162           echo getErrors($errors); 
     162          echo self::getErrors($errors); 
    163163 
    164164          echo '<h2>'.sprintf(__('Statistics of %s - Details'),$date).'</h2>'; 
     
    175175          } 
    176176          else { 
    177                echo getErrors($errors); 
     177               echo self::getErrors($errors); 
    178178          } 
    179179     } 
     
    201201               '// ]]>'."\n". 
    202202               '</script>'; 
     203     } 
     204      
     205      
     206     /** 
     207      * Returns feedburner API's errors 
     208      */ 
     209     public static function getErrors($errors) 
     210     { 
     211          $res = ''; 
     212           
     213          foreach ($errors as $k => $v) { 
     214               $res .= '<h3>'.sprintf(__('Error %1$s : %2$s'),$k,text::toUTF8($v)).'</h3>'; 
     215          } 
     216      
     217          return $res; 
    203218     } 
    204219} 
  • plugins/feedburner/trunk/index.php

    r1634 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    1616$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->feedburner_feeds); 
    1919 
    2020# Sert les fichiers de amchart 
     
    4747     $feeds['atom'] = $feeds['atom'] != $_POST['atom'] ? $_POST['atom'] : $feeds['atom']; 
    4848     $feeds['atom_comments'] = $feeds['atom_comments'] != $_POST['atom_comments'] ? $_POST['atom_comments'] : $feeds['atom_comments']; 
    49      $core->blog->settings->setNamespace('feedburner'); 
    50      $core->blog->settings->put( 
     49     $core->blog->settings->addNamespace('feedburner'); 
     50     $core->blog->settings->feedburner->put( 
    5151          'feedburner_feeds', 
    5252          serialize($feeds) 
     
    6363} 
    6464 
    65 /** 
    66  * Returns feedburner API's errors 
    67  * 
    68  * @param array     errors 
    69  * 
    70  * @return     string 
    71  */ 
    72 function getErrors($errors) 
    73 { 
    74      $res = ''; 
    75       
    76      foreach ($errors as $k => $v) { 
    77           $res .= '<h3>'.sprintf(__('Error %1$s : %2$s'),$k,text::toUTF8($v)).'</h3>'; 
    78      } 
     65echo 
     66'<html>'. 
     67'<head>'. 
     68     '<title>'.__('Feedburner statistics').'</title>'. 
     69     dcPage::jsModal(). 
     70     dcPage::jsPageTabs($default_tab). 
     71     dcPage::jsLoad('index.php?pf=feedburner/js/_feedburner.js'). 
     72     '<link rel="stylesheet" href="index.php?pf=feedburner/style.css" type="text/css" />'. 
     73'</head>'. 
     74'<body>'; 
    7975 
    80      return $res; 
     76# Message 
     77if (isset($_POST['save'])) { 
     78     echo '<p class="static-msg">'.__('Setup saved').'</p>'; 
    8179} 
    8280 
    83 /** 
    84  * Returns plugin messages 
    85  */ 
    86 function getMsg() 
    87 { 
    88      if (isset($_POST['save'])) { 
    89           echo '<p class="static-msg">'.__('Setup saved').'</p>'; 
    90      } 
    91 } 
     81echo 
     82'<h2>'.$core->blog->name.' &rsaquo; '.__('Feedburner statistics').'</h2>'. 
     83'<p>'.__('View your feedburner statistics directly in Dotclear').'</p>'. 
     84'<!-- Feeds configuration -->'. 
     85'<div id="feeds" class="multi-part" title="'.__('Feeds configuration').'">'; 
     86feedburnerUi::feedsTable($feeds,$p_url); 
     87 
     88echo 
     89'</div>'. 
     90'<!-- Feed statistics -->'. 
     91'<div id="stats" class="multi-part" title="'.__('Feed statistics').'">'; 
     92feedburnerUi::statsForm($feeds,$p_url); 
     93feedburnerUi::statsView(); 
     94 
     95echo 
     96'</div>'. 
     97'</body>'. 
     98'</html>'; 
    9299 
    93100?> 
    94 <html> 
    95 <head> 
    96      <title><?php echo __('Feedburner statistics'); ?></title> 
    97      <?php echo dcPage::jsModal(); ?> 
    98      <?php echo dcPage::jsPageTabs($default_tab); ?> 
    99      <?php echo dcPage::jsLoad(DC_ADMIN_URL.'?pf=feedburner/js/_feedburner.js'); ?> 
    100      <style type="text/css">@import '<?php echo DC_ADMIN_URL; ?>index.php?pf=feedburner/style.css';</style> 
    101 </head> 
    102 <body> 
    103 <h2><?php echo __('Feedburner statistics'); ?></h2> 
    104 <p><?php echo __('View your feedburner statistics directly in Dotclear'); ?></p> 
    105  
    106 <?php getMsg(); ?> 
    107  
    108 <!-- Feeds configuration --> 
    109 <div id="feeds" class="multi-part" title="<?php echo __('Feeds configuration'); ?>"> 
    110      <?php feedburnerUi::feedsTable($feeds,$p_url); ?> 
    111 </div> 
    112  
    113 <!-- Feed statistics --> 
    114 <div id="stats" class="multi-part" title="<?php echo __('Feed statistics'); ?>"> 
    115      <?php feedburnerUi::statsForm($feeds,$p_url); ?> 
    116      <?php feedburnerUi::statsView(); ?> 
    117 </div> 
    118  
    119 </body> 
    120 </html> 
  • plugins/feedburner/trunk/js/_feedburner.js

    r1034 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/feedburner/trunk/style.css

    r1634 r2447  
    33# This file is part of feedburner, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
Note: See TracChangeset for help on using the changeset viewer.

Sites map