Skip to content

Commit

Permalink
FIX Comments list sorting #419
Browse files Browse the repository at this point in the history
  • Loading branch information
haruka-7 committed Apr 19, 2020
1 parent b13b87f commit 2d0c4c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions core/admin/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@
$h2 = '<h2>'.L_COMMENTS_ALL_LIST.'</h2>';
}
elseif($comSel=='online') {
$comSelMotif = '/^[0-9]{4}.(.*).xml$/';
$comSelMotif = '/^\d{4}.(.*).xml$/';
$_SESSION['selCom'] = 'online';
$nbComPagination=$plxAdmin->nbComments('online');
$h2 = '<h2>'.L_COMMENTS_ONLINE_LIST.'</h2>';
}
elseif($comSel=='offline') {
$comSelMotif = '/^_[0-9]{4}.(.*).xml$/';
$comSelMotif = '/^_\d{4}.(.*).xml$/';
$_SESSION['selCom'] = 'offline';
$nbComPagination=$plxAdmin->nbComments('offline');
$h2 = '<h2>'.L_COMMENTS_OFFLINE_LIST.'</h2>';
}
elseif($comSel=='all') { // all
$comSelMotif = '/^[[:punct:]]?[0-9]{4}.(.*).xml$/';
$comSelMotif = '/^[[:punct:]]?\d{4}.(.*).xml$/';
$_SESSION['selCom'] = 'all';
$nbComPagination=$plxAdmin->nbComments('all');
$h2 = '<h2>'.L_COMMENTS_ALL_LIST.'</h2>';
Expand Down
13 changes: 7 additions & 6 deletions core/lib/class.plx.motor.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,28 +829,29 @@ public function parentChildSort_r($idField, $parentField, $els, $parentID = 0, &
* @param start commencement
* @param limite nombre de commentaires à retourner
* @param publi before, after ou all => on récupère tous les fichiers (date) ?
* @return null
* @author Florent MONTHEL, Stephane F
* @return bool true if there is comments else false
* @author Florent MONTHEL, Stephane F, Pedro "P3ter" CADETE
**/
public function getCommentaires($motif,$ordre='sort',$start=0,$limite=false,$publi='before') {

# On récupère les fichiers des commentaires
$aFiles = $this->plxGlob_coms->query($motif,'com',$ordre,$start,$limite,$publi);
if($aFiles) { # On a des fichiers
foreach($aFiles as $k=>$v)
foreach($aFiles as $k=>$v) {
$array[$k] = $this->parseCommentaire(PLX_ROOT.$this->aConf['racine_commentaires'].$v);
}

# hiérarchisation et indentation des commentaires seulement sur les écrans requis
if( !(defined('plxAdmin::PLX_ADMIN') OR defined('plxFeed::PLX_FEED')) OR preg_match('#comment_new#',basename($_SERVER['SCRIPT_NAME']))) {
if (!preg_match('#comments#',basename($_SERVER['SCRIPT_NAME']))) {
$array = $this->parentChildSort_r('index', 'parent', $array);
}

# On stocke les enregistrements dans un objet plxRecord
$this->plxRecord_coms = new plxRecord($array);

return true;
}
else return false;

return !empty($aFiles);
}

/**
Expand Down
1 change: 1 addition & 0 deletions readme/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ FIX Headline and Tags toggles always closed in article edition #382 (sudwebdesig
FIX Fix medias administration zoombox and javascript optimisations #387 (bazooka07)
FIX Error when adding or modifying a user #393 (P3ter)
FIX Default theme : double underline on footer menu #393 (P3ter)
FIX Comments list sorting #419 (P3ter)

## PLUXML 5.8.2 (2020/02/09) ##
[+] #371 Check PluXml update using javascript if "curl" or "file_get_contents" can not be used (bazooka07)
Expand Down

0 comments on commit 2d0c4c8

Please sign in to comment.