diff --git a/CHANGELOG b/CHANGELOG
deleted file mode 100644
index 12a34b5..0000000
--- a/CHANGELOG
+++ /dev/null
@@ -1,29 +0,0 @@
-v0.6 - 22-04-2015 - Pierre Van Glabeke
-* Modifs typo
-* Ajout message
-* Modif url support
-
-v0.5 - 2013-11-12
-* Clean up code
-
-v0.4 - 2011-01-20
-* Fixed call to blog object on prepend
-* New year copyright
-
-v0.3.2 - 2010-11-12
-* Fixed install on nightly build
-
-v0.3.1 - 2010-06-22
-* Fixed me!
-
-v0.3 - 2010-06-05
-* Switched to DC 2.2
-
-v0.2 - 2009-12-13
-* Fixed trigger blogs
-* Enabled min length of comment to filter
-* Prepared DC 2.2 Break
-* Added versioning
-
-v0.1 - 2009-10-09
-* First lab release
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..ec10858
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,32 @@
+v0.7 - 2021.08.27
+- cleanup (PSR2,short array, ...)
+
+v0.6 - 22-04-2015 - Pierre Van Glabeke
+- Modifs typo
+- Ajout message
+- Modif url support
+
+v0.5 - 2013-11-12
+- Clean up code
+
+v0.4 - 2011-01-20
+- Fixed call to blog object on prepend
+- New year copyright
+
+v0.3.2 - 2010-11-12
+- Fixed install on nightly build
+
+v0.3.1 - 2010-06-22
+- Fixed me!
+
+v0.3 - 2010-06-05
+- Switched to DC 2.2
+
+v0.2 - 2009-12-13
+- Fixed trigger blogs
+- Enabled min length of comment to filter
+- Prepared DC 2.2 Break
+- Added versioning
+
+v0.1 - 2009-10-09
+- First lab release
\ No newline at end of file
diff --git a/README.md b/README.md
index 4ccd08d..60dacc8 100644
--- a/README.md
+++ b/README.md
@@ -20,3 +20,14 @@ First install dcFilterDuplicate, manualy from a zip package or from
Dotaddict repository. (See Dotclear's documentation to know how do this)
Enable and configure "Dupicate comments filter" from antispam manager.
+
+## MORE
+
+ * License : GNU GPL v2
+ * Source & contribution : [GitHub Page](https://github.com/JcDenis/dcFilterDuplicate)
+ * Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/dcFilterDuplicate)
+
+## CONTRIBUTORS
+
+ * Jean-Chirstian Denis
+ * Pierre Van Glabeke
\ No newline at end of file
diff --git a/_define.php b/_define.php
index e913166..76b3781 100644
--- a/_define.php
+++ b/_define.php
@@ -3,7 +3,7 @@
#
# This file is part of dcFilterDuplicate, 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,26 +12,21 @@
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) {
-
- return null;
+ return null;
}
$this->registerModule(
- /* Name */
- "dcFilterDuplicate",
- /* Description*/
- "Antispam for duplicate comments on multiblog",
- /* Author */
- "Jean-Christian Denis, Pierre Van Glabeke",
- /* Version */
- '0.6',
- /* Properies */
- array(
- 'permissions' => 'admin',
- 'priority' => 200,
- 'type' => 'plugin',
- 'dc_min' => '2.6',
- 'support' => 'http://forum.dotclear.org/viewtopic.php?pid=332947#p332947',
- 'details' => 'http://plugins.dotaddict.org/dc2/details/dcFilterDuplicate'
- )
+ "dcFilterDuplicate",
+ "Antispam for duplicate comments on multiblog",
+ "Jean-Christian Denis, Pierre Van Glabeke",
+ '0.7',
+ [
+ 'permissions' => 'admin',
+ 'priority' => 200,
+ 'type' => 'plugin',
+ 'dc_min' => '2.19',
+ 'support' => 'http://forum.dotclear.org/viewtopic.php?pid=332947#p332947',
+ 'details' => 'http://plugins.dotaddict.org/dc2/details/dcFilterDuplicate',
+ 'repository' => 'https://raw.githubusercontent.com/JcDenis/dcFilterDuplicate/master/dcstore.xml'
+ ]
);
\ No newline at end of file
diff --git a/_install.php b/_install.php
index 5acc279..0c12c60 100644
--- a/_install.php
+++ b/_install.php
@@ -3,7 +3,7 @@
#
# This file is part of dcFilterDuplicate, 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,63 +12,50 @@
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
-
- return null;
+ return null;
}
# -- Module specs --
-
$dc_min = '2.6';
$mod_id = 'dcFilterDuplicate';
-$mod_conf = array(
- array(
- 'dcfilterduplicate_minlen',
- 'Minimum lenght of comment to filter',
- 30,
- 'integer'
- )
-);
+$mod_conf = [[
+ 'dcfilterduplicate_minlen',
+ 'Minimum lenght of comment to filter',
+ 30,
+ 'integer'
+]];
# -- Nothing to change below --
-
try {
-
- # Check module version
- if (version_compare(
- $core->getVersion($mod_id),
- $core->plugins->moduleInfo($mod_id, 'version'),
- '>='
- )) {
-
- return null;
- }
-
- # Check Dotclear version
- if (!method_exists('dcUtils', 'versionsCompare')
- || dcUtils::versionsCompare(DC_VERSION, $dc_min, '<', false)) {
- throw new Exception(sprintf(
- '%s requires Dotclear %s', $mod_id, $dc_min
- ));
- }
-
- # Set module settings
- $core->blog->settings->addNamespace($mod_id);
- foreach($mod_conf as $v) {
- $core->blog->settings->{$mod_id}->put(
- $v[0], $v[2], $v[3], $v[1], false, true
- );
- }
-
- # Set module version
- $core->setVersion(
- $mod_id,
- $core->plugins->moduleInfo($mod_id, 'version')
- );
-
- return true;
+ # Check module version
+ if (version_compare(
+ $core->getVersion($mod_id),
+ $core->plugins->moduleInfo($mod_id, 'version'),
+ '>=')) {
+ return null;
+ }
+ # Check Dotclear version
+ if (!method_exists('dcUtils', 'versionsCompare')
+ || dcUtils::versionsCompare(DC_VERSION, $dc_min, '<', false)) {
+ throw new Exception(sprintf(
+ '%s requires Dotclear %s', $mod_id, $dc_min
+ ));
+ }
+ # Set module settings
+ $core->blog->settings->addNamespace($mod_id);
+ foreach($mod_conf as $v) {
+ $core->blog->settings->{$mod_id}->put(
+ $v[0], $v[2], $v[3], $v[1], false, true
+ );
+ }
+ # Set module version
+ $core->setVersion(
+ $mod_id,
+ $core->plugins->moduleInfo($mod_id, 'version')
+ );
+ return true;
}
catch (Exception $e) {
- $core->error->add($e->getMessage());
-
- return false;
+ $core->error->add($e->getMessage());
+ return false;
}
\ No newline at end of file
diff --git a/_prepend.php b/_prepend.php
index b4ace8b..3b84757 100644
--- a/_prepend.php
+++ b/_prepend.php
@@ -3,7 +3,7 @@
#
# This file is part of dcFilterDuplicate, 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,11 +12,10 @@
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) {
-
- return null;
+ return null;
}
$__autoload['dcFilterDuplicate'] =
- dirname(__FILE__).'/inc/class.filter.duplicate.php';
+ dirname(__FILE__) . '/inc/class.filter.duplicate.php';
$core->spamfilters[] = 'dcFilterDuplicate';
\ No newline at end of file
diff --git a/_uninstall.php b/_uninstall.php
index db35cc9..1606f6a 100644
--- a/_uninstall.php
+++ b/_uninstall.php
@@ -3,7 +3,7 @@
#
# This file is part of dcFilterDuplicate, 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,50 +12,49 @@
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
-
- return null;
+ return null;
}
$mod_id = 'dcFilterDuplicate';
$this->addUserAction(
- /* type */ 'settings',
- /* action */ 'delete_all',
- /* ns */ $mod_id,
- /* desc */ __('delete all settings')
+ /* type */ 'settings',
+ /* action */ 'delete_all',
+ /* ns */ $mod_id,
+ /* desc */ __('delete all settings')
);
$this->addUserAction(
- /* type */ 'plugins',
- /* action */ 'delete',
- /* ns */ $mod_id,
- /* desc */ __('delete plugin files')
+ /* type */ 'plugins',
+ /* action */ 'delete',
+ /* ns */ $mod_id,
+ /* desc */ __('delete plugin files')
);
$this->addUserAction(
- /* type */ 'versions',
- /* action */ 'delete',
- /* ns */ $mod_id,
- /* desc */ __('delete the version number')
+ /* type */ 'versions',
+ /* action */ 'delete',
+ /* ns */ $mod_id,
+ /* desc */ __('delete the version number')
);
$this->addDirectAction(
- /* type */ 'settings',
- /* action */ 'delete_all',
- /* ns */ $mod_id,
- /* desc */ sprintf(__('delete all %s settings'), $mod_id)
+ /* type */ 'settings',
+ /* action */ 'delete_all',
+ /* ns */ $mod_id,
+ /* desc */ sprintf(__('delete all %s settings'), $mod_id)
);
$this->addDirectAction(
- /* type */ 'versions',
- /* action */ 'delete',
- /* ns */ $mod_id,
- /* desc */ sprintf(__('delete %s version number'), $mod_id)
+ /* type */ 'versions',
+ /* action */ 'delete',
+ /* ns */ $mod_id,
+ /* desc */ sprintf(__('delete %s version number'), $mod_id)
);
$this->addDirectAction(
- /* type */ 'plugins',
- /* action */ 'delete',
- /* ns */ $mod_id,
- /* desc */ sprintf(__('delete %s plugin files'), $mod_id)
+ /* type */ 'plugins',
+ /* action */ 'delete',
+ /* ns */ $mod_id,
+ /* desc */ sprintf(__('delete %s plugin files'), $mod_id)
);
\ No newline at end of file
diff --git a/dcstore.xml b/dcstore.xml
new file mode 100644
index 0000000..d2b7b82
--- /dev/null
+++ b/dcstore.xml
@@ -0,0 +1,13 @@
+