clean up php files

This commit is contained in:
Jean-Christian Paul Denis 2021-09-02 20:35:25 +02:00
parent f08fe78156
commit abb1308058
13 changed files with 298 additions and 289 deletions

View File

@ -1,81 +1,90 @@
enhancePostContent xxxx.xx.xx
* Not added priority on filters for replacement order
* Not added priority on lists of filters for replacement order
* Not added auto-find post title in content
xxxx.xx.xx
- [ ] add priority on filters for replacement order
- [ ] add priority on lists of filters for replacement order
- [ ] add auto-find post title in content
- [ ] split filters into modules
- [ ] fix filters on spaces after words
enhancePostContent 2021.08.24
* switch to Dotclear 2.19
* switch to php 7.3+ and php 8.0.x
* switch to Github
* update license
* update php code to PSR-2 and short array
* move settings from plugin to blog
2021.08.24.1
- add links to blog prefs
- clean up php files style
- add dcstore.xml
enhancePostContent 2013.11.08
* Switch to Dotclear 2.6 (admin styles and settings)
* Add dashboard icon
* Add widget options (content_only and class)
* Fix records list pager
2021.08.24
- switch to Dotclear 2.19
- switch to php 7.3+ and php 8.0.x
- switch to Github
- update license
- update php code to PSR-2 and short array
- move settings from plugin to blog
- fix widget rendering
- fix php strict warning on undeclared var on public content
enhancePostContent 2013.06.25
* Fixed widget compatibility for php 5.4
2013.11.08
- Switch to Dotclear 2.6 (admin styles and settings)
- Add dashboard icon
- Add widget options (content_only and class)
- Fix records list pager
enhancePostContent 2013.05.11
* Fixed bug with Twitter replacement and wiki synthax of blockquote
* Fixed page title
2013.06.25
- Fixed widget compatibility for php 5.4
enhancePostContent 2011.06.03
* Added 'feeds pages'
2013.05.11
- Fixed bug with Twitter replacement and wiki synthax of blockquote
- Fixed page title
enhancePostContent 0.9 - 2010-06-06
* Switched to DC 2.2
2011.06.03
- Added 'feeds pages'
enhancePostContent 0.8.1 - 2010-03-31
* Fixed some l10n
* Added option for default list order
0.9 - 2010-06-06
- Switched to DC 2.2
enhancePostContent 0.8 - 2010-03-31
* Added admin lists sortable
* Added pager for admin lists
* Added update on records
* Changed title of HTML tag on links replacement
* Removed empty CSS from head
* Enhanced admin pages
0.8.1 - 2010-03-31
- Fixed some l10n
- Added option for default list order
enhancePostContent 0.7 - 2010-01-12
* Moved lists from setting to a new database
0.8 - 2010-03-31
- Added admin lists sortable
- Added pager for admin lists
- Added update on records
- Changed title of HTML tag on links replacement
- Removed empty CSS from head
- Enhanced admin pages
enhancePostContent 0.6 - 2010-01-09
* Fixed HTML tags to use standard tags.
* Fixed CSS class names
* Changed settings management
* Added widget (only for post page)
* Added some post enhancement
0.7 - 2010-01-12
- Moved lists from setting to a new database
enhancePostContent 0.5 - 2009-12-28
* Added support of comment content
* Added support of word replacement
* Added option for case sensitive
* Added option for plural
* Changed class from post-xxx to epc-xxx
* Changed names from acronyme to acronym
* Changed acronym html tag from <span> to <acronym>
* Changed all settings management
0.6 - 2010-01-09
- Fixed HTML tags to use standard tags.
- Fixed CSS class names
- Changed settings management
- Added widget (only for post page)
- Added some post enhancement
enhancePostContent 0.4 - 2009-12-24
* Merry Christmas!
* enhanced filters
* Added support of entry excerpt
* Added support of custom ignored HTML tags
* Added some help
0.5 - 2009-12-28
- Added support of comment content
- Added support of word replacement
- Added option for case sensitive
- Added option for plural
- Changed class from post-xxx to epc-xxx
- Changed names from acronyme to acronym
- Changed acronym html tag from <span> to <acronym>
- Changed all settings management
enhancePostContent 0.3 - 2009-12-21
* Fixed filter with punctuation (slow hack)
* Added word-to-link filter
0.4 - 2009-12-24
- Merry Christmas!
- enhanced filters
- Added support of entry excerpt
- Added support of custom ignored HTML tags
- Added some help
enhancePostContent 0.2 - 2009-12-12
* Fixed case sensitive definition
* Prepared DC 2.2
0.3 - 2009-12-21
- Fixed filter with punctuation (slow hack)
è Added word-to-link filter
enhancePostContent 0.1 - 2009-10-17
* First release
0.2 - 2009-12-12
- Fixed case sensitive definition
- Prepared DC 2.2
0.1 - 2009-10-17
- First release

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_CONTEXT_ADMIN')) {
return null;

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return null;
@ -19,12 +19,13 @@ $this->registerModule(
'Enhance post content',
'Add features to words in post content',
'Jean-Christian Denis and Contributors',
'2021.08.24',
'2021.08.24.1',
[
'requires' => [['core', '2.19']],
'permissions' => 'contentadmin',
'type' => 'plugin',
'dc_min' => '2.18',
'support' => 'https://github.com/JcDenis/enhancePostContent',
'details' => 'https://plugins.dotaddict.org/dc2/details/enhancePostContent'
'details' => 'https://plugins.dotaddict.org/dc2/details/enhancePostContent',
'repository' => 'https://raw.githubusercontent.com/JcDenis/enhancePostContent/master/dcstore.xml'
]
);

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_CONTEXT_ADMIN')) {
return null;

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return null;

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return null;

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_CONTEXT_ADMIN')){
return;

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return null;

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
# l10n
__('Tag');__('Search');__('Acronym');__('Abbreviation');__('Definition');
@ -23,7 +23,7 @@ class libEPC
#
# Default definition
#
public static function defaultAllowedTplValues()
{
return [
@ -32,7 +32,7 @@ class libEPC
'comment content' => 'CommentContent',
];
}
public static function blogAllowedTplValues()
{
global $core;
@ -41,11 +41,11 @@ class libEPC
$rs = @unserialize($core->blog->settings->enhancePostContent->enhancePostContent_allowedtplvalues);
return is_array($rs) ? $rs : $allowedtplvalues;
}
public static function defaultAllowedWidgetValues()
{
global $core;
$rs = [
'entry excerpt' => [
'id' => 'entryexcerpt',
@ -60,12 +60,12 @@ class libEPC
'callback' => ['libEPC','widgetContentCommentContent']
]
];
$core->callBehavior('enhancePostContentAllowedWidgetValues', $rs);
return $rs;
}
public static function defaultAllowedPubPages()
{
return [
@ -77,7 +77,7 @@ class libEPC
'RSS feeds' => 'rss2.xml'
];
}
public static function blogAllowedPubPages()
{
global $core;
@ -86,24 +86,24 @@ class libEPC
$rs = @unserialize($core->blog->settings->enhancePostContent->enhancePostContent_allowedpubpages);
return is_array($rs) ? $rs : $allowedpubpages;
}
public static function defaultFilters()
{
global $core;
$filters = [
'Tag' => [
'id' => 'tag',
'publicContentFilter' => ['libEPC', 'publicContentFilterTag'],
'widgetListFilter' => ['libEPC', 'widgetListTag'],
'help' => __('Highlight tags of your blog.'),
'has_list' => false,
'htmltag' => 'a',
'class' => ['a.epc-tag'],
'replace' => '<a class="epc-tag" href="%s" title="' . __('Tag') . '">%s</a>',
'widget' => '<a href="%s" title="' . __('Tag') . '">%s</a>',
'nocase' => false,
'plural' => false,
'limit' => 0,
@ -115,13 +115,13 @@ class libEPC
'Search' => [
'id' => 'search',
'publicContentFilter' => ['libEPC', 'publicContentFilterSearch'],
'help' => __('Highlight searched words.'),
'has_list' => false,
'htmltag' => '',
'class' => ['span.epc-search'],
'replace' => '<span class="epc-search" title="' . __('Search') . '">%s</span>',
'nocase' => true,
'plural' => true,
'limit' => 0,
@ -134,14 +134,14 @@ class libEPC
'id' => 'acronym',
'publicContentFilter' => ['libEPC', 'publicContentFilterAcronym'],
'widgetListFilter' => ['libEPC', 'widgetListAcronym'],
'help' => __('Explain some acronyms. First term of the list is the acornym and second term the explanation.'),
'has_list' => true,
'htmltag' => 'acronym',
'class' => ['acronym.epc-acronym'],
'replace' => '<acronym class="epc-acronym" title="%s">%s</acronym>',
'widget' => '<acronym title="%s">%s</acronym>',
'nocase' => false,
'plural' => false,
'limit' => 0,
@ -154,14 +154,14 @@ class libEPC
'id' => 'abbreviation',
'publicContentFilter' => ['libEPC', 'publicContentFilterAbbreviation'],
'widgetListFilter' => ['libEPC', 'widgetListAbbreviation'],
'help' => __('Explain some abbreviation. First term of the list is the abbreviation and second term the explanation.'),
'has_list' => true,
'htmltag' => 'a',
'class' => ['abbr.epc-abbr'],
'replace' => '<abbr class="epc-abbr" title="%s">%s</abbr>',
'widget' => '<abbr title="%s">%s</abbr>',
'nocase' => false,
'plural' => false,
'limit' => 0,
@ -174,14 +174,14 @@ class libEPC
'id' => 'definition',
'publicContentFilter' => ['libEPC', 'publicContentFilterDefinition'],
'widgetListFilter' => ['libEPC', 'widgetListDefinition'],
'help' => __('Explain some definition. First term of the list is the sample to define and second term the explanation.'),
'has_list' => true,
'htmltag' => 'dfn',
'class' => ['dfn.epc-dfn'],
'replace' => '<dfn class="epc-dfn" title="%s">%s</dfn>',
'widget' => '<dfn class="epc-dfn" title="%s">%s</dfn>',
'nocase' => false,
'plural' => false,
'limit' => 0,
@ -194,14 +194,14 @@ class libEPC
'id' => 'citation',
'publicContentFilter' => ['libEPC', 'publicContentFilterCitation'],
'widgetListFilter' => ['libEPC', 'widgetListCitation'],
'help' => __('Highlight citation of people. First term of the list is the citation and second term the author.'),
'has_list' => true,
'htmltag' => 'cite',
'class' => ['cite.epc-cite'],
'replace' => '<cite class="epc-cite" title="%s">%s</cite>',
'widget' => '<cite title="%s">%s</cite>',
'nocase' => true,
'plural' => false,
'limit' => 0,
@ -214,14 +214,14 @@ class libEPC
'id' => 'link',
'publicContentFilter' => ['libEPC', 'publicContentFilterLink'],
'widgetListFilter' => ['libEPC', 'widgetListLink'],
'help' => __('Link some words. First term of the list is the term to link and second term the link.'),
'has_list' => true,
'htmltag' => 'a',
'class' => ['a.epc-link'],
'replace' => '<a class="epc-link" title="%s" href="%s">%s</a>',
'widget' => '<a title="%s" href="%s">%s</a>',
'nocase' => false,
'plural' => false,
'limit' => 0,
@ -233,13 +233,13 @@ class libEPC
'Replace' => [
'id' => 'replace',
'publicContentFilter' => ['libEPC', 'publicContentFilterReplace'],
'help' => __('Replace some text. First term of the list is the text to replace and second term the replacement.'),
'has_list' => true,
'htmltag' => '',
'class' => ['span.epc-replace'],
'replace' => '<span class="epc-replace">%s</span>',
'nocase' => true,
'plural' => true,
'limit' => 0,
@ -251,13 +251,13 @@ class libEPC
'Update' => [
'id' => 'update',
'publicContentFilter' => ['libEPC', 'publicContentFilterUpdate'],
'help' => __('Update and show terms. First term of the list is the term to update and second term the new term.'),
'has_list' => true,
'htmltag' => 'del,ins',
'class' => ['del.epc-update', 'ins.epc-update'],
'replace' => '<del class="epc-update">%s</del> <ins class="epc-update">%s</ins>',
'nocase' => true,
'plural' => true,
'limit' => 0,
@ -269,13 +269,13 @@ class libEPC
'Twitter' => [
'id' => 'twitter',
'publicContentFilter' => ['libEPC', 'publicContentFilterTwitter'],
'help' => __('Add link to twitter user page. Every word started with "@" will be considered as twitter user.'),
'has_list' => false,
'htmltag' => 'a',
'class' => ['a.epc-twitter'],
'replace' => '<a class="epc-twitter" title="' . __("View this user's twitter page") . '" href="%s">%s</a>',
'nocase' => false,
'plural' => false,
'limit' => 0,
@ -285,23 +285,23 @@ class libEPC
'pubPages' => ['post.html']
]
];
$core->callBehavior('enhancePostContentDefaultFilters', $filters);
return $filters;
}
public static function blogFilters($one = null)
{
global $core;
$core->blog->settings->addNamespace('enhancePostContent');
$filters = self::defaultFilters();
foreach($filters as $name => $filter) {
# Parse filters options
$ns = 'enhancePostContent_' . $name;
$opt[$name] = @unserialize($core->blog->settings->enhancePostContent->$ns);
if (!is_array($opt[$name])) {
$opt[$name] = [];
}
@ -327,9 +327,9 @@ class libEPC
$filters[$name]['pubPages'] = (array) $opt[$name]['pubPages'];
}
}
$core->callBehavior('enhancePostContentBlogFilters', $filters);
return $filters;
}
@ -346,7 +346,7 @@ class libEPC
&& empty($args[2]) // remove html
;
}
public static function replaceString($p, $r, $s, $filter, $before = '\b', $after = '\b')
{
# Limit
@ -386,7 +386,7 @@ class libEPC
# Clean rest
return $s = preg_replace('#ççççç(.*?)ççççç#s', '$1', $s);
}
public static function matchString($p, $r, $s, $filter, $before = '\b', $after = '\b')
{
# Case sensitive
@ -399,7 +399,7 @@ class libEPC
if (!$t) {
return ['total' => 0, 'matches' => []];
}
# Build array
$m = [];
$loop = 0;
@ -411,22 +411,22 @@ class libEPC
}
return ['total' => $t, 'matches' => $m];
}
public static function quote($s)
{
return preg_quote($s, '#');
}
public static function removeTags($m)
{
return $m[1] . preg_replace('#ççççç(?!ççççç)#s', '$1', $m[3]) . $m[4];
}
public static function decodeTags($t)
{
return preg_match_all('#([A-Za-z0-9]+)#', (string) $t, $m) ? $m[1] : [];
}
public static function implode($a)
{
if (is_string($a)) {
@ -435,14 +435,14 @@ class libEPC
if (!is_array($a)) {
return [];
}
$r = '';
foreach($a as $k => $v) {
$r .= $k . ':' . $v . ';';
}
return $r;
}
public static function explode($s)
{
if (is_array($s)) {
@ -451,71 +451,71 @@ class libEPC
if (!is_string($s)) {
return '';
}
$r = [];
$s = explode(';', (string) $s);
if (!is_array($s)) {
return [];
}
foreach($s as $cpl) {
$cur = explode(':', $cpl);
if (!is_array($cur) || !isset($cur[1])) {
continue;
}
$key = html::escapeHTML(trim($cur[0]));
$val = html::escapeHTML(trim($cur[1]));
if (empty($key) || empty($val)) {
continue;
}
$r[$key] = $val;
}
return $r;
}
#
# Widgets
#
public static function widgetContentEntryExcerpt($core, $w)
{
global $_ctx;
if (!$_ctx->exists('posts')) {
return;
}
$res = '';
while ($_ctx->posts->fetch()) {
$res .= $_ctx->posts->post_excerpt;
}
return $res;
}
public static function widgetContentEntryContent()
{
global $_ctx;
if (!$_ctx->exists('posts')) {
return;
}
$res = '';
while ($_ctx->posts->fetch()) {
$res .= $_ctx->posts->post_content;
}
return $res;
}
public static function widgetContentCommentContent()
{
global $core, $_ctx;
if (!$_ctx->exists('posts')) {
return;
}
$res = '';
$post_ids = [];
while ($_ctx->posts->fetch()) {
@ -526,19 +526,19 @@ class libEPC
}
return $res;
}
#
# Filters
#
public static function publicContentFilterTag($core, $filter, $tag, $args)
{
if (!$core->plugins->moduleExists('tags')) {
return;
}
$metas = $core->meta->getMetadata(['meta_type' => 'tag']);
while($metas->fetch()) {
$k = $metas->meta_id;
$args[0] = self::replaceString(
@ -550,7 +550,7 @@ class libEPC
}
return;
}
public static function widgetListTag($core, $filter, $content, $w, &$list)
{
if (!$core->plugins->moduleExists('tags')) {
@ -558,7 +558,7 @@ class libEPC
}
$metas = $core->meta->getMetadata(['meta_type' => 'tag']);
while($metas->fetch()) {
$k = $metas->meta_id;
$list[] = self::matchString(
@ -570,15 +570,15 @@ class libEPC
}
return;
}
public static function publicContentFilterSearch($core, $filter, $tag, $args)
{
if (!isset($GLOBALS['_search'])) {
return;
}
$searchs = explode(' ', $GLOBALS['_search']);
foreach($searchs as $k => $v) {
$args[0] = self::replaceString(
$v,
@ -589,13 +589,13 @@ class libEPC
}
return;
}
public static function publicContentFilterAcronym($core, $filter, $tag, $args)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$args[0] = self::replaceString(
$k,
sprintf($filter['replace'], __($v), '\\1'),
@ -605,13 +605,13 @@ class libEPC
}
return;
}
public static function widgetListAcronym($core, $filter, $content, $w, &$list)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$list[] = self::matchString(
$k,
sprintf($filter['widget'], __($v), '\\1'),
@ -621,13 +621,13 @@ class libEPC
}
return;
}
public static function publicContentFilterAbbreviation($core, $filter, $tag, $args)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$args[0] = self::replaceString(
$k,
sprintf($filter['replace'], __($v), '\\1'),
@ -637,13 +637,13 @@ class libEPC
}
return;
}
public static function widgetListAbbreviation($core, $filter, $content, $w, &$list)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$list[] = self::matchString(
$k,
sprintf($filter['widget'], __($v), '\\1'),
@ -653,13 +653,13 @@ class libEPC
}
return;
}
public static function publicContentFilterDefinition($core, $filter, $tag, $args)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$args[0] = self::replaceString(
$k,
sprintf($filter['replace'], __($v), '\\1'),
@ -669,13 +669,13 @@ class libEPC
}
return;
}
public static function widgetListDefinition($core, $filter, $content, $w, &$list)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$list[] = self::matchString(
$k,
sprintf($filter['widget'], __($v), '\\1'),
@ -685,13 +685,13 @@ class libEPC
}
return;
}
public static function publicContentFilterCitation($core, $filter, $tag, $args)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$args[0] = self::replaceString(
$k,
sprintf($filter['replace'], __($v), '\\1'),
@ -701,13 +701,13 @@ class libEPC
}
return;
}
public static function widgetListCitation($core, $filter, $content, $w, &$list)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$list[] = self::matchString(
$k,
sprintf($filter['widget'], __($v), '\\1'),
@ -717,13 +717,13 @@ class libEPC
}
return;
}
public static function publicContentFilterLink($core, $filter, $tag, $args)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$args[0] = self::replaceString(
$k,
sprintf($filter['replace'], '\\1', $v, '\\1'),
@ -733,13 +733,13 @@ class libEPC
}
return;
}
public static function widgetListLink($core, $filter, $content, $w, &$list)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$list[] = self::matchString(
$k,
sprintf($filter['widget'], $v, $v, '\\1'),
@ -749,13 +749,13 @@ class libEPC
}
return;
}
public static function publicContentFilterReplace($core, $filter, $tag, $args)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$args[0] = self::replaceString(
$k,
sprintf($filter['replace'], $v, '\\2'),
@ -765,13 +765,13 @@ class libEPC
}
return;
}
public static function publicContentFilterUpdate($core, $filter, $tag, $args)
{
while($filter['list']->fetch()) {
$k = $filter['list']->epc_key;
$v = $filter['list']->epc_value;
$args[0] = self::replaceString(
$k,
sprintf($filter['replace'], '\\1', $v),
@ -781,7 +781,7 @@ class libEPC
}
return;
}
public static function publicContentFilterTwitter($core, $filter, $tag, $args)
{
$args[0] = self::replaceString(

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
class epcRecords
{
@ -104,9 +104,9 @@ class epcRecords
$cur->epc_id = $this->getNextId();
$cur->blog_id = $this->blog;
$cur->epc_upddt = date('Y-m-d H:i:s');
$this->getCursor($cur);
$cur->insert();
$this->con->unlock();
} catch (Exception $e) {
@ -120,7 +120,7 @@ class epcRecords
return $cur->epc_id;
}
public function updRecord($id, $cur)
{
$id = (integer) $id;

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
# This file only update old filters lists from settings to database

View File

@ -1,15 +1,15 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of enhancePostContent, a plugin for Dotclear 2.
#
# 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
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
/**
* @brief enhancePostContent, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_CONTEXT_ADMIN')) {
return null;
@ -297,7 +297,7 @@ if (isset($filters_id[$default_part])) {
'asc',
'desc'
];
$sortby = !empty($_GET['sortby']) ? $_GET['sortby'] : (string) $s->enhancePostContent_list_sortby;
$order = !empty($_GET['order']) ? $_GET['order'] : (string) $s->enhancePostContent_list_order;
$page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1;

View File

@ -210,5 +210,4 @@ $GLOBALS['__l10n']['Key:'] = 'Clé :';
#index.php:401
$GLOBALS['__l10n']['Value:'] = 'Valeur :';
$GLOBALS['__l10n']['Configuration has been successfully updated.'] = 'La configuration a été mise à jour avec succés.';
$GLOBALS['__l10n']['Configuration has been successfully updated.'] = 'La configuration a été mise à jour avec succés.';