Skip to content

Commit

Permalink
5.1.4
Browse files Browse the repository at this point in the history
Extended debug output : allowed memory size exhausted error
Blog : new parameter : apply or not to featured items.
  • Loading branch information
conseilgouz committed Jan 26, 2024
1 parent fae41bd commit 4714054
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
13 changes: 9 additions & 4 deletions autoreadmore.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @from https://github.com/gruz/AutoReadMore
* @author ConseilgGouz
* @copyright (C) 2023 www.conseilgouz.com. All Rights Reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
* @copyright (C) 2024 www.conseilgouz.com. All Rights Reserved.
* @license GNU/GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
*/

// No direct access
Expand Down Expand Up @@ -124,12 +124,12 @@ public function onContentPrepare($context, &$article, &$params, $page=null)
echo '<pre style="height:180px;overflow:auto;">';
echo '<b>Context : ' . $context . '</b><br />';
echo '<b>Content Item object : </b><br />';
print_r($article);
print_r(json_decode(json_encode($article)));

if (!empty($params))
{
echo '<b>Params:</b><br />';
print_r($params);
print_r(json_decode(json_encode($params)));
}
else
{
Expand Down Expand Up @@ -502,6 +502,11 @@ public function _checkIfAllowedCategoryAndItem ($context, $article)
);
$data[$context] = $row;
}
if ($this->params->get('joomla_articles') && ($context == 'com_content.category') ) {
if (($this->params->get('joomla_articles_featured',1) == 0) && ($article->featured == 1))
// ignore featured items in category view
return false;
}

$context_switch = $this->params->get('context_switch');

