Changeset 2311
- Timestamp:
- 06/06/10 02:07:13 (13 years ago)
- Location:
- plugins/myBlogNumbers
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/myBlogNumbers/_admin.php
r1585 r2311 3 3 # This file is part of myBlogNumbers, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # -
plugins/myBlogNumbers/_define.php
r1585 r2311 3 3 # This file is part of myBlogNumbers, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 17 17 /* Description*/ "Show some figures of your blog", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0. 1',19 /* Version */ '0.2', 20 20 /* Permissions */ 'usage,contentadmin' 21 21 ); 22 /* date */ #20 09101622 /* date */ #20100605 23 23 ?> -
plugins/myBlogNumbers/_public.php
r1585 r2311 3 3 # This file is part of myBlogNumbers, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 18 18 { 19 19 global $core; 20 20 21 21 $content = $addons = ''; 22 22 23 23 # Home only 24 24 if ($w->homeonly && $core->url->type != 'default') return; 25 25 26 26 # Entry 27 27 if ($w->entry_show) … … 29 29 $title = ($w->entry_title ? 30 30 '<strong>'.html::escapeHTML($w->entry_title).'</strong> ' : ''); 31 31 32 32 $count = $core->blog->getPosts(array(),true)->f(0); 33 34 if ($count == 0) { 33 34 if ($count == 0) 35 { 35 36 $text = sprintf(__('none'),$count); 36 37 } 37 elseif ($count == 1) { 38 elseif ($count == 1) 39 { 38 40 $text = sprintf(__('one entry'),$count); 39 41 } 40 else { 42 else 43 { 41 44 $text = sprintf(__('%s entries'),$count); 42 45 } 43 46 44 47 $content .= sprintf('<li>%s%s</li>',$title,$text); 45 48 } 46 49 47 50 # Cat 48 51 if ($w->cat_show) … … 50 53 $title = ($w->cat_title ? 51 54 '<strong>'.html::escapeHTML($w->cat_title).'</strong> ' : ''); 52 55 53 56 $count = $core->blog->getCategories(array())->count(); 54 55 if ($count == 0) { 57 58 if ($count == 0) 59 { 56 60 $text = sprintf(__('none'),$count); 57 61 } 58 elseif ($count == 1) { 62 elseif ($count == 1) 63 { 59 64 $text = sprintf(__('one category'),$count); 60 65 } 61 else { 66 else 67 { 62 68 $text = sprintf(__('%s categories'),$count); 63 69 } 64 70 65 71 $content .= sprintf('<li>%s%s</li>',$title,$text); 66 72 } 67 73 68 74 # Comment 69 75 if ($w->comment_show) … … 78 84 ); 79 85 $count = $core->blog->getComments($params,true)->f(0); 80 81 if ($count == 0) { 86 87 if ($count == 0) 88 { 82 89 $text = sprintf(__('none'),$count); 83 90 } 84 elseif ($count == 1) { 91 elseif ($count == 1) 92 { 85 93 $text = sprintf(__('one comment'),$count); 86 94 } 87 else { 95 else 96 { 88 97 $text = sprintf(__('%s comments'),$count); 89 98 } 90 99 91 100 $content .= sprintf('<li>%s%s</li>',$title,$text); 92 101 } 93 102 94 103 # Trackback 95 104 if ($w->trackback_show) … … 97 106 $title = ($w->trackback_title ? 98 107 '<strong>'.html::escapeHTML($w->trackback_title).'</strong> ' : ''); 99 108 100 109 $params = array( 101 110 'post_type' => 'post', … … 104 113 ); 105 114 $count = $core->blog->getComments($params,true)->f(0); 106 107 if ($count == 0) { 115 116 if ($count == 0) 117 { 108 118 $text = sprintf(__('none'),$count); 109 119 } 110 elseif ($count == 1) { 120 elseif ($count == 1) 121 { 111 122 $text = sprintf(__('one trackback'),$count); 112 123 } 113 else { 124 else 125 { 114 126 $text = sprintf(__('%s trackbacks'),$count); 115 127 } 116 128 117 129 $content .= sprintf('<li>%s%s</li>',$title,$text); 118 130 } 119 131 120 132 # Tag 121 if ($core->plugins->moduleExists(' metadata') && $w->tag_show)133 if ($core->plugins->moduleExists('tags') && $w->tag_show) 122 134 { 123 135 $title = ($w->tag_title ? 124 136 '<strong>'.html::escapeHTML($w->tag_title).'</strong> ' : ''); 125 137 126 138 $count = $core->con->select( 127 139 'SELECT count(M.meta_id) AS count '. … … 131 143 "AND P.blog_id='".$core->blog->id."' " 132 144 )->f(0); 133 134 if ($count == 0) { 145 146 if ($count == 0) 147 { 135 148 $text = sprintf(__('none'),$count); 136 149 } 137 elseif ($count == 1) { 150 elseif ($count == 1) 151 { 138 152 $text = sprintf(__('one tag'),$count); 139 153 } 140 else { 154 else 155 { 141 156 $text = sprintf(__('%s tags'),$count); 142 157 } 143 158 144 159 $content .= sprintf('<li>%s%s</li>',$title,$text); 145 160 } 146 161 147 162 # User (that post) 148 163 if ($w->user_show) … … 150 165 $title = ($w->user_title ? 151 166 '<strong>'.html::escapeHTML($w->user_title).'</strong> ' : ''); 152 167 153 168 $count = $core->blog->getPostsUsers(array(),true)->count(); 154 155 if ($count == 0) { 169 170 if ($count == 0) 171 { 156 172 $text = sprintf(__('none'),$count); 157 173 } 158 elseif ($count == 1) { 174 elseif ($count == 1) 175 { 159 176 $text = sprintf(__('one author'),$count); 160 177 } 161 else { 178 else 179 { 162 180 $text = sprintf(__('%s authors'),$count); 163 181 } 164 182 165 183 $content .= sprintf('<li>%s%s</li>',$title,$text); 166 184 } 167 168 185 169 186 # --BEHAVIOR-- myBlogNumbersWidgetParse 170 187 $addons = $core->callBehavior('myBlogNumbersWidgetParse',$core,$w); 171 172 188 173 189 # Nothing to display 174 190 if (!$content && !$addons) return; 175 191 176 192 # Display 177 193 return -
plugins/myBlogNumbers/_widgets.php
r1585 r2311 3 3 # This file is part of myBlogNumbers, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 18 18 { 19 19 global $core; 20 20 21 21 $w->create('myblognumbers',__('My blog numbers'), 22 22 'myBlogNumbersWidgetPublic'); 23 23 $w->myblognumbers->setting('title',__('Title:'), 24 24 __('My blog numbers'),'text'); 25 25 26 26 # Entry 27 27 $w->myblognumbers->setting('entry_show',__('Show entries count'),1,'check'); 28 28 $w->myblognumbers->setting('entry_title',__('Title for entries count:'), 29 29 __('Entries:'),'text'); 30 30 31 31 # Cat 32 32 $w->myblognumbers->setting('cat_show',__('Show categories count'),1,'check'); 33 33 $w->myblognumbers->setting('cat_title',__('Title for categories count:'), 34 34 __('Categories:'),'text'); 35 35 36 36 # Comment 37 37 $w->myblognumbers->setting('comment_show',__('Show comments count'),1,'check'); 38 38 $w->myblognumbers->setting('comment_title',__('Title for comments count:'), 39 39 __('Comments:'),'text'); 40 40 41 41 # Trackback 42 42 $w->myblognumbers->setting('trackback_show',__('Show trackbacks count'),1,'check'); 43 43 $w->myblognumbers->setting('trackback_title',__('Title for trackbacks count:'), 44 44 __('Trackbacks:'),'text'); 45 46 if ($core->plugins->moduleExists(' metadata'))45 46 if ($core->plugins->moduleExists('tags')) 47 47 { 48 48 # Tag … … 51 51 __('Tags:'),'text'); 52 52 } 53 53 54 54 # Users (that post) 55 55 $w->myblognumbers->setting('user_show',__('Show users count'),1,'check'); 56 56 $w->myblognumbers->setting('user_title',__('Title for users count:'), 57 57 __('Authors:'),'text'); 58 58 59 59 # --BEHAVIOR-- myBlogNumbersWidgetInit 60 60 $core->callBehavior('myBlogNumbersWidgetInit',$w); 61 62 61 63 62 $w->myblognumbers->setting('homeonly',__('Home page only'),1,'check'); 64 63 } -
plugins/myBlogNumbers/locales/fr/main.lang.php
r1585 r2311 1 1 <?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 12 6 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'; 17 35 18 36 #_public.php:156 19 $GLOBALS['__l10n']['none'] = 'aucun';20 21 #_public.php:3822 $GLOBALS['__l10n']['one entry'] = 'un billet';23 24 #_public.php:4125 $GLOBALS['__l10n']['%s entries'] = '%s billets';26 27 #_public.php:5928 $GLOBALS['__l10n']['one category'] = 'une catégorie';29 30 #_public.php:6231 $GLOBALS['__l10n']['%s categories'] = '%s catégories';32 33 #_public.php:8834 $GLOBALS['__l10n']['%s comments'] = '%s commentaires';35 36 #_public.php:11437 $GLOBALS['__l10n']['%s trackbacks'] = '%s rétroliens';38 39 #_public.php:13840 $GLOBALS['__l10n']['one tag'] = 'un tag';41 42 #_public.php:14143 37 $GLOBALS['__l10n']['%s tags'] = '%s tags'; 44 38 45 #_public.php:1 5939 #_public.php:176 46 40 $GLOBALS['__l10n']['one author'] = 'un auteur'; 47 41 48 #_public.php:1 6242 #_public.php:180 49 43 $GLOBALS['__l10n']['%s authors'] = '%s auteurs'; 50 44 45 #_widgets.php:21 51 46 #_widgets.php:24 52 47 $GLOBALS['__l10n']['My blog numbers'] = 'Mon blog en chiffres'; … … 62 57 63 58 #_widgets.php:32 64 $GLOBALS['__l10n']['Show categories count'] = 'Aff ciher le nombre de catégories';59 $GLOBALS['__l10n']['Show categories count'] = 'Afficher le nombre de catégories'; 65 60 66 61 #_widgets.php:33 … … 80 75 81 76 #_widgets.php:42 82 $GLOBALS['__l10n']['Show trackbacks count'] = 'Aff ciher le nombre de rétroliens';77 $GLOBALS['__l10n']['Show trackbacks count'] = 'Afficher le nombre de rétroliens'; 83 78 84 79 #_widgets.php:43 … … 89 84 90 85 #_widgets.php:49 91 $GLOBALS['__l10n']['Show tags count'] = 'Affich ier le nombre de tags';86 $GLOBALS['__l10n']['Show tags count'] = 'Afficher le nombre de tags'; 92 87 93 88 #_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 5 6 msgid "" 6 7 msgstr "" 7 8 "Content-Type: text/plain; charset=UTF-8\n" 8 "Project-Id-Version: \n"9 "Project-Id-Version: myBlogNumbers 0.2\n" 9 10 "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" 12 13 "Language-Team: \n" 13 14 "MIME-Version: 1.0\n" 14 15 "Content-Transfer-Encoding: 8bit\n" 15 16 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 17 23 msgid "none" 18 24 msgstr "aucun" 19 25 20 #: _public.php: 3826 #: _public.php:40 21 27 msgid "one entry" 22 28 msgstr "un billet" 23 29 24 #: _public.php:4 130 #: _public.php:44 25 31 msgid "%s entries" 26 32 msgstr "%s billets" 27 33 28 #: _public.php: 5934 #: _public.php:64 29 35 msgid "one category" 30 36 msgstr "une catégorie" 31 37 32 #: _public.php:6 238 #: _public.php:68 33 39 msgid "%s categories" 34 40 msgstr "%s catégories" 35 41 36 #: _public.php: 8842 #: _public.php:97 37 43 msgid "%s comments" 38 44 msgstr "%s commentaires" 39 45 40 #: _public.php:1 1446 #: _public.php:126 41 47 msgid "%s trackbacks" 42 48 msgstr "%s rétroliens" 43 49 44 #: _public.php:1 3850 #: _public.php:152 45 51 msgid "one tag" 46 52 msgstr "un tag" 47 53 48 #: _public.php:1 4154 #: _public.php:156 49 55 msgid "%s tags" 50 56 msgstr "%s tags" 51 57 52 #: _public.php:1 5958 #: _public.php:176 53 59 msgid "one author" 54 60 msgstr "un auteur" 55 61 56 #: _public.php:1 6262 #: _public.php:180 57 63 msgid "%s authors" 58 64 msgstr "%s auteurs" 59 65 66 #: _widgets.php:21 60 67 #: _widgets.php:24 61 68 msgid "My blog numbers" -
plugins/myBlogNumbers/release.txt
r1585 r2311 1 0.2 20100605 2 * Switched to DC 2.2 3 1 4 0.1 20091016 2 5 * First lab release
Note: See TracChangeset
for help on using the changeset viewer.