cleanup 2021
This commit is contained in:
parent
4ae72bf866
commit
ff511566f8
@ -1,3 +1,8 @@
|
||||
myBlogNumbers 2021.08.27
|
||||
- cleanup (PSR2, short array, ...)
|
||||
- enhance widget style
|
||||
- update license
|
||||
|
||||
myBlogNumbers 2015.04.23 - Pierre Van Glabeke
|
||||
* modif url support
|
||||
|
9
LICENSE
9
LICENSE
@ -1,7 +1,7 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{description}
|
||||
Copyright (C) {year} {fullname}
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names:
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
{signature of Ty Coon}, 1 April 1989
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
@ -337,4 +337,3 @@ proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
|
36
README.md
36
README.md
@ -1,2 +1,34 @@
|
||||
# myBlogNumbers
|
||||
Afficher quelques chiffres à propos de votre blog
|
||||
# README
|
||||
|
||||
## WHAT IS MYBLOGNUMBERS ?
|
||||
|
||||
"My Blog Numbers" is a plugin for the open-source
|
||||
web publishing software called Dotclear.
|
||||
|
||||
Simply show visitors some statistics about current blog.
|
||||
|
||||
## REQUIREMENTS
|
||||
|
||||
myBlogNumbers requires:
|
||||
|
||||
* permissions to manage widgets
|
||||
* Dotclear 2.19
|
||||
|
||||
## USAGE
|
||||
|
||||
First install myBlogNumbers, manualy from a zip package or from
|
||||
Dotaddict repository. (See Dotclear's documentation to know how do this)
|
||||
|
||||
Add and configure "My Blog Numbers" from widgets manager.
|
||||
You can add a dashboard item by enable it from your dashboard preferences.
|
||||
|
||||
## MORE
|
||||
|
||||
* License : GNU GPL v2
|
||||
* Source & contribution : [GitHub Page](https://github.com/JcDenis/myBlogNumbers)
|
||||
* Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/myBlogNumbers)
|
||||
|
||||
## CONTRIBUTORS
|
||||
|
||||
* Jean-Chirstian Denis
|
||||
* Pierre Van Glabeke
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# This file is part of myBlogNumbers, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
@ -12,7 +12,6 @@
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
24
_define.php
24
_define.php
@ -3,7 +3,7 @@
|
||||
#
|
||||
# This file is part of myBlogNumbers, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
@ -12,24 +12,20 @@
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->registerModule(
|
||||
/* Name */
|
||||
"myBlogNumbers",
|
||||
/* Description*/
|
||||
"Show some figures of your blog",
|
||||
/* Author */
|
||||
"Jean-Christian Denis, Pierre Van Glabeke",
|
||||
/* Version */
|
||||
'2015.04.23',
|
||||
array(
|
||||
'myBlogNumbers',
|
||||
'Show some figures of your blog',
|
||||
'Jean-Christian Denis, Pierre Van Glabeke',
|
||||
'2021.08.27',
|
||||
[
|
||||
'permissions' => 'usage,contentadmin',
|
||||
'type' => 'plugin',
|
||||
'dc_min' => '2.7',
|
||||
'dc_min' => '2.19',
|
||||
'support' => 'http://forum.dotclear.org/viewtopic.php?id=40934',
|
||||
'details' => 'http://plugins.dotaddict.org/dc2/details/myBlogNumbers'
|
||||
)
|
||||
'details' => 'http://plugins.dotaddict.org/dc2/details/myBlogNumbers',
|
||||
'repository' => 'https://raw.githubusercontent.com/JcDenis/myBlogNumbers/master/dcstore.xml'
|
||||
]
|
||||
);
|
37
_public.php
37
_public.php
@ -3,7 +3,7 @@
|
||||
#
|
||||
# This file is part of myBlogNumbers, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
@ -12,7 +12,6 @@
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -26,14 +25,13 @@ function myBlogNumbersWidgetPublic($w)
|
||||
$s_line = '<li>%s%s</li>';
|
||||
$s_title = '<strong>%s</strong> ';
|
||||
|
||||
if ($w->offline)
|
||||
if ($w->offline) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Home only
|
||||
if ($w->homeonly == 1 && $core->url->type != 'default'
|
||||
|| $w->homeonly == 2 && $core->url->type == 'default'
|
||||
) {
|
||||
return;
|
||||
if (($w->homeonly == 1 && !$core->url->isHome($core->url->type))
|
||||
|| ($w->homeonly == 2 && $core->url->isHome($core->url->type))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
# Entry
|
||||
@ -41,7 +39,7 @@ function myBlogNumbersWidgetPublic($w)
|
||||
$title = $w->entry_title ?
|
||||
sprintf($s_title, html::escapeHTML($w->entry_title)) : '';
|
||||
|
||||
$count = $core->blog->getPosts(array(), true)->f(0);
|
||||
$count = $core->blog->getPosts([], true)->f(0);
|
||||
|
||||
$text = $count == 0 ?
|
||||
sprintf(__('no entries'), $count) :
|
||||
@ -55,7 +53,7 @@ function myBlogNumbersWidgetPublic($w)
|
||||
$title = $w->cat_title ?
|
||||
sprintf($s_title, html::escapeHTML($w->cat_title)) : '';
|
||||
|
||||
$count = $core->blog->getCategories(array())->count();
|
||||
$count = $core->blog->getCategories([])->count();
|
||||
|
||||
$text = $count == 0 ?
|
||||
sprintf(__('no categories'), $count) :
|
||||
@ -69,11 +67,11 @@ function myBlogNumbersWidgetPublic($w)
|
||||
$title = $w->comment_title ?
|
||||
sprintf($s_title, html::escapeHTML($w->comment_title)) : '';
|
||||
|
||||
$params = array(
|
||||
$params = [
|
||||
'post_type' => 'post',
|
||||
'comment_status' => 1,
|
||||
'comment_trackback' => 0
|
||||
);
|
||||
];
|
||||
$count = $core->blog->getComments($params, true)->f(0);
|
||||
|
||||
$text = $count == 0 ?
|
||||
@ -88,11 +86,11 @@ function myBlogNumbersWidgetPublic($w)
|
||||
$title = $w->trackback_title ?
|
||||
sprintf($s_title, html::escapeHTML($w->trackback_title)) : '';
|
||||
|
||||
$params = array(
|
||||
$params = [
|
||||
'post_type' => 'post',
|
||||
'comment_status' => 1,
|
||||
'comment_trackback' => 1
|
||||
);
|
||||
];
|
||||
$count = $core->blog->getComments($params, true)->f(0);
|
||||
|
||||
$text = $count == 0 ?
|
||||
@ -141,14 +139,15 @@ function myBlogNumbersWidgetPublic($w)
|
||||
|
||||
# Nothing to display
|
||||
if (!$content && !$addons) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
# Display
|
||||
$res =
|
||||
return $w->renderDiv(
|
||||
$w->content_only,
|
||||
'myblognumbers ' . $w->class,
|
||||
'',
|
||||
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '') .
|
||||
'<ul>'.$content.$addons.'</ul>';
|
||||
|
||||
return $w->renderDiv($w->content_only,'myblognumbers '.$w->class,'',$res);
|
||||
sprintf('<ul>%s</ul>', $content . $addons)
|
||||
);
|
||||
}
|
89
_widgets.php
89
_widgets.php
@ -3,7 +3,7 @@
|
||||
#
|
||||
# This file is part of myBlogNumbers, a plugin for Dotclear 2.
|
||||
#
|
||||
# Copyright (c) 2009-2015 Jean-Christian Denis and contributors
|
||||
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
@ -12,7 +12,6 @@
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -22,70 +21,66 @@ function myBlogNumbersWidgetAdmin($w)
|
||||
{
|
||||
global $core;
|
||||
|
||||
$w->create(
|
||||
$w
|
||||
->create(
|
||||
'myblognumbers',
|
||||
__('My blog numbers'),
|
||||
'myBlogNumbersWidgetPublic',
|
||||
null,
|
||||
__('Show some figures of your blog')
|
||||
);
|
||||
$w->myblognumbers->setting(
|
||||
'title',
|
||||
__('Title:'),
|
||||
__('My blog numbers'),
|
||||
'text'
|
||||
);
|
||||
)
|
||||
->addTitle(__('My blog numbers'))
|
||||
|
||||
# Entry
|
||||
$w->myblognumbers->setting(
|
||||
->setting(
|
||||
'entry_show',
|
||||
__('Show entries count'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->myblognumbers->setting(
|
||||
)
|
||||
->setting(
|
||||
'entry_title',
|
||||
__('Title for entries count:'),
|
||||
__('Entries:'),
|
||||
'text'
|
||||
);
|
||||
)
|
||||
|
||||
# Cat
|
||||
$w->myblognumbers->setting(
|
||||
->setting(
|
||||
'cat_show',
|
||||
__('Show categories count'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->myblognumbers->setting(
|
||||
)
|
||||
->setting(
|
||||
'cat_title',
|
||||
__('Title for categories count:'),
|
||||
__('Categories:'),
|
||||
'text'
|
||||
);
|
||||
)
|
||||
|
||||
# Comment
|
||||
$w->myblognumbers->setting(
|
||||
->setting(
|
||||
'comment_show',
|
||||
__('Show comments count'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->myblognumbers->setting(
|
||||
)
|
||||
->setting(
|
||||
'comment_title',
|
||||
__('Title for comments count:'),
|
||||
__('Comments:'),
|
||||
'text'
|
||||
);
|
||||
)
|
||||
|
||||
# Trackback
|
||||
$w->myblognumbers->setting(
|
||||
->setting(
|
||||
'trackback_show',
|
||||
__('Show trackbacks count'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->myblognumbers->setting(
|
||||
)
|
||||
->setting(
|
||||
'trackback_title',
|
||||
__('Title for trackbacks count:'),
|
||||
__('Trackbacks:'),
|
||||
@ -94,13 +89,14 @@ function myBlogNumbersWidgetAdmin($w)
|
||||
|
||||
if ($core->plugins->moduleExists('tags')) {
|
||||
# Tag
|
||||
$w->myblognumbers->setting(
|
||||
$w->myblognumbers
|
||||
->setting(
|
||||
'tag_show',
|
||||
__('Show tags count'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->myblognumbers->setting(
|
||||
)
|
||||
->setting(
|
||||
'tag_title',
|
||||
__('Title for tags count:'),
|
||||
__('Tags:'),
|
||||
@ -109,13 +105,14 @@ function myBlogNumbersWidgetAdmin($w)
|
||||
}
|
||||
|
||||
# Users (that post)
|
||||
$w->myblognumbers->setting(
|
||||
$w->myblognumbers
|
||||
->setting(
|
||||
'user_show',
|
||||
__('Show users count'),
|
||||
1,
|
||||
'check'
|
||||
);
|
||||
$w->myblognumbers->setting(
|
||||
)
|
||||
->setting(
|
||||
'user_title',
|
||||
__('Title for users count:'),
|
||||
__('Authors:'),
|
||||
@ -126,29 +123,9 @@ function myBlogNumbersWidgetAdmin($w)
|
||||
$core->callBehavior('myBlogNumbersWidgetInit',$w);
|
||||
|
||||
# widget option - page to show on
|
||||
$w->myblognumbers->setting(
|
||||
'homeonly',
|
||||
__('Display on:'),
|
||||
0,
|
||||
'combo',
|
||||
array(
|
||||
__('All pages') => 0,
|
||||
__('Home page only') => 1,
|
||||
__('Except on home page') => 2
|
||||
)
|
||||
);
|
||||
# widget option - content only
|
||||
$w->myblognumbers->setting(
|
||||
'content_only',
|
||||
__('Content only'),
|
||||
0,
|
||||
'check'
|
||||
);
|
||||
# widget option - additionnal CSS
|
||||
$w->myblognumbers->setting(
|
||||
'class',
|
||||
__('CSS class:'),
|
||||
''
|
||||
);
|
||||
$w->myblognumbers->setting('offline',__('Offline'),0,'check');
|
||||
$w->myblognumbers
|
||||
->addHomeOnly()
|
||||
->addContentOnly()
|
||||
->addClass()
|
||||
->addOffline();
|
||||
}
|
13
dcstore.xml
Normal file
13
dcstore.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<modules xmlns:da="http://dotaddict.org/da/">
|
||||
<module id="myBlogNumbers">
|
||||
<name>myBlogNumbers</name>
|
||||
<version>2021.08.27</version>
|
||||
<author>Jean-Christian Denis, Pierre Van Glabeke</author>
|
||||
<desc>Show some figures of your blog</desc>
|
||||
<file>https://github.com/JcDenis/myBlogNumbers/releases/download/v2021.08.27/plugin-myBlogNumbers.zip</file>
|
||||
<da:dcmin>2.19</da:dcmin>
|
||||
<da:details>http://plugins.dotaddict.org/dc2/details/myBlogNumbers</da:details>
|
||||
<da:section></da:section>
|
||||
<da:support>http://forum.dotclear.org/viewtopic.php?id=40934</da:support>
|
||||
</module>
|
||||
</modules>
|
Loading…
Reference in New Issue
Block a user