Compare commits

..

No commits in common. "3dd3389c25f568bed2999164172fe8c3b3fc82f5" and "fa8cb9c2915e20e06db9403a87ff27be7817b762" have entirely different histories.

8 changed files with 69 additions and 61 deletions

View File

@ -1,71 +1,50 @@
bloganniv 2.3 - 2023.08.06 2.2 - 2023.05.13
=========================================================== * require Dotclear 2.26
* Require Dotclear 2.27
* Require PHP 7.4+
* Upgrade to Dotclear 2.27
* Move third party repository
* Use Dotclear style for changelog
bloganniv 2.2 - 2023.05.13
===========================================================
* Require Dotclear 2.26
* release for Dotclear 2.26 stable * release for Dotclear 2.26 stable
bloganniv 2.1 - 2023.04.24 2.1 - 2023.04.24
===========================================================
* require Dotclear 2.26 * require Dotclear 2.26
* fix nullsafe warnings * fix nullsafe warnings
* remove magic * remove magic
bloganniv 2.0 - 2023.04.11 2.0 - 2023.04.11
===========================================================
* require Dotclear 2.26 * require Dotclear 2.26
* use namespace * use namespace
bloganniv 1.6 - 2022.12.16 1.6 - 2022.12.16
===========================================================
* update to dotclear 2.24 * update to dotclear 2.24
* fix phpstan errors * fix phpstan errors
bloganniv 1.5.1 - 2015.04.22 - Pierre Van Glabeke 1.5.1 - 2015.04.22 - Pierre Van Glabeke
===========================================================
* nommage widget * nommage widget
* modifs localisation * modifs localisation
bloganniv 1.5 - Pierre Van Glabeke 1.5 - Pierre Van Glabeke
===========================================================
* compatibilité dc2.7 * compatibilité dc2.7
bloganniv 1.4.1 - Pierre Van Glabeke 1.4.1 - Pierre Van Glabeke
===========================================================
* Ajustements settings * Ajustements settings
* Fin de ligne unix * Fin de ligne unix
* complément define.php * complément define.php
bloganniv 1.4 - Pierre Van Glabeke 1.4 - Pierre Van Glabeke
===========================================================
* Modifs affichage pour le widget (remplacement paragraphe par une liste) * Modifs affichage pour le widget (remplacement paragraphe par une liste)
bloganniv 1.3.1 1.3.1
===========================================================
* Ajout choix affichage page pour le widget (content only + css) * Ajout choix affichage page pour le widget (content only + css)
bloganniv 1.3 1.3
===========================================================
* Ajout choix affichage page pour le widget * Ajout choix affichage page pour le widget
* Correction de traduction * Correction de traduction
bloganniv 1.2 1.2
===========================================================
* Ajout du piochage automatique de la date du blog si non saisie dans le widget * Ajout du piochage automatique de la date du blog si non saisie dans le widget
* Ajout @ devant la fonction checkdate pour eviter un warning * Ajout @ devant la fonction checkdate pour eviter un warning
bloganniv 1.1 1.1
===========================================================
* Compatibilité dc2.2 * Compatibilité dc2.2
* Localisation * Localisation
* Intégration corrections proposées sur http://www.myouaibe.com/index.php/post/2007/08/23/Plugin-BlogAnniv-pour-DOTCLEAR-2 * Intégration corrections proposées sur http://www.myouaibe.com/index.php/post/2007/08/23/Plugin-BlogAnniv-pour-DOTCLEAR-2
bloganniv 1.0 1.0
===========================================================
* Création * Création

View File