Expand Down
10 changes: 7 additions & 3 deletions autoreadmore.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.10" type="plugin" group="content" method="upgrade">
<name>PLG_CONTENT_AUTOREADMORE_TITLE</name>
<creationDate>2023-11-29</creationDate>
<copyright>Copyright (C) 2023 Conseilgouz All rights reserved.</copyright>
<creationDate>2024-01-26</creationDate>
<copyright>Copyright (C) 2024 Conseilgouz All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
<author>ConseilGouz</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://www.conseilgouz.com</authorUrl>
<version>5.1.3</version>
<version>5.1.4</version>
<description>PLG_CONTENT_AUTOREADMORE_THANK_YOU_FOR_USING_AUTO_READ_MORE</description>
<namespace path="src">ConseilGouz\Plugin\Content\Autoreadmore</namespace>
<files>
Expand Down Expand Up @@ -73,6 +73,10 @@
</field>
<field showon="joomla_articles:1[AND]categories_switch:1,2" name="categories" type="category" extension="com_content" multiple="multiple" size="20" show_uncategorized="1" default="" label="" description="" layout="joomla.form.field.list-fancy-select"/>
<!-- Select articles { -->
<field showon="joomla_articles:1" name="joomla_articles_featured" type="list" default="0" label="PLG_CONTENT_AUTOREADMORE_FIELD_ARTICLES_FEATURED" description="PLG_CONTENT_AUTOREADMORE_FIELD_ARTICLES_FEATURED_DESC">
<option value="0">JNo</option>
<option value="1">JYes</option>
</field>
<field showon="joomla_articles:1" name="articles_switch" type="list" default="0" label="PLG_CONTENT_AUTOREADMORE_FIELD_SPECIFIC_ARTICLES">
<option value="1">PLG_CONTENT_AUTOREADMORE_FIELD_SELECTION</option>
<option value="2">PLG_CONTENT_AUTOREADMORE_FIELD_EXCLUDE_SELECTION</option>
Expand Down
4 changes: 3 additions & 1 deletion language/en-GB/plg_content_autoreadmore.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GJ_INSTALL_ORDERING_SET_FAILED="Cound not set plugin ordering"
PLG_CONTENT_AUTOREADMORE_LEADING_MAX_LABEL="Leading Articles. Truncate to number of"
PLG_CONTENT_AUTOREADMORE_INTRO_MAX_LABEL="Intro Articles. Truncate to number"
PLG_CONTENT_AUTOREADMORE_MAX_DESC="Enter the length of the intro text in words, characters or paragraphs. If an article has more characters, words or paragraphs than this number, then a 'Read more' link will be shown."
PLG_CONTENT_AUTOREADMORE_ENABLED_FRONT_PAGE_LABEL="Featured Articles"
PLG_CONTENT_AUTOREADMORE_ENABLED_FRONT_PAGE_LABEL="Featured Articles (Front Page)"
PLG_CONTENT_AUTOREADMORE_ENABLED_FRONT_PAGE_DESC="Enable for Featured Articles component (Front Page component)"
PLG_CONTENT_AUTOREADMORE_STRIP_FORMATTING_LABEL="Strip Formatting"
PLG_CONTENT_AUTOREADMORE_STRIP_FORMATTING_DESC="If this is turned off, attempt to fix bad HTML caused by trimming the article."
Expand All @@ -15,6 +15,8 @@ PLG_CONTENT_AUTOREADMORE_THUMBNAILS_DESC="Extract this number of images from the
PLG_CONTENT_AUTOREADMORE_THUMBNAILS_CLASS_LABEL="Images class"
PLG_CONTENT_AUTOREADMORE_THUMBNAILS_CLASS_DESC="If this is specified, the plugin add this class(es) to the thumbnail images. You have to write the CSS class yourself; if you do not know how, you should not use this option. A special class can be set to make automatic thumbnails if working in conjunction with other plugins like multithumb.<br />If you are using bootstrap, then a nice value for this options should be <b>img-rounded pull-left margin-h-8</b>. Use the default class <b>margin-h-8</b> from the `Custom CSS code` area below"
PLG_CONTENT_AUTOREADMORE_FIELD_CATEGORIES="Select categories"
PLG_CONTENT_AUTOREADMORE_FIELD_ARTICLES_FEATURED="Featured articles (blog) ?"
PLG_CONTENT_AUTOREADMORE_FIELD_ARTICLES_FEATURED_DESC="Apply or not to featured articles in category blog display (default = yes)"
PLG_CONTENT_AUTOREADMORE_FIELD_SPECIFIC_ARTICLES="Select articles"
PLG_CONTENT_AUTOREADMORE_FIELD_SELECTION="Include"
PLG_CONTENT_AUTOREADMORE_FIELD_EXCLUDE_SELECTION="Exclude"
Expand Down
4 changes: 3 additions & 1 deletion language/fr-FR/plg_content_autoreadmore.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GJ_INSTALL_ORDERING_SET_FAILED="Impossible de régler le classement du plugin"
PLG_CONTENT_AUTOREADMORE_LEADING_MAX_LABEL="Principaux articles. Tronquer au nombre de"
PLG_CONTENT_AUTOREADMORE_INTRO_MAX_LABEL="Articles d'introduction. Tronquer au nombre de"
PLG_CONTENT_AUTOREADMORE_MAX_DESC="Entrez la longueur du texte d'intro en mots, caractères ou paragraphes. Si un article a plus de caractères, mots ou paragraphes que ce nombre, alors un lien « lire la suite » s’affichera."
PLG_CONTENT_AUTOREADMORE_ENABLED_FRONT_PAGE_LABEL="Articles en vedette"
PLG_CONTENT_AUTOREADMORE_ENABLED_FRONT_PAGE_LABEL="Articles en vedette (Front Page)"
PLG_CONTENT_AUTOREADMORE_ENABLED_FRONT_PAGE_DESC="Activer pour composant Articles en vedette (En Frontpage)"
PLG_CONTENT_AUTOREADMORE_STRIP_FORMATTING_LABEL="Effacer le formatage"
PLG_CONTENT_AUTOREADMORE_STRIP_FORMATTING_DESC="Si désactivé, il essayera de réparer le mauvais HTML causé en taillant l’article."
Expand All @@ -15,6 +15,8 @@ PLG_CONTENT_AUTOREADMORE_THUMBNAILS_DESC="Extrayez ce nombre d'images du texte d
PLG_CONTENT_AUTOREADMORE_THUMBNAILS_CLASS_LABEL="Classe des images"
PLG_CONTENT_AUTOREADMORE_THUMBNAILS_CLASS_DESC="Si c'est spécifié, le plugin ajoutera une ou des classe (s) aux vignettes. Vous devez écrire la classe CSS vous-même ; Si vous ne savez pas comment, vous ne devez pas utiliser cette option. Une classe spéciale peut être réglée pour faire des vignettes automatiques si vous travaillez en collaboration avec d’autres plugins comme multithumb. < br /> si vous utilisez bootstrap, alors une belle valeur pour cette option pourrait être <b>img-rounded pull-left margin-h-8</b>. Utilisez la classe par défaut <b>margin-h-8</b> de la zone « Code CSS personnalisé » ci-dessous"
PLG_CONTENT_AUTOREADMORE_FIELD_CATEGORIES="Sélectionnez des catégories"
PLG_CONTENT_AUTOREADMORE_FIELD_ARTICLES_FEATURED="Articles en vedette (blog) ?"
PLG_CONTENT_AUTOREADMORE_FIELD_ARTICLES_FEATURED_DESC="Appliquer ou non aux articles en vedette dans l'affichage blog d'une catégorie (défaut = oui)"
PLG_CONTENT_AUTOREADMORE_FIELD_SPECIFIC_ARTICLES="Sélectionnez des articles"
PLG_CONTENT_AUTOREADMORE_FIELD_SELECTION="Inclure"
PLG_CONTENT_AUTOREADMORE_FIELD_EXCLUDE_SELECTION="Exclure"
Expand Down
14 changes: 14 additions & 0 deletions plg_autoreadmore_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<changelogs>
<changelog>
<element>autoreadmore</element>
<type>plugin</type>
<version>5.1.5</version>
<note>
<item>26/01/2024</item>
</note>
<fix>
<item>Extended debug output : allowed memory size exhausted error</item>
</fix>
<addition>
<item>Blog : new parameter : apply or not to featured items.</item>
</addition>
</changelog>
<changelog>
<element>autoreadmore</element>
<type>plugin</type>
Expand Down
4 changes: 2 additions & 2 deletions scriptfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @from https://github.com/gruz/AutoReadMore
* @author ConseilgGouz
* @copyright (C) 2023 www.conseilgouz.com. All Rights Reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
* @copyright (C) 2024 www.conseilgouz.com. All Rights Reserved.
* @license GNU/GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
*/

// No direct access to this file
Expand Down

0 comments on commit 4714054

Please sign in to comment.