' .
- $core->formNonce() .
+ dcCore::app()->formNonce() .
$pa->getHiddenFields() .
form::hidden(['action'], 'fac_add') .
'
' .
@@ -327,20 +322,19 @@ class facAdmin
/**
* Linked feed form field
- *
- * @param dcCore $core dcCore instance
+ *
* @param string $url Feed URL
* @param string $format Feed format
- * @return string Feed form content
+ * @return null|string Feed form content
*/
- protected static function formFeed(dcCore $core, $url = '', $format = '')
+ protected static function formFeed($url = '', $format = '')
{
- if (!$core->blog->settings->fac->fac_active) {
+ if (!dcCore::app()->blog->settings->fac->fac_active) {
return null;
}
- return
- '' .
+ return
+ '
' .
'
' . __('Linked feed') . ' ' .
'
' .
__('Feed URL:') . ' ' .
@@ -355,7 +349,7 @@ class facAdmin
__('Format:') . '' .
form::combo(
'fac_format',
- self::comboFac($core),
+ self::comboFac(),
$format,
'maximal'
) . '
' .
@@ -365,19 +359,18 @@ class facAdmin
/**
* List of fac formats
- *
- * @param dcCore $core dcCore instance
+ *
* @return array List of fac formats
*/
- protected static function comboFac(dcCore $core)
+ protected static function comboFac()
{
- $formats = @unserialize($core->blog->settings->fac->fac_formats);
+ $formats = @unserialize(dcCore::app()->blog->settings->fac->fac_formats);
if (!is_array($formats) || empty($formats)) {
return [];
}
$res = [];
- foreach($formats as $uid => $f) {
+ foreach ($formats as $uid => $f) {
$res[$f['name']] = $uid;
}
@@ -386,42 +379,40 @@ class facAdmin
/**
* Delete linked feed
- *
- * @param dcCore $core dcCore instance
+ *
* @param integer $post_id Post id
*/
- protected static function delFeed(dcCore $core, $post_id)
+ protected static function delFeed($post_id)
{
- $post_id = (integer) $post_id;
- $core->meta->delPostMeta($post_id, 'fac');
- $core->meta->delPostMeta($post_id, 'facformat');
+ $post_id = (int) $post_id;
+ dcCore::app()->meta->delPostMeta($post_id, 'fac');
+ dcCore::app()->meta->delPostMeta($post_id, 'facformat');
}
/**
* Add linked feed
- *
- * @param dcCore $core dcCore instance
+ *
* @param integer $post_id Post id
- * @param array $options Feed options
+ * @param array|ArrayObject $options Feed options
*/
- protected static function addFeed($core, $post_id, $options)
+ protected static function addFeed($post_id, $options)
{
- if (empty($options['fac_url'])
+ if (empty($options['fac_url'])
|| empty($options['fac_format'])) {
return null;
}
- $post_id = (integer) $post_id;
+ $post_id = (int) $post_id;
- $core->meta->setPostMeta(
+ dcCore::app()->meta->setPostMeta(
$post_id,
'fac',
$options['fac_url']
);
- $core->meta->setPostMeta(
+ dcCore::app()->meta->setPostMeta(
$post_id,
'facformat',
$options['fac_format']
);
}
-}
\ No newline at end of file
+}
diff --git a/_config.php b/_config.php
index 49428ac..c57518d 100644
--- a/_config.php
+++ b/_config.php
@@ -1,30 +1,29 @@
auth->isSuperAdmin()) {
+if (!dcCore::app()->auth->isSuperAdmin()) {
return null;
}
-$redir = empty($_REQUEST['redir']) ?
- $list->getURL() . '#plugins' : $_REQUEST['redir'];
+$redir = empty($_REQUEST['redir']) ?
+ dcCore::app()->admin->list->getURL() . '#plugins' : $_REQUEST['redir'];
# -- Get settings --
-$core->blog->settings->addNamespace('fac');
-$s = $core->blog->settings->fac;
+dcCore::app()->blog->settings->addNamespace('fac');
+$s = dcCore::app()->blog->settings->fac;
$fac_formats = @unserialize($s->fac_formats);
@@ -37,7 +36,7 @@ if (!empty($_POST['save'])) {
try {
$fac_formats = [];
- foreach($_POST['fac_formats'] as $uid => $f) {
+ foreach ($_POST['fac_formats'] as $uid => $f) {
if (!empty($f['name'])) {
$fac_formats[$uid] = $f;
}
@@ -46,31 +45,31 @@ if (!empty($_POST['save'])) {
// fix 2021.08.21 : formats are now global
$s->drop('fac_formats');
$s->put(
- 'fac_formats',
- serialize($fac_formats),
- 'string',
- 'Formats of feeds contents',
- true,
+ 'fac_formats',
+ serialize($fac_formats),
+ 'string',
+ 'Formats of feeds contents',
+ true,
true
);
- $core->blog->triggerBlog();
+ dcCore::app()->blog->triggerBlog();
- dcPage::addSuccessNotice(
+ dcAdminNotices::addSuccessNotice(
__('Configuration successfully updated.')
);
http::redirect(
- $list->getURL('module=fac&conf=1&redir=' . $list->getRedir())
+ dcCore::app()->admin->list->getURL('module=fac&conf=1&redir=' . dcCore::app()->admin->list->getRedir())
);
} catch (Exception $e) {
- $core->error->add($e->getMessage());
+ dcCore::app()->error->add($e->getMessage());
}
}
# -- Display form --
$i = 1;
-foreach($fac_formats as $uid => $f) {
+foreach ($fac_formats as $uid => $f) {
if (empty($f['name'])) {
continue;
}
@@ -86,7 +85,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][name]',
- 'fac_formats_' . $uid . '_name'
+ 'fac_formats_' . $uid . '_name',
],
20,
255,
@@ -102,7 +101,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][dateformat]',
- 'fac_formats_' . $uid . '_dateformat'
+ 'fac_formats_' . $uid . '_dateformat',
],
20,
255,
@@ -118,7 +117,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][lineslimit]',
- 'fac_formats_' . $uid . '_lineslimit'
+ 'fac_formats_' . $uid . '_lineslimit',
],
5,
4,
@@ -136,7 +135,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][linestitletext]',
- 'fac_formats_' . $uid . '_linestitletext'
+ 'fac_formats_' . $uid . '_linestitletext',
],
20,
255,
@@ -157,7 +156,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][linestitleover]',
- 'fac_formats_' . $uid . '_linestitleover'
+ 'fac_formats_' . $uid . '_linestitleover',
],
20,
255,
@@ -178,7 +177,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][linestitlelength]',
- 'fac_formats_' . $uid . '_linestitlelength'
+ 'fac_formats_' . $uid . '_linestitlelength',
],
5,
4,
@@ -195,7 +194,7 @@ foreach($fac_formats as $uid => $f) {
form::checkbox(
[
'fac_formats[' . $uid . '][showlinesdescription]',
- 'fac_formats_' . $uid . '_showlinesdescription'
+ 'fac_formats_' . $uid . '_showlinesdescription',
],
1,
!empty($f['showlinesdescription'])
@@ -206,11 +205,11 @@ foreach($fac_formats as $uid => $f) {
form::checkbox(
[
'fac_formats[' . $uid . '][linesdescriptionnohtml]',
- 'fac_formats_' . $uid . '_linesdescriptionnohtml'
+ 'fac_formats_' . $uid . '_linesdescriptionnohtml',
],
1,
!empty($f['linesdescriptionnohtml'])
- ).
+ ) .
__('Remove html of description') . '
' .
@@ -218,7 +217,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][linesdescriptionlength]',
- 'fac_formats_' . $uid . '_linesdescriptionlength'
+ 'fac_formats_' . $uid . '_linesdescriptionlength',
],
5,
4,
@@ -235,7 +234,7 @@ foreach($fac_formats as $uid => $f) {
form::checkbox(
[
'fac_formats[' . $uid . '][showlinescontent]',
- 'fac_formats_' . $uid . '_showlinescontent'
+ 'fac_formats_' . $uid . '_showlinescontent',
],
1,
!empty($f['showlinescontent'])
@@ -246,7 +245,7 @@ foreach($fac_formats as $uid => $f) {
form::checkbox(
[
'fac_formats[' . $uid . '][linescontentnohtml]',
- 'fac_formats_' . $uid . '_linescontentnohtml'
+ 'fac_formats_' . $uid . '_linescontentnohtml',
],
1,
!empty($f['linescontentnohtml'])
@@ -258,7 +257,7 @@ foreach($fac_formats as $uid => $f) {
form::field(
[
'fac_formats[' . $uid . '][linescontentlength]',
- 'fac_formats_' . $uid . '_linescontentlength'
+ 'fac_formats_' . $uid . '_linescontentlength',
],
5,
4,
@@ -288,14 +287,14 @@ __('Name:') . ' ' .
form::field(
[
'fac_formats[' . $uid . '][name]',
- 'fac_formats_' . $uid . '_name'
+ 'fac_formats_' . $uid . '_name',
],
20,
255,
'',
'maximal'
) . '
-
'.
+
' .
__('In order to remove a format, leave its name empty.') .
'
@@ -304,7 +303,7 @@ __('Date format:') . '' .
form::field(
[
'fac_formats[' . $uid . '][dateformat]',
- 'fac_formats_' . $uid . '_dateformat'
+ 'fac_formats_' . $uid . '_dateformat',
],
20,
255,
@@ -320,7 +319,7 @@ __('Entries limit:') . '' .
form::field(
[
'fac_formats[' . $uid . '][lineslimit]',
- 'fac_formats_' . $uid . '_lineslimit'
+ 'fac_formats_' . $uid . '_lineslimit',
],
5,
4,
@@ -338,7 +337,7 @@ __('Title format:') . '' .
form::field(
[
'fac_formats[' . $uid . '][linestitletext]',
- 'fac_formats_' . $uid . '_linestitletext'
+ 'fac_formats_' . $uid . '_linestitletext',
],
20,
255,
@@ -355,11 +354,11 @@ __('Format can be:') .
'
' .
-__('Over title format:') . ' ' .
+__('Over title format:') . '' .
form::field(
[
'fac_formats[' . $uid . '][linestitleover]',
- 'fac_formats_' . $uid . '_linestitleover'
+ 'fac_formats_' . $uid . '_linestitleover',
],
20,
255,
@@ -380,14 +379,14 @@ __('Maximum length of title:') . '' .
form::field(
[
'fac_formats[' . $uid . '][linestitlelength]',
- 'fac_formats_' . $uid . '_linestitlelength'
+ 'fac_formats_' . $uid . '_linestitlelength',
],
5,
4,
150,
'maximal'
) . '
-
' .
+
' .
__('Leave lengh empty for no limit.') .
'
@@ -397,7 +396,7 @@ __('Leave lengh empty for no limit.') .
form::checkbox(
[
'fac_formats[' . $uid . '][showlinesdescription]',
- 'fac_formats_' . $uid . '_showlinesdescription'
+ 'fac_formats_' . $uid . '_showlinesdescription',
],
1,
0
@@ -408,7 +407,7 @@ __('Show description of entries') . '
form::checkbox(
[
'fac_formats[' . $uid . '][linesdescriptionnohtml]',
- 'fac_formats_' . $uid . '_linesdescriptionnohtml'
+ 'fac_formats_' . $uid . '_linesdescriptionnohtml',
],
1,
1
@@ -420,7 +419,7 @@ __('Maximum length of description:') . '' .
form::field(
[
'fac_formats[' . $uid . '][linesdescriptionlength]',
- 'fac_formats_' . $uid . '_linesdescriptionlength'
+ 'fac_formats_' . $uid . '_linesdescriptionlength',
],
5,
4,
@@ -437,7 +436,7 @@ __('Leave lengh empty for no limit.') .
form::checkbox(
[
'fac_formats[' . $uid . '][showlinescontent]',
- 'fac_formats_' . $uid . '_showlinescontent'
+ 'fac_formats_' . $uid . '_showlinescontent',
],
1,
0
@@ -448,7 +447,7 @@ __('Show content of entries') . '
form::checkbox(
[
'fac_formats[' . $uid . '][linescontentnohtml]',
- 'fac_formats_' . $uid . '_linescontentnohtml'
+ 'fac_formats_' . $uid . '_linescontentnohtml',
],
1,
1
@@ -460,7 +459,7 @@ __('Maximum length of content:') . '' .
form::field(
[
'fac_formats[' . $uid . '][linescontentlength]',
- 'fac_formats_' . $uid . '_linescontentlength'
+ 'fac_formats_' . $uid . '_linescontentlength',
],
5,
4,
@@ -504,4 +503,4 @@ __('To add feed to an entry edit this entry and put in sidebar the url of the fe
';
-dcPage::helpBlock('fac');
\ No newline at end of file
+dcPage::helpBlock('fac');
diff --git a/_define.php b/_define.php
index 9e89d06..7e0d6a3 100644
--- a/_define.php
+++ b/_define.php
@@ -1,16 +1,15 @@
registerModule(
'Feed after content',
'Add RSS/Atom feeds after entries content',
'Jean-Christian Denis and Contributors',
- '0.9.3',
+ '0.10',
[
- 'requires' => [['core', '2.19']],
- 'permissions' => 'usage,contentadmin',
- 'type' => 'plugin',
- 'support' => 'https://github.com/JcDenis/fac',
- 'details' => 'https://plugins.dotaddict.org/dc2/details/fac',
+ 'requires' => [['core', '2.24']],
+ 'permissions' => dcCore::app()->auth->makePermissions([
+ dcAuth::PERMISSION_USAGE,
+ dcAuth::PERMISSION_CONTENT_ADMIN,
+ ]),
+ 'type' => 'plugin',
+ 'support' => 'https://github.com/JcDenis/fac',
+ 'details' => 'https://plugins.dotaddict.org/dc2/details/fac',
'repository' => 'https://raw.githubusercontent.com/JcDenis/fac/master/repository.xml',
- 'settings' => [
- 'blog' => '#params.fac_params'
- ]
+ 'settings' => [
+ 'blog' => '#params.fac_params',
+ ],
]
-);
\ No newline at end of file
+);
diff --git a/_install.php b/_install.php
index fd76d33..b1258f5 100644
--- a/_install.php
+++ b/_install.php
@@ -1,117 +1,126 @@
[
- 'name' => 'default',
- 'dateformat' => '',
- 'lineslimit' => '5',
- 'linestitletext' => '%T',
- 'linestitleover' => '%D',
- 'linestitlelength' => '150',
- 'showlinesdescription' => '0',
- 'linesdescriptionlength' => '350',
- 'linesdescriptionnohtml' => '1',
- 'showlinescontent' => '0',
- 'linescontentlength' => '350',
- 'linescontentnohtml' => '1'
+ 'name' => 'default',
+ 'dateformat' => '',
+ 'lineslimit' => '5',
+ 'linestitletext' => '%T',
+ 'linestitleover' => '%D',
+ 'linestitlelength' => '150',
+ 'showlinesdescription' => '0',
+ 'linesdescriptionlength' => '350',
+ 'linesdescriptionnohtml' => '1',
+ 'showlinescontent' => '0',
+ 'linescontentlength' => '350',
+ 'linescontentnohtml' => '1',
],
uniqid() => [
- 'name' => 'full',
- 'dateformat' => '',
- 'lineslimit' => '20',
- 'linestitletext' => '%T',
- 'linestitleover' => '%D - %E',
- 'linestitlelength' => '',
- 'showlinesdescription' => '1',
- 'linesdescriptionlength' => '',
- 'linesdescriptionnohtml' => '1',
- 'showlinescontent' => '1',
- 'linescontentlength' => '',
- 'linescontentnohtml' => '1'
- ]
+ 'name' => 'full',
+ 'dateformat' => '',
+ 'lineslimit' => '20',
+ 'linestitletext' => '%T',
+ 'linestitleover' => '%D - %E',
+ 'linestitlelength' => '',
+ 'showlinesdescription' => '1',
+ 'linesdescriptionlength' => '',
+ 'linesdescriptionnohtml' => '1',
+ 'showlinescontent' => '1',
+ 'linescontentlength' => '',
+ 'linescontentnohtml' => '1',
+ ],
]),
'string',
false,
- true
+ true,
],
[
'fac_defaultfeedtitle',
'Default title of feed',
'%T',
- 'string'
+ 'string',
],
[
'fac_showfeeddesc',
'Show description of feed',
1,
- 'boolean'
- ]
+ 'boolean',
+ ],
];
# -- Nothing to change below --
try {
# Check module version
if (version_compare(
- $core->getVersion($mod_id),
- $core->plugins->moduleInfo($mod_id, 'version'),
- '>=')) {
+ dcCore::app()->getVersion($mod_id),
+ dcCore::app()->plugins->moduleInfo($mod_id, 'version'),
+ '>='
+ )) {
return null;
}
# Check Dotclear version
- if (!method_exists('dcUtils', 'versionsCompare')
+ if (!method_exists('dcUtils', 'versionsCompare')
|| dcUtils::versionsCompare(DC_VERSION, $dc_min, '<', false)) {
throw new Exception(sprintf(
- '%s requires Dotclear %s', $mod_id, $dc_min
+ '%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
+ dcCore::app()->blog->settings->addNamespace($mod_id);
+ foreach ($mod_conf as $v) {
+ dcCore::app()->blog->settings->{$mod_id}->put(
+ $v[0],
+ $v[2],
+ $v[3],
+ $v[1],
+ false,
+ true
);
}
# Set module version
- $core->setVersion(
+ dcCore::app()->setVersion(
$mod_id,
- $core->plugins->moduleInfo($mod_id, 'version')
+ dcCore::app()->plugins->moduleInfo($mod_id, 'version')
);
+
return true;
} catch (Exception $e) {
- $core->error->add($e->getMessage());
+ dcCore::app()->error->add($e->getMessage());
+
return false;
-}
\ No newline at end of file
+}
diff --git a/_public.php b/_public.php
index 4286feb..6d510c5 100644
--- a/_public.php
+++ b/_public.php
@@ -1,23 +1,22 @@
addBehavior(
+dcCore::app()->addBehavior(
'publicEntryAfterContent',
- array('facPublic', 'publicEntryAfterContent')
+ ['facPublic', 'publicEntryAfterContent']
);
/**
@@ -29,64 +28,64 @@ class facPublic
{
/**
* Add feed after entry
- *
+ *
* @param dcCore $core dcCore instance
* @param context $_ctx context instance
*/
public static function publicEntryAfterContent(dcCore $core, context $_ctx)
{
- $core->blog->settings->addNamespace('fac');
+ dcCore::app()->blog->settings->addNamespace('fac');
# Not active or not a post
- if (!$core->blog->settings->fac->fac_active
- || !$_ctx->exists('posts')) {
+ if (!dcCore::app()->blog->settings->fac->fac_active
+ || !dcCore::app()->ctx->exists('posts')) {
return null;
}
# Not in page to show
- $types = @unserialize($core->blog->settings->fac->fac_public_tpltypes);
+ $types = @unserialize((string) dcCore::app()->blog->settings->fac->fac_public_tpltypes);
if (!is_array($types)
- || !in_array($core->url->type,$types)) {
+ || !in_array(dcCore::app()->url->type, $types)) {
return null;
}
# Get related feed
- $fac_url = $core->meta->getMetadata([
+ $fac_url = dcCore::app()->meta->getMetadata([
'meta_type' => 'fac',
- 'post_id' => $_ctx->posts->post_id,
- 'limit' => 1
+ 'post_id' => dcCore::app()->ctx->posts->post_id,
+ 'limit' => 1,
]);
if ($fac_url->isEmpty()) {
return null;
}
# Get related format
- $fac_format = $core->meta->getMetadata([
+ $fac_format = dcCore::app()->meta->getMetadata([
'meta_type' => 'facformat',
- 'post_id' => $_ctx->posts->post_id,
- 'limit' => 1
+ 'post_id' => dcCore::app()->ctx->posts->post_id,
+ 'limit' => 1,
]);
if ($fac_format->isEmpty()) {
return null;
}
# Get format info
- $default_format = array(
- 'name' => 'default',
- 'dateformat' => '',
- 'lineslimit' => '5',
- 'linestitletext' => '%T',
- 'linestitleover' => '%D',
- 'linestitlelength' => '150',
- 'showlinesdescription' => '0',
+ $default_format = [
+ 'name' => 'default',
+ 'dateformat' => '',
+ 'lineslimit' => '5',
+ 'linestitletext' => '%T',
+ 'linestitleover' => '%D',
+ 'linestitlelength' => '150',
+ 'showlinesdescription' => '0',
'linesdescriptionlength' => '350',
'linesdescriptionnohtml' => '1',
- 'showlinescontent' => '0',
- 'linescontentlength' => '350',
- 'linescontentnohtml' => '1'
- );
+ 'showlinescontent' => '0',
+ 'linescontentlength' => '350',
+ 'linescontentnohtml' => '1',
+ ];
- $formats = @unserialize($core->blog->settings->fac->fac_formats);
+ $formats = @unserialize((string) dcCore::app()->blog->settings->fac->fac_formats);
if (empty($formats)
|| !is_array($formats)
|| !isset($formats[$fac_format->meta_id])) {
@@ -100,6 +99,7 @@ class facPublic
# Read feed url
$cache = is_dir(DC_TPL_CACHE . '/fac') ? DC_TPL_CACHE . '/fac' : null;
+
try {
$feed = feedReader::quickParse($fac_url->meta_id, $cache);
} catch (Exception $e) {
@@ -113,91 +113,90 @@ class facPublic
# Feed title
$feedtitle = '';
- if ('' != $core->blog->settings->fac->fac_defaultfeedtitle) {
- $feedtitle = '
' . html::escapeHTML(empty($feed->title) ?
+ if ('' != dcCore::app()->blog->settings->fac->fac_defaultfeedtitle) {
+ $feedtitle = '' . html::escapeHTML(
+ empty($feed->title) ?
str_replace(
'%T',
__('a related feed'),
- $core->blog->settings->fac->fac_defaultfeedtitle
- ) :
+ dcCore::app()->blog->settings->fac->fac_defaultfeedtitle
+ ) :
str_replace(
'%T',
$feed->title,
- $core->blog->settings->fac->fac_defaultfeedtitle
+ dcCore::app()->blog->settings->fac->fac_defaultfeedtitle
)
) . ' ';
}
# Feed desc
$feeddesc = '';
- if ($core->blog->settings->fac->fac_showfeeddesc
+ if (dcCore::app()->blog->settings->fac->fac_showfeeddesc
&& '' != $feed->description) {
- $feeddesc =
- ' ' . context::global_filters(
- $feed->description,
+ $feeddesc = '
' . context::global_filters(
+ $feed->description,
['encode_xml', 'remove_html']
) . '
';
}
# Date format
- $dateformat = '' != $format['dateformat'] ?
+ $dateformat = '' != $format['dateformat'] ?
$format['dateformat'] :
- $core->blog->settings->system->date_format . ',' . $core->blog->settings->system->time_format;
+ dcCore::app()->blog->settings->system->date_format . ',' . dcCore::app()->blog->settings->system->time_format;
# Enrties limit
- $entrieslimit = abs((integer) $format['lineslimit']);
- $uselimit = $entrieslimit > 0 ? true : false;
+ $entrieslimit = abs((int) $format['lineslimit']);
+ $uselimit = $entrieslimit > 0 ? true : false;
- echo
+ echo
'
' .
$feedtitle . $feeddesc .
'
';
$i = 0;
foreach ($feed->items as $item) {
-
# Format date
$date = dt::dt2str($dateformat, $item->pubdate);
# Entries title
$title = context::global_filters(
str_replace(
- array(
+ [
'%D',
'%T',
'%A',
'%E',
- '%C'
- ),
- array(
+ '%C',
+ ],
+ [
$date,
$item->title,
$item->creator,
$item->description,
- $item->content
- ),
+ $item->content,
+ ],
$format['linestitletext']
),
- ['remove_html', 'cut_string' => abs((integer) $format['linestitlelength'])],
+ ['remove_html', 'cut_string' => abs((int) $format['linestitlelength'])],
);
# Entries over title
$overtitle = context::global_filters(
str_replace(
- array(
+ [
'%D',
'%T',
'%A',
'%E',
- '%C'
- ),
- array(
+ '%C',
+ ],
+ [
$date,
$item->title,
$item->creator,
$item->description,
- $item->content
- ),
+ $item->content,
+ ],
$format['linestitleover']
),
['remove_html', 'cut_string' => 350],
@@ -205,23 +204,23 @@ class facPublic
# Entries description
$description = '';
- if ($format['showlinesdescription']
+ if ($format['showlinesdescription']
&& '' != $item->description) {
$description = '' .
context::global_filters(
$item->description,
- ['remove_html' => (integer) $format['linesdescriptionnohtml'], 'cut_string' => abs((integer) $format['linesdescriptionlength'])]
+ ['remove_html' => (int) $format['linesdescriptionnohtml'], 'cut_string' => abs((int) $format['linesdescriptionlength'])]
) . ' ';
}
# Entries content
$content = '';
- if ($format['showlinescontent']
+ if ($format['showlinescontent']
&& '' != $item->content) {
- $content = ''.
+ $content = '' .
context::global_filters(
$item->content,
- ['remove_html' => (integer) $format['linescontentnohtml'], 'cut_string' => abs((integer) $format['linescontentlength'])]
+ ['remove_html' => (int) $format['linescontentnohtml'], 'cut_string' => abs((int) $format['linescontentlength'])]
) . ' ';
}
@@ -237,4 +236,4 @@ class facPublic
}
echo ' ';
}
-}
\ No newline at end of file
+}
diff --git a/dcstore.xml b/dcstore.xml
index 393aed1..4e2719e 100644
--- a/dcstore.xml
+++ b/dcstore.xml
@@ -1,12 +1,13 @@
+
-
-Feed after content
-0.9.2
-Jean-Christian Denis and Contributors
-Add RSS/Atom feeds after entries content
-https://github.com/JcDenis/fac/releases/download/v0.9.2/plugin-fac.zip
-2.19
-https://plugins.dotaddict.org/dc2/details/fac
-https://github.com/JcDenis/fac
-
+
+ Feed after content
+ 0.10
+ Jean-Christian Denis and Contributors
+ Add RSS/Atom feeds after entries content
+ https://github.com/JcDenis/fac/releases/download/v0.10/plugin-fac.zip
+ 2.24
+ https://plugins.dotaddict.org/dc2/details/fac
+ https://github.com/JcDenis/fac
+
diff --git a/locales/en/resources.php b/locales/en/resources.php
index 549b317..a011b3d 100644
--- a/locales/en/resources.php
+++ b/locales/en/resources.php
@@ -1,10 +1,11 @@
resources['help']['fac'] = __DIR__ . '/help/fac.html';
diff --git a/locales/fr/resources.php b/locales/fr/resources.php
index 549b317..a011b3d 100644
--- a/locales/fr/resources.php
+++ b/locales/fr/resources.php
@@ -1,10 +1,11 @@
resources['help']['fac'] = __DIR__ . '/help/fac.html';