bug module de recherche

This commit is contained in:
Fred Tempez 2021-08-14 21:54:28 +02:00
parent 82f06b1c19
commit 6dce12e621
4 changed files with 13 additions and 12 deletions

View File

@ -1,7 +1,7 @@
# Changelog
## Version 11.0.05
## Version 11.0.06
- Modifications :
- Intégration de la classe layout dans la classe core
- Gestion multi-langues

View File

@ -1,6 +1,6 @@
# ZwiiCMS 11.0.05
# ZwiiCMS 11.0.06
Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.

View File

@ -45,7 +45,7 @@ class common {
// Numéro de version
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/';
const ZWII_VERSION = '11.0.05';
const ZWII_VERSION = '11.0.06';
const ZWII_UPDATE_CHANNEL = "v11";
public static $actions = [];

View File

@ -266,7 +266,8 @@ class search extends common {
$this->getData(['page', $parentId, 'block']) !== 'bar') {
$url = $parentId;
$titre = $this->getData(['page', $parentId, 'title']);
$contenu = ' ' . $titre . ' ' . $this->getData(['page', $parentId, 'content']);
$content = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $parentId, 'content']));
$contenu = $titre . ' ' . $contenu ;
// Pages sauf pages filles et articles de blog
$tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier);
if (is_array($tempData) ) {
@ -281,7 +282,8 @@ class search extends common {
$this->getData(['page', $parentId, 'block']) !== 'bar') {
$url = $childId;
$titre = $this->getData(['page', $childId, 'title']);
$contenu = ' ' . $titre . ' ' . $this->getData(['page', $childId, 'content']);
$content = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $childId, 'content']));
$contenu = $titre . ' ' . $contenu ;
//Pages filles
$tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier);
if (is_array($tempData) ) {
@ -289,9 +291,9 @@ class search extends common {
}
}
// Articles d'une sous-page blog
if ($this->getData(['page', $childId, 'moduleId']) === 'blog' &&
$this->getData(['module',$parentId,'posts']) )
// Articles d'une sous-page blog ou de news
if ($this->getData(['page', $childId, 'moduleId']) === 'blog' || $this->getData(['page', $childId, 'moduleId']) === 'news'
&& $this->getData(['module',$parentId,'posts']) )
{
foreach($this->getData(['module',$childId,'posts']) as $articleId => $article) {
if($this->getData(['module',$childId,'posts',$articleId,'state']) === true) {
@ -308,16 +310,15 @@ class search extends common {
}
}
// Articles d'un blog
if ($this->getData(['page', $parentId, 'moduleId']) === 'blog' &&
$this->getData(['module',$parentId,'posts']) ) {
// Articles d'un blog ou de news
if ( $this->getData(['page', $parentId, 'moduleId']) === 'blog' || $this->getData(['page', $parentId, 'moduleId']) === 'news'
&& $this->getData(['module',$parentId,'posts']) ) {
foreach($this->getData(['module',$parentId,'posts']) as $articleId => $article) {
if($this->getData(['module',$parentId,'posts',$articleId,'state']) === true)
{
$url = $parentId. '/' . $articleId;
$titre = $article['title'];
$contenu = ' ' . $titre . ' ' . $article['content'];
// Articles de Blog
$tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier);
if (is_array($tempData) ) {
$result [] = $tempData;