|
|
|
@ -140,8 +140,8 @@ class blog extends common {
|
|
|
|
|
$feeds->setDate(date('r',time()));
|
|
|
|
|
$feeds->addGenerator();
|
|
|
|
|
// Corps des articles
|
|
|
|
|
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
|
|
|
|
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC');
|
|
|
|
|
$articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
|
|
|
|
|
$articleIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC');
|
|
|
|
|
foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) {
|
|
|
|
|
if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) {
|
|
|
|
|
// Miniature
|
|
|
|
@ -230,7 +230,7 @@ class blog extends common {
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
// Liste des utilisateurs
|
|
|
|
|
self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
|
|
|
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname');
|
|
|
|
|
ksort(self::$users);
|
|
|
|
|
foreach(self::$users as $userId => &$userFirstname) {
|
|
|
|
|
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']);
|
|
|
|
@ -259,7 +259,7 @@ class blog extends common {
|
|
|
|
|
'value' => 'Tout effacer'
|
|
|
|
|
]);
|
|
|
|
|
// Ids des commentaires par ordre de création
|
|
|
|
|
$commentIds = array_keys(helper::arrayCollumn($comments, 'createdOn', 'SORT_DESC'));
|
|
|
|
|
$commentIds = array_keys(helper::arrayColumn($comments, 'createdOn', 'SORT_DESC'));
|
|
|
|
|
// Pagination
|
|
|
|
|
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) );
|
|
|
|
|
// Liste des pages
|
|
|
|
@ -416,7 +416,7 @@ class blog extends common {
|
|
|
|
|
]);
|
|
|
|
|
} else {
|
|
|
|
|
// Ids des articles par ordre de publication
|
|
|
|
|
$articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'));
|
|
|
|
|
$articleIds = array_keys(helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'));
|
|
|
|
|
// Gestion des droits d'accès
|
|
|
|
|
$filterData=[];
|
|
|
|
|
foreach ($articleIds as $key => $value) {
|
|
|
|
@ -448,7 +448,7 @@ class blog extends common {
|
|
|
|
|
// Articles en fonction de la pagination
|
|
|
|
|
for($i = $pagination['first']; $i < $pagination['last']; $i++) {
|
|
|
|
|
// Nombre de commentaires à approuver et approuvés
|
|
|
|
|
$approvals = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC');
|
|
|
|
|
$approvals = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC');
|
|
|
|
|
if ( is_array($approvals) ) {
|
|
|
|
|
$a = array_values($approvals);
|
|
|
|
|
$toApprove = count(array_keys($a,false));
|
|
|
|
@ -595,7 +595,7 @@ class blog extends common {
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
// Liste des utilisateurs
|
|
|
|
|
self::$users = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
|
|
|
|
self::$users = helper::arrayColumn($this->getData(['user']), 'firstname');
|
|
|
|
|
ksort(self::$users);
|
|
|
|
|
foreach(self::$users as $userId => &$userFirstname) {
|
|
|
|
|
// Les membres ne sont pas éditeurs, les exclure de la liste
|
|
|
|
@ -709,7 +709,7 @@ class blog extends common {
|
|
|
|
|
// Ligne suivante si affichage du nombre total de commentaires approuvés sous l'article
|
|
|
|
|
self::$nbCommentsApproved = count($commentsApproved);
|
|
|
|
|
}
|
|
|
|
|
$commentIds = array_keys(helper::arrayCollumn($commentsApproved, 'createdOn', 'SORT_DESC'));
|
|
|
|
|
$commentIds = array_keys(helper::arrayColumn($commentsApproved, 'createdOn', 'SORT_DESC'));
|
|
|
|
|
// Pagination
|
|
|
|
|
$pagination = helper::pagination($commentIds, $this->getUrl(), $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']),'#comment');
|
|
|
|
|
// Liste des pages
|
|
|
|
@ -749,8 +749,8 @@ class blog extends common {
|
|
|
|
|
// Liste des articles
|
|
|
|
|
else {
|
|
|
|
|
// Ids des articles par ordre de publication
|
|
|
|
|
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC');
|
|
|
|
|
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
|
|
|
|
$articleIdsPublishedOns = helper::arrayColumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC');
|
|
|
|
|
$articleIdsStates = helper::arrayColumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
|
|
|
|
|
$articleIds = [];
|
|
|
|
|
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
|
|
|
|
|
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
|
|
|
|
|