Skip to content

Commit

Permalink
Update changelog for #317 and #325
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrocadete committed Sep 12, 2019
1 parent cda7379 commit 78cbdd1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
31 changes: 18 additions & 13 deletions core/lib/class.plx.show.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,19 +896,20 @@ public function nbAllArt($f1='L_NO_ARTICLE',$f2='#nb L_ARTICLE',$f3='#nb L_ARTIC
* @scope global
* @author Florent MONTHEL, Stephane F, Cyril MAGUIRE, Thomas Ingles
**/
public function lastArtList($format='', $max=5, $cat_id='', $ending='', $sort='rsort') {
public function lastArtList($format='', $max=5, $cat_id='', $ending='', $sort='rsort') {

$capture = '';
$capture = '';

$format = empty($format)? '<li><a href="#art_url" title="#art_title">#art_title</a></li>': $format; # V5.8 format par defaut si vide

# Hook Plugins
// Hook Plugins
if(eval($this->plxMotor->plxPlugins->callHook('plxShowLastArtList'))) return;
# Génération de notre motif
$all = (isset($all)? $all: empty($cat_id));# pour le hook : si $all = TRUE, n'y passe pas
$cats = $this->plxMotor->activeCats . '|home';# toutes les categories active

// Génération de notre motif
$all = (isset($all)? $all: empty($cat_id)); # pour le hook : si $all = TRUE, n'y passe pas
$cats = $this->plxMotor->activeCats . '|home'; # toutes les categories active
if(!$all) {
if(is_numeric($cat_id)) # inclusion à partir de l'id de la categorie
if(is_numeric($cat_id)) # inclusion à partir de l'id de la categorie
$cats = str_pad($cat_id,3,'0',STR_PAD_LEFT);
else { # inclusion à partir de url de la categorie
$cat_id .= '|';
Expand All @@ -928,14 +929,14 @@ public function lastArtList($format='', $max=5, $cat_id='', $ending='', $sort='r
}
}
}
if(empty($motif)){# pour le hook. motif par defaut s'il n'a point créé cette variable
if(empty($motif)){ # pour le hook. motif par defaut s'il n'a point créé cette variable
if($all)
$motif = '/^[0-9]{4}.(?:[0-9]|home|,)*(?:'.$cats.')(?:[0-9]|home|,)*.[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/';
else
$motif = '/^[0-9]{4}.((?:[0-9]|home|,)*(?:'.$cats.')(?:[0-9]|home|,)*).[0-9]{3}.[0-9]{12}.[a-z0-9-]+.xml$/';
}

# Nouvel objet plxGlob et récupération des fichiers
// Nouvel objet plxGlob et récupération des fichiers
$plxGlob_arts = clone $this->plxMotor->plxGlob_arts;
if($aFiles = $plxGlob_arts->query($motif,'art',$sort,0,$max,'before')) {
foreach($aFiles as $v) { # On parcourt tous les fichiers
Expand All @@ -946,7 +947,8 @@ public function lastArtList($format='', $max=5, $cat_id='', $ending='', $sort='r
$status = 'active';
else
$status = 'noactive';
# Mise en forme de la liste des catégories

// Mise en forme de la liste des catégories
$catList = array();
$catIds = explode(',', $art['categorie']);
foreach ($catIds as $idx => $catId) {
Expand All @@ -958,7 +960,8 @@ public function lastArtList($format='', $max=5, $cat_id='', $ending='', $sort='r
$catList[] = L_UNCLASSIFIED;
}
}
# On modifie nos motifs

// On modifie nos motifs
$row = str_replace('#art_id',$num,$format);
$row = str_replace('#cat_list', implode(', ',$catList),$row);
$row = str_replace('#art_url',$this->plxMotor->urlRewrite('?article'.$num.'/'.$art['url']),$row);
Expand All @@ -983,9 +986,11 @@ public function lastArtList($format='', $max=5, $cat_id='', $ending='', $sort='r
$row = str_replace('#img_url',$this->plxMotor->urlRewrite($art['thumbnail']),$row);
$row = str_replace('#img_title',$art['thumbnail_title'],$row);
$row = str_replace('#img_alt',$art['thumbnail_alt'],$row);
# Hook plugin

// Hook plugin
eval($this->plxMotor->plxPlugins->callHook('plxShowLastArtListContent'));
# On genère notre ligne

// On genère notre ligne
echo $row;
}
}
Expand Down
1 change: 1 addition & 0 deletions readme/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[+] #312 En présence d'une homepage statique, le lien "archive total" redirige vers le blog (je-evrard, bazooka07, P3ter)
[+] #312 Remplacement de la fonction str_replace() par strtr() pour les liens vers les pages archives (bazooka07, P3ter)
[+] #313 Fermer l'overlay des médias avec la touche "ESC/ECHAP" du clavier (jerrywham)
[+] #317 #325 plxShow->lastArtList() rechercher des catégories par leur url plutôt que par leur ID (jerrywham, sudwebdesign)
FIX #287 Capcha : ajout d'un espace insécable avant le "?" (P3ter)
FIX #302 Renvoie vers index.php si un paramètre est inconnu dans l'URI (bazooka07)
FIX #318 L_NEW_CATEGORY en doublon pour certaines langues (P3ter)
Expand Down

0 comments on commit 78cbdd1

Please sign in to comment.