@ -3,7 +3,7 @@
[![Release](https://img.shields.io/github/v/release/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/releases) [![Release](https://img.shields.io/github/v/release/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/releases)
[![Date](https://img.shields.io/github/release-date/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/releases) [![Date](https://img.shields.io/github/release-date/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/releases)
[![Issues](https://img.shields.io/github/issues/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/issues) [![Issues](https://img.shields.io/github/issues/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/issues)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-blue.svg)](https://fr.dotclear.org/download) [![Dotclear](https://img.shields.io/badge/dotclear-v2.26-blue.svg)](https://fr.dotclear.org/download)
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/bloganniv) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/bloganniv)
[![License](https://img.shields.io/github/license/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/blob/master/LICENSE) [![License](https://img.shields.io/github/license/JcDenis/bloganniv)](https://github.com/JcDenis/bloganniv/blob/master/LICENSE)
@ -22,7 +22,7 @@ It adds widget showing:
_bloganniv_ requires: _bloganniv_ requires:
* permissions to manage widgets * permissions to manage widgets
* Dotclear 2.27 * Dotclear 2.26
## USAGE ## USAGE
@ -34,8 +34,8 @@ Add and configure "Blog anniv" from widgets manager.
## LINKS ## LINKS
* License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html) * License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html)
* Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/bloganniv) or [GitHub Page](https://github.com/JcDenis/bloganniv) * Source & contribution : [GitHub Page](https://github.com/JcDenis/bloganniv)
* Packages & details : [Gitea Page](https://git.dotclear.watch/JcDenis/bloganniv/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/bloganniv) * Packages & details : [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/bloganniv)
## CONTRIBUTORS ## CONTRIBUTORS

View File

@ -10,7 +10,7 @@
* @copyright Jean-Christian Denis * @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH') || is_null(dcCore::app()->auth)) {
return null; return null;
} }
@ -18,15 +18,15 @@ $this->registerModule(
'Blog Anniv', 'Blog Anniv',
'Counting the number of days before and after a particular date', 'Counting the number of days before and after a particular date',
'Fran6t, Pierre Van Glabeke and Contributors', 'Fran6t, Pierre Van Glabeke and Contributors',
'2.3', '2.2',
[ [
'requires' => [['core', '2.27']], 'requires' => [['core', '2.26']],
'permissions' => dcCore::app()->auth->makePermissions([ 'permissions' => dcCore::app()->auth->makePermissions([
dcCore::app()->auth::PERMISSION_ADMIN, dcCore::app()->auth::PERMISSION_ADMIN,
]), ]),
'type' => 'plugin', 'type' => 'plugin',
'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', 'support' => 'https://github.com/JcDenis/' . basename(__DIR__),
'details' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/src/branch/master/README.md', 'details' => 'https://plugins.dotaddict.org/dc2/details/' . basename(__DIR__),
'repository' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/raw/branch/master/dcstore.xml', 'repository' => 'https://raw.githubusercontent.com/JcDenis/' . basename(__DIR__) . '/master/dcstore.xml',
] ]
); );

View File

@ -2,12 +2,12 @@
<modules xmlns:da="http://dotaddict.org/da/"> <modules xmlns:da="http://dotaddict.org/da/">
<module id="bloganniv"> <module id="bloganniv">
<name>Blog Anniv</name> <name>Blog Anniv</name>
<version>2.3</version> <version>2.2</version>
<author>Fran6t, Pierre Van Glabeke and Contributors</author> <author>Fran6t, Pierre Van Glabeke and Contributors</author>
<desc>Counting the number of days before and after a particular date</desc> <desc>Counting the number of days before and after a particular date</desc>
<file>https://gitea.dotclear.watch/JcDenis/bloganniv/releases/download/v2.3/plugin-bloganniv.zip</file> <file>https://github.com/JcDenis/bloganniv/releases/download/v2.2/plugin-bloganniv.zip</file>
<da:dcmin>2.27</da:dcmin> <da:dcmin>2.26</da:dcmin>
<da:details>https://git.dotclear.watch/JcDenis/bloganniv/src/branch/master/README.md</da:details> <da:details>https://plugins.dotaddict.org/dc2/details/bloganniv</da:details>
<da:support>https://git.dotclear.watch/JcDenis/bloganniv/issues</da:support> <da:support>https://github.com/JcDenis/bloganniv</da:support>
</module> </module>
</modules> </modules>

View File

@ -15,18 +15,20 @@ declare(strict_types=1);
namespace Dotclear\Plugin\bloganniv; namespace Dotclear\Plugin\bloganniv;
use dcCore; use dcCore;
use Dotclear\Core\Process; use dcNsProcess;
class Backend extends Process class Backend extends dcNsProcess
{ {
public static function init(): bool public static function init(): bool
{ {
return self::status(My::checkContext(My::BACKEND)); static::$init = defined('DC_CONTEXT_ADMIN');
return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!self::status()) { if (!static::$init) {
return false; return false;
} }

View File

@ -15,18 +15,20 @@ declare(strict_types=1);
namespace Dotclear\Plugin\bloganniv; namespace Dotclear\Plugin\bloganniv;
use dcCore; use dcCore;
use Dotclear\Core\Process; use dcNsProcess;
class Frontend extends Process class Frontend extends dcNsProcess
{ {
public static function init(): bool public static function init(): bool
{ {
return self::status(My::checkContext(My::FRONTEND)); static::$init = defined('DC_RC_PATH');
return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!self::status()) { if (!static::$init) {
return false; return false;
} }

View File

@ -14,11 +14,36 @@ declare(strict_types=1);
namespace Dotclear\Plugin\bloganniv; namespace Dotclear\Plugin\bloganniv;
use Dotclear\Module\MyPlugin; use dcCore;
/** /**
* This module definitions. * This module definitions.
*/ */
class My extends MyPlugin class My
{ {
/**
* This module id.
*/
public static function id(): string
{
return basename(dirname(__DIR__));
}
/**
* This module name.
*/
public static function name(): string
{
$name = dcCore::app()->plugins->moduleInfo(self::id(), 'name');
return __(is_string($name) ? $name : self::id());
}
/**
* This module path.
*/
public static function path(): string
{
return dirname(__DIR__);
}
} }

View File

@ -90,7 +90,7 @@ class Widgets
$nbrejours = abs($timestamp2 - $timestamp1) / 86400; $nbrejours = abs($timestamp2 - $timestamp1) / 86400;
$nbreannee = abs($annee2 - $annee - 1); $nbreannee = abs($annee2 - $annee - 1);
} }
// abs($timestamp2 - $timestamp1)/(86400*7); //Affichage du nombre de semaine : 3.85 // abs($timestamp2 - $timestamp1)/(86400*7); //Affichage du nombre de semaine : 3.85
} else { } else {
// date invalide // date invalide
return ''; return '';