release 2022.11.20
This commit is contained in:
parent
32672d605f
commit
11b700544a
@ -1,3 +1,6 @@
|
||||
2022.11.20
|
||||
- fix compatibility with Dotclear 2.24 (required)
|
||||
|
||||
2021.09.17
|
||||
- clean up and cosmetics
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
[![Release](https://img.shields.io/github/v/release/JcDenis/lastpostsExtend)](https://github.com/JcDenis/lastpostsExtend/releases)
|
||||
[![Date](https://img.shields.io/github/release-date/JcDenis/lastpostsExtend)](https://github.com/JcDenis/lastpostsExtend/releases)
|
||||
[![Issues](https://img.shields.io/github/issues/JcDenis/lastpostsExtend)](https://github.com/JcDenis/lastpostsExtend/issues)
|
||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.19-blue.svg)](https://fr.dotclear.org/download)
|
||||
[![Dotclear](https://img.shields.io/badge/dotclear-v2.24-blue.svg)](https://fr.dotclear.org/download)
|
||||
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://plugins.dotaddict.org/dc2/details/lastpostsExtend)
|
||||
[![License](https://img.shields.io/github/license/JcDenis/lastpostsExtend)](https://github.com/JcDenis/lastpostsExtend/blob/master/LICENSE)
|
||||
|
||||
@ -19,7 +19,7 @@ Like widget lastposts but with more options.
|
||||
lastpostsExtend requires:
|
||||
|
||||
* permissions to manage widgets
|
||||
* Dotclear 2.19
|
||||
* Dotclear 2.24
|
||||
|
||||
## USAGE
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||
return null;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
* @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,13 +18,13 @@ $this->registerModule(
|
||||
'Last entries (Extended)',
|
||||
'Extended list of entries',
|
||||
'Jean-Christian Denis and contributors',
|
||||
'2022.11.12',
|
||||
'2022.11.20',
|
||||
[
|
||||
'requires' => [['core', '2.24']],
|
||||
'permissions' => dcAuth::PERMISSION_ADMIN,
|
||||
'type' => 'plugin',
|
||||
'support' => 'https://github.com/JcDenis/lastpostsExtend',
|
||||
'details' => 'http://plugins.dotaddict.org/dc2/details/lastpostsExtend',
|
||||
'repository' => 'https://raw.githubusercontent.com/JcDenis/lastpostsExtend/master/repository.xml'
|
||||
'repository' => 'https://raw.githubusercontent.com/JcDenis/lastpostsExtend/master/repository.xml',
|
||||
]
|
||||
);
|
@ -10,7 +10,6 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return null;
|
||||
}
|
||||
|
48
_widgets.php
48
_widgets.php
@ -10,7 +10,6 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return null;
|
||||
}
|
||||
@ -43,13 +42,12 @@ class lastpostsextendWidget
|
||||
$posttypes = [
|
||||
__('Post') => 'post',
|
||||
__('Page') => 'page',
|
||||
__('Gallery') => 'galitem'
|
||||
__('Gallery') => 'galitem',
|
||||
];
|
||||
# plugin muppet types
|
||||
if (dcCore::app()->plugins->moduleExists('muppet')) {
|
||||
$muppet_types = muppet::getPostTypes();
|
||||
if (is_array($muppet_types) && !empty($muppet_types)) {
|
||||
|
||||
foreach ($muppet_types as $k => $v) {
|
||||
$posttypes[$v['name']] = $k;
|
||||
}
|
||||
@ -64,18 +62,17 @@ class lastpostsextendWidget
|
||||
);
|
||||
# Category (post and page have same category)
|
||||
$rs = dcCore::app()->blog->getCategories([
|
||||
'post_type' => 'post'
|
||||
'post_type' => 'post',
|
||||
]);
|
||||
$categories = [
|
||||
'' => '',
|
||||
__('Uncategorized') => 'null'
|
||||
__('Uncategorized') => 'null',
|
||||
];
|
||||
while ($rs->fetch()) {
|
||||
$categories[str_repeat(
|
||||
' ',
|
||||
$rs->level - 1
|
||||
) . '• ' . html::escapeHTML($rs->cat_title)] =
|
||||
$rs->cat_id;
|
||||
) . '• ' . html::escapeHTML($rs->cat_title)] = $rs->cat_id;
|
||||
}
|
||||
$w->lastpostsextend->setting(
|
||||
'category',
|
||||
@ -94,7 +91,7 @@ class lastpostsextendWidget
|
||||
[
|
||||
__('all') => 'all',
|
||||
__('only without password') => 'no',
|
||||
__('only with password') => 'yes'
|
||||
__('only with password') => 'yes',
|
||||
]
|
||||
);
|
||||
# Status
|
||||
@ -108,7 +105,7 @@ class lastpostsextendWidget
|
||||
__('pending') => '-2',
|
||||
__('scheduled') => '-1',
|
||||
__('unpublished') => '0',
|
||||
__('published') => '1'
|
||||
__('published') => '1',
|
||||
]
|
||||
);
|
||||
# Selected entries only
|
||||
@ -157,7 +154,7 @@ class lastpostsextendWidget
|
||||
[
|
||||
__('Date') => 'date',
|
||||
__('Title') => 'post_title',
|
||||
__('Comments') => 'nb_comment'
|
||||
__('Comments') => 'nb_comment',
|
||||
]
|
||||
);
|
||||
# Sort order
|
||||
@ -168,7 +165,7 @@ class lastpostsextendWidget
|
||||
'combo',
|
||||
[
|
||||
__('Ascending') => 'asc',
|
||||
__('Descending') => 'desc'
|
||||
__('Descending') => 'desc',
|
||||
]
|
||||
);
|
||||
# First image
|
||||
@ -183,7 +180,7 @@ class lastpostsextendWidget
|
||||
__('thumbnail') => 't',
|
||||
__('small') => 's',
|
||||
__('medium') => 'm',
|
||||
__('original') => 'o'
|
||||
__('original') => 'o',
|
||||
]
|
||||
);
|
||||
# With excerpt
|
||||
@ -216,7 +213,7 @@ class lastpostsextendWidget
|
||||
[
|
||||
__('All pages') => 0,
|
||||
__('Home page only') => 1,
|
||||
__('Except on home page') => 2
|
||||
__('Except on home page') => 2,
|
||||
]
|
||||
);
|
||||
# widget option - content only
|
||||
@ -246,7 +243,7 @@ class lastpostsextendWidget
|
||||
$params = [
|
||||
'sql' => '',
|
||||
'columns' => [],
|
||||
'from' => ''
|
||||
'from' => '',
|
||||
];
|
||||
|
||||
# Widget is offline
|
||||
@ -268,8 +265,7 @@ class lastpostsextendWidget
|
||||
# Passworded
|
||||
if ($w->passworded == 'yes') {
|
||||
$params['sql'] .= 'AND post_password IS NOT NULL ';
|
||||
}
|
||||
elseif ($w->passworded == 'no') {
|
||||
} elseif ($w->passworded == 'no') {
|
||||
$params['sql'] .= 'AND post_password IS NULL ';
|
||||
}
|
||||
|
||||
@ -285,9 +281,8 @@ class lastpostsextendWidget
|
||||
|
||||
# Updated posts only
|
||||
if ($w->updatedonly) {
|
||||
$params['sql'] .=
|
||||
"AND post_creadt < post_upddt " .
|
||||
"AND post_dt < post_upddt ";
|
||||
$params['sql'] .= 'AND post_creadt < post_upddt ' .
|
||||
'AND post_dt < post_upddt ';
|
||||
/*
|
||||
$params['sql'] .=
|
||||
"AND TIMESTAMP(post_creadt ,'DD-MM-YYYY HH24:MI:SS') < TIMESTAMP(post_upddt ,'DD-MM-YYYY HH24:MI:SS') ".
|
||||
@ -295,13 +290,12 @@ class lastpostsextendWidget
|
||||
//*/
|
||||
$params['order'] = $w->sortby == 'date' ?
|
||||
'post_upddt ' : $w->sortby . ' ';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$params['order'] = $w->sortby == 'date' ?
|
||||
'post_dt ' : $w->sortby . ' ';
|
||||
}
|
||||
$params['order'] .= $w->sort == 'asc' ? 'asc' : 'desc';
|
||||
$params['limit'] = abs((integer) $w->limit);
|
||||
$params['limit'] = abs((int) $w->limit);
|
||||
$params['no_content'] = true;
|
||||
|
||||
# Selected posts only
|
||||
@ -317,7 +311,7 @@ class lastpostsextendWidget
|
||||
if ($w->category == 'null') {
|
||||
$params['sql'] .= ' AND P.cat_id IS NULL ';
|
||||
} elseif (is_numeric($w->category)) {
|
||||
$params['cat_id'] = (integer) $w->category;
|
||||
$params['cat_id'] = (int) $w->category;
|
||||
} else {
|
||||
$params['cat_url'] = $w->category;
|
||||
}
|
||||
@ -331,7 +325,7 @@ class lastpostsextendWidget
|
||||
}
|
||||
$params['from'] .= ', ' . dcCore::app()->prefix . 'meta META ';
|
||||
$params['sql'] .= 'AND META.post_id = P.post_id ';
|
||||
$params['sql'] .= "AND META.meta_id " . dcCore::app()->con->in($tags) . " ";
|
||||
$params['sql'] .= 'AND META.meta_id ' . dcCore::app()->con->in($tags) . ' ';
|
||||
$params['sql'] .= "AND META.meta_type = 'tag' ";
|
||||
}
|
||||
|
||||
@ -389,7 +383,7 @@ class lastpostsextendWidget
|
||||
if (strlen($excerpt) > 0) {
|
||||
$cut = text::cutString(
|
||||
$excerpt,
|
||||
abs((integer) $w->excerptlen)
|
||||
abs((int) $w->excerptlen)
|
||||
);
|
||||
$res .= ' : ' . $cut . (strlen($cut) < strlen($excerpt) ? '...' : '');
|
||||
|
||||
@ -410,7 +404,6 @@ class lastpostsextendWidget
|
||||
private static function entryFirstImage($type, $id, $size = 's')
|
||||
{
|
||||
if (!in_array($type, ['post', 'page', 'galitem'])) {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -444,14 +437,13 @@ class lastpostsextendWidget
|
||||
|
||||
$subject = $rs->post_excerpt_xhtml . $rs->post_content_xhtml . $rs->cat_desc;
|
||||
if (preg_match_all($pattern, $subject, $m) > 0) {
|
||||
|
||||
foreach ($m[1] as $i => $img) {
|
||||
if (($src = self::ContentFirstImageLookup($p_root, $img, $size)) !== false) {
|
||||
|
||||
$src = $p_url . (dirname($img) != '/' ? dirname($img) : '') . '/' . $src;
|
||||
if (preg_match('/alt="([^"]+)"/', $m[0][$i], $malt)) {
|
||||
$alt = $malt[1];
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<modules xmlns:da="http://dotaddict.org/da/">
|
||||
<module id="lastpostsExtend">
|
||||
<name>Last entries (Extended)</name>
|
||||
<version>2021.09.17</version>
|
||||
<version>2022.11.20</version>
|
||||
<author>Jean-Christian Denis and contributors</author>
|
||||
<desc>Extended list of entries</desc>
|
||||
<file>https://github.com/JcDenis/lastpostsExtend/releases/download/v2021.09.17/plugin-lastpostsExtend.zip</file>
|
||||
<da:dcmin>2.19</da:dcmin>
|
||||
<file>https://github.com/JcDenis/lastpostsExtend/releases/download/v2022.11.20/plugin-lastpostsExtend.zip</file>
|
||||
<da:dcmin>2.24</da:dcmin>
|
||||
<da:details>http://plugins.dotaddict.org/dc2/details/lastpostsExtend</da:details>
|
||||
<da:support>https://github.com/JcDenis/lastpostsExtend</da:support>
|
||||
</module>
|
||||
|
@ -1,50 +0,0 @@
|
||||
<?php
|
||||
// Language: Français
|
||||
// Module: lastpostsExtend - 2021.08.25
|
||||
// Date: 2021-08-25 22:43:47
|
||||
// Translated with dcTranslater - 2021.08.18
|
||||
|
||||
#_widgets.php:33
|
||||
$GLOBALS['__l10n']['Last entries (Extended)'] = 'Derniers billets (étendu)';
|
||||
|
||||
#_widgets.php:36
|
||||
$GLOBALS['__l10n']['Extended list of entries'] = 'Liste étendue de billets';
|
||||
|
||||
#_widgets.php:47
|
||||
$GLOBALS['__l10n']['Post'] = 'Billet';
|
||||
|
||||
#_widgets.php:49
|
||||
$GLOBALS['__l10n']['Gallery'] = 'Galerie';
|
||||
|
||||
#_widgets.php:94
|
||||
$GLOBALS['__l10n']['Protection:'] = 'Protection :';
|
||||
|
||||
#_widgets.php:99
|
||||
$GLOBALS['__l10n']['only without password'] = 'seulement sans mot de passe';
|
||||
|
||||
#_widgets.php:100
|
||||
$GLOBALS['__l10n']['only with password'] = 'seulement avec mot de passe';
|
||||
|
||||
#_widgets.php:120
|
||||
$GLOBALS['__l10n']['Selected entries only'] = 'Billets sélectionnés seulement';
|
||||
|
||||
#_widgets.php:127
|
||||
$GLOBALS['__l10n']['Updated entries only'] = 'Billets mis à jour seulement';
|
||||
|
||||
#_widgets.php:135
|
||||
$GLOBALS['__l10n']['Limit to tags:'] = 'Limiter aux mots-clés :';
|
||||
|
||||
#_widgets.php:143
|
||||
$GLOBALS['__l10n']['Limit to words:'] = 'Limiter aux mots :';
|
||||
|
||||
#_widgets.php:180
|
||||
$GLOBALS['__l10n']['Show entries first image:'] = 'Afficher la première image du billet :';
|
||||
|
||||
#_widgets.php:195
|
||||
$GLOBALS['__l10n']['Show entries excerpt'] = 'Afficher l\'extrait';
|
||||
|
||||
#_widgets.php:202
|
||||
$GLOBALS['__l10n']['Excerpt length:'] = 'Taille de l\'extrait :';
|
||||
|
||||
#_widgets.php:209
|
||||
$GLOBALS['__l10n']['Show comments count'] = 'Afficher le nombre de commentaires';
|
Loading…
Reference in New Issue
Block a user