Dotclear

Changeset 2311


Ignore:
Timestamp:
06/06/10 02:07:13 (13 years ago)
Author:
JcDenis
Message:

myBlogNumbers 0.2

  • Switched to DC 2.2
Location:
plugins/myBlogNumbers
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • plugins/myBlogNumbers/_admin.php

    r1585 r2311  
    33# This file is part of myBlogNumbers, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
  • plugins/myBlogNumbers/_define.php

    r1585 r2311  
    33# This file is part of myBlogNumbers, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1717     /* Description*/         "Show some figures of your blog", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.1', 
     19     /* Version */            '0.2', 
    2020     /* Permissions */        'usage,contentadmin' 
    2121); 
    22      /* date */          #20091016 
     22     /* date */          #20100605 
    2323?> 
  • plugins/myBlogNumbers/_public.php

    r1585 r2311  
    33# This file is part of myBlogNumbers, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1818{ 
    1919     global $core; 
    20  
     20      
    2121     $content = $addons = ''; 
    22  
     22      
    2323     # Home only 
    2424     if ($w->homeonly && $core->url->type != 'default') return; 
    25  
     25      
    2626     # Entry 
    2727     if ($w->entry_show) 
     
    2929          $title = ($w->entry_title ?  
    3030               '<strong>'.html::escapeHTML($w->entry_title).'</strong> ' : ''); 
    31  
     31           
    3232          $count = $core->blog->getPosts(array(),true)->f(0); 
    33  
    34           if ($count == 0) { 
     33           
     34          if ($count == 0) 
     35          { 
    3536               $text = sprintf(__('none'),$count); 
    3637          } 
    37           elseif ($count == 1) { 
     38          elseif ($count == 1) 
     39          { 
    3840               $text = sprintf(__('one entry'),$count); 
    3941          } 
    40           else { 
     42          else 
     43          { 
    4144               $text = sprintf(__('%s entries'),$count); 
    4245          } 
    43  
     46           
    4447          $content .= sprintf('<li>%s%s</li>',$title,$text); 
    4548     } 
    46  
     49      
    4750     # Cat 
    4851     if ($w->cat_show) 
     
    5053          $title = ($w->cat_title ?  
    5154               '<strong>'.html::escapeHTML($w->cat_title).'</strong> ' : ''); 
    52  
     55           
    5356          $count = $core->blog->getCategories(array())->count(); 
    54  
    55           if ($count == 0) { 
     57           
     58          if ($count == 0) 
     59          { 
    5660               $text = sprintf(__('none'),$count); 
    5761          } 
    58           elseif ($count == 1) { 
     62          elseif ($count == 1) 
     63          { 
    5964               $text = sprintf(__('one category'),$count); 
    6065          } 
    61           else { 
     66          else 
     67          { 
    6268               $text = sprintf(__('%s categories'),$count); 
    6369          } 
    64  
     70           
    6571          $content .= sprintf('<li>%s%s</li>',$title,$text); 
    6672     } 
    67  
     73      
    6874     # Comment 
    6975     if ($w->comment_show) 
     
    7884          ); 
    7985          $count = $core->blog->getComments($params,true)->f(0); 
    80  
    81           if ($count == 0) { 
     86           
     87          if ($count == 0) 
     88          { 
    8289               $text = sprintf(__('none'),$count); 
    8390          } 
    84           elseif ($count == 1) { 
     91          elseif ($count == 1) 
     92          { 
    8593               $text = sprintf(__('one comment'),$count); 
    8694          } 
    87           else { 
     95          else 
     96          { 
    8897               $text = sprintf(__('%s comments'),$count); 
    8998          } 
    90  
     99           
    91100          $content .= sprintf('<li>%s%s</li>',$title,$text); 
    92101     } 
    93  
     102      
    94103     # Trackback 
    95104     if ($w->trackback_show) 
     
    97106          $title = ($w->trackback_title ?  
    98107               '<strong>'.html::escapeHTML($w->trackback_title).'</strong> ' : ''); 
    99  
     108           
    100109          $params = array( 
    101110               'post_type' => 'post', 
     
    104113          ); 
    105114          $count = $core->blog->getComments($params,true)->f(0); 
    106  
    107           if ($count == 0) { 
     115           
     116          if ($count == 0) 
     117          { 
    108118               $text = sprintf(__('none'),$count); 
    109119          } 
    110           elseif ($count == 1) { 
     120          elseif ($count == 1) 
     121          { 
    111122               $text = sprintf(__('one trackback'),$count); 
    112123          } 
    113           else { 
     124          else 
     125          { 
    114126               $text = sprintf(__('%s trackbacks'),$count); 
    115127          } 
    116  
     128           
    117129          $content .= sprintf('<li>%s%s</li>',$title,$text); 
    118130     } 
    119  
     131      
    120132     # Tag 
    121      if ($core->plugins->moduleExists('metadata') && $w->tag_show) 
     133     if ($core->plugins->moduleExists('tags') && $w->tag_show) 
    122134     { 
    123135          $title = ($w->tag_title ?  
    124136               '<strong>'.html::escapeHTML($w->tag_title).'</strong> ' : ''); 
    125  
     137           
    126138          $count = $core->con->select( 
    127139               'SELECT count(M.meta_id) AS count '. 
     
    131143               "AND P.blog_id='".$core->blog->id."' " 
    132144          )->f(0); 
    133  
    134           if ($count == 0) { 
     145           
     146          if ($count == 0) 
     147          { 
    135148               $text = sprintf(__('none'),$count); 
    136149          } 
    137           elseif ($count == 1) { 
     150          elseif ($count == 1) 
     151          { 
    138152               $text = sprintf(__('one tag'),$count); 
    139153          } 
    140           else { 
     154          else 
     155          { 
    141156               $text = sprintf(__('%s tags'),$count); 
    142157          } 
    143  
     158           
    144159          $content .= sprintf('<li>%s%s</li>',$title,$text); 
    145160     } 
    146  
     161      
    147162     # User (that post) 
    148163     if ($w->user_show) 
     
    150165          $title = ($w->user_title ?  
    151166               '<strong>'.html::escapeHTML($w->user_title).'</strong> ' : ''); 
    152  
     167           
    153168          $count = $core->blog->getPostsUsers(array(),true)->count(); 
    154  
    155           if ($count == 0) { 
     169           
     170          if ($count == 0) 
     171          { 
    156172               $text = sprintf(__('none'),$count); 
    157173          } 
    158           elseif ($count == 1) { 
     174          elseif ($count == 1) 
     175          { 
    159176               $text = sprintf(__('one author'),$count); 
    160177          } 
    161           else { 
     178          else 
     179          { 
    162180               $text = sprintf(__('%s authors'),$count); 
    163181          } 
    164  
     182           
    165183          $content .= sprintf('<li>%s%s</li>',$title,$text); 
    166184     } 
    167  
    168  
     185      
    169186     # --BEHAVIOR-- myBlogNumbersWidgetParse 
    170187     $addons = $core->callBehavior('myBlogNumbersWidgetParse',$core,$w); 
    171  
    172  
     188      
    173189     # Nothing to display 
    174190     if (!$content && !$addons) return; 
    175  
     191      
    176192     # Display 
    177193     return  
  • plugins/myBlogNumbers/_widgets.php

    r1585 r2311  
    33# This file is part of myBlogNumbers, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1818{ 
    1919     global $core; 
    20  
     20      
    2121     $w->create('myblognumbers',__('My blog numbers'), 
    2222          'myBlogNumbersWidgetPublic'); 
    2323     $w->myblognumbers->setting('title',__('Title:'), 
    2424          __('My blog numbers'),'text'); 
    25  
     25      
    2626     # Entry 
    2727     $w->myblognumbers->setting('entry_show',__('Show entries count'),1,'check'); 
    2828     $w->myblognumbers->setting('entry_title',__('Title for entries count:'), 
    2929          __('Entries:'),'text'); 
    30  
     30      
    3131     # Cat 
    3232     $w->myblognumbers->setting('cat_show',__('Show categories count'),1,'check'); 
    3333     $w->myblognumbers->setting('cat_title',__('Title for categories count:'), 
    3434          __('Categories:'),'text'); 
    35  
     35      
    3636     # Comment 
    3737     $w->myblognumbers->setting('comment_show',__('Show comments count'),1,'check'); 
    3838     $w->myblognumbers->setting('comment_title',__('Title for comments count:'), 
    3939          __('Comments:'),'text'); 
    40  
     40      
    4141     # Trackback 
    4242     $w->myblognumbers->setting('trackback_show',__('Show trackbacks count'),1,'check'); 
    4343     $w->myblognumbers->setting('trackback_title',__('Title for trackbacks count:'), 
    4444          __('Trackbacks:'),'text'); 
    45  
    46      if ($core->plugins->moduleExists('metadata')) 
     45      
     46     if ($core->plugins->moduleExists('tags')) 
    4747     { 
    4848          # Tag 
     
    5151               __('Tags:'),'text'); 
    5252     } 
    53  
     53      
    5454     # Users (that post) 
    5555     $w->myblognumbers->setting('user_show',__('Show users count'),1,'check'); 
    5656     $w->myblognumbers->setting('user_title',__('Title for users count:'), 
    5757          __('Authors:'),'text'); 
    58  
     58      
    5959     # --BEHAVIOR-- myBlogNumbersWidgetInit 
    6060     $core->callBehavior('myBlogNumbersWidgetInit',$w); 
    61  
    62  
     61      
    6362     $w->myblognumbers->setting('homeonly',__('Home page only'),1,'check'); 
    6463} 
  • plugins/myBlogNumbers/locales/fr/main.lang.php

    r1585 r2311  
    11<?php 
    2 # -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of myBlogNumbers, a plugin for Dotclear 2. 
    4 #  
    5 # Copyright (c) 2009 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
    7 #  
    8 # Licensed under the GPL version 2.0 license. 
    9 # A copy of this license is available in LICENSE file or at 
    10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    11 # -- END LICENSE BLOCK ------------------------------------ 
     2// Language: Français  
     3// Module: myBlogNumbers - 0.2 
     4// Date: 2010-06-06 00:00:21  
     5// Translated with dcTranslater - 1.4  
    126 
    13 // Language: français  
    14 // Module: myBlogNumbers - 0.1 
    15 // Date: 2009-10-16 12:18:07  
    16 // Translated with dcTranslater - 1.2  
     7#_public.php:36 
     8#_public.php:60 
     9#_public.php:89 
     10#_public.php:118 
     11#_public.php:148 
     12#_public.php:172 
     13$GLOBALS['__l10n']['none'] = 'aucun'; 
     14 
     15#_public.php:40 
     16$GLOBALS['__l10n']['one entry'] = 'un billet'; 
     17 
     18#_public.php:44 
     19$GLOBALS['__l10n']['%s entries'] = '%s billets'; 
     20 
     21#_public.php:64 
     22$GLOBALS['__l10n']['one category'] = 'une catégorie'; 
     23 
     24#_public.php:68 
     25$GLOBALS['__l10n']['%s categories'] = '%s catégories'; 
     26 
     27#_public.php:97 
     28$GLOBALS['__l10n']['%s comments'] = '%s commentaires'; 
     29 
     30#_public.php:126 
     31$GLOBALS['__l10n']['%s trackbacks'] = '%s rétroliens'; 
     32 
     33#_public.php:152 
     34$GLOBALS['__l10n']['one tag'] = 'un tag'; 
    1735 
    1836#_public.php:156 
    19 $GLOBALS['__l10n']['none'] = 'aucun'; 
    20  
    21 #_public.php:38 
    22 $GLOBALS['__l10n']['one entry'] = 'un billet'; 
    23  
    24 #_public.php:41 
    25 $GLOBALS['__l10n']['%s entries'] = '%s billets'; 
    26  
    27 #_public.php:59 
    28 $GLOBALS['__l10n']['one category'] = 'une catégorie'; 
    29  
    30 #_public.php:62 
    31 $GLOBALS['__l10n']['%s categories'] = '%s catégories'; 
    32  
    33 #_public.php:88 
    34 $GLOBALS['__l10n']['%s comments'] = '%s commentaires'; 
    35  
    36 #_public.php:114 
    37 $GLOBALS['__l10n']['%s trackbacks'] = '%s rétroliens'; 
    38  
    39 #_public.php:138 
    40 $GLOBALS['__l10n']['one tag'] = 'un tag'; 
    41  
    42 #_public.php:141 
    4337$GLOBALS['__l10n']['%s tags'] = '%s tags'; 
    4438 
    45 #_public.php:159 
     39#_public.php:176 
    4640$GLOBALS['__l10n']['one author'] = 'un auteur'; 
    4741 
    48 #_public.php:162 
     42#_public.php:180 
    4943$GLOBALS['__l10n']['%s authors'] = '%s auteurs'; 
    5044 
     45#_widgets.php:21 
    5146#_widgets.php:24 
    5247$GLOBALS['__l10n']['My blog numbers'] = 'Mon blog en chiffres'; 
     
    6257 
    6358#_widgets.php:32 
    64 $GLOBALS['__l10n']['Show categories count'] = 'Affciher le nombre de catégories'; 
     59$GLOBALS['__l10n']['Show categories count'] = 'Afficher le nombre de catégories'; 
    6560 
    6661#_widgets.php:33 
     
    8075 
    8176#_widgets.php:42 
    82 $GLOBALS['__l10n']['Show trackbacks count'] = 'Affciher le nombre de rétroliens'; 
     77$GLOBALS['__l10n']['Show trackbacks count'] = 'Afficher le nombre de rétroliens'; 
    8378 
    8479#_widgets.php:43 
     
    8984 
    9085#_widgets.php:49 
    91 $GLOBALS['__l10n']['Show tags count'] = 'Affichier le nombre de tags'; 
     86$GLOBALS['__l10n']['Show tags count'] = 'Afficher le nombre de tags'; 
    9287 
    9388#_widgets.php:50 
  • plugins/myBlogNumbers/locales/fr/main.po

    r1727 r2311  
    1 # Language: français 
    2 # Module: myBlogNumbers - 0.1 
    3 # Date: 2009-10-16 12:18:07 
    4 # Translated with dcTranslater - 1.2 
     1# Language: Français 
     2# Module: myBlogNumbers - 0.2 
     3# Date: 2010-06-06 00:00:21 
     4# Translated with translater 1.4 
     5 
    56msgid "" 
    67msgstr "" 
    78"Content-Type: text/plain; charset=UTF-8\n" 
    8 "Project-Id-Version: \n" 
     9"Project-Id-Version: myBlogNumbers 0.2\n" 
    910"POT-Creation-Date: \n" 
    10 "PO-Revision-Date: \n" 
    11 "Last-Translator: Kozlika <kozlika@free.fr>\n" 
     11"PO-Revision-Date: 2010-06-06T00:00:21+00:00\n" 
     12"Last-Translator: JC Denis\n" 
    1213"Language-Team: \n" 
    1314"MIME-Version: 1.0\n" 
    1415"Content-Transfer-Encoding: 8bit\n" 
    1516 
    16 #: _public.php:156 
     17#: _public.php:36 
     18#: _public.php:60 
     19#: _public.php:89 
     20#: _public.php:118 
     21#: _public.php:148 
     22#: _public.php:172 
    1723msgid "none" 
    1824msgstr "aucun" 
    1925 
    20 #: _public.php:38 
     26#: _public.php:40 
    2127msgid "one entry" 
    2228msgstr "un billet" 
    2329 
    24 #: _public.php:41 
     30#: _public.php:44 
    2531msgid "%s entries" 
    2632msgstr "%s billets" 
    2733 
    28 #: _public.php:59 
     34#: _public.php:64 
    2935msgid "one category" 
    3036msgstr "une catégorie" 
    3137 
    32 #: _public.php:62 
     38#: _public.php:68 
    3339msgid "%s categories" 
    3440msgstr "%s catégories" 
    3541 
    36 #: _public.php:88 
     42#: _public.php:97 
    3743msgid "%s comments" 
    3844msgstr "%s commentaires" 
    3945 
    40 #: _public.php:114 
     46#: _public.php:126 
    4147msgid "%s trackbacks" 
    4248msgstr "%s rétroliens" 
    4349 
    44 #: _public.php:138 
     50#: _public.php:152 
    4551msgid "one tag" 
    4652msgstr "un tag" 
    4753 
    48 #: _public.php:141 
     54#: _public.php:156 
    4955msgid "%s tags" 
    5056msgstr "%s tags" 
    5157 
    52 #: _public.php:159 
     58#: _public.php:176 
    5359msgid "one author" 
    5460msgstr "un auteur" 
    5561 
    56 #: _public.php:162 
     62#: _public.php:180 
    5763msgid "%s authors" 
    5864msgstr "%s auteurs" 
    5965 
     66#: _widgets.php:21 
    6067#: _widgets.php:24 
    6168msgid "My blog numbers" 
  • plugins/myBlogNumbers/release.txt

    r1585 r2311  
     10.2 20100605 
     2 * Switched to DC 2.2 
     3 
    140.1 20091016 
    25 * First lab release 
Note: See TracChangeset for help on using the changeset viewer.

Sites map