Browse Source

Changement des cibles de recherche : ajout de la recherche dans le lien + ajout de recherche dans plusieurs champs précis

master
Erase 3 years ago
parent
commit
cf99d2ad4f
4 changed files with 43 additions and 9 deletions
  1. +5
    -2
      index.php
  2. +12
    -5
      system/classes/FeedReader.php
  3. +26
    -1
      system/config/default.php
  4. +0
    -1
      system/config/localconfig.php

+ 5
- 2
index.php View File

@ -14,7 +14,10 @@
ini_set('display_errors', (Config::get('displayErrors') ? 1 : 0));
error_reporting((Config::get('displayErrors') || Config::get('logErrors')) ? 1 : 0);
/*
/*
** For example
*/
$_links = array(
"http://www.lemonde.fr/rss/une.xml",
"https://rss.framasoft.org/"
@ -25,6 +28,6 @@
echo "<pre>";
var_dump($feeds->objParseFeed->items)
*/
?>

+ 12
- 5
system/classes/FeedReader.php View File

@ -105,12 +105,19 @@ class FeedReader
// Where
$where = \Config::get('where');
if(!is_null($where) && $where == 'title'){
$merge_str = strtolower($items[$i]['title']);
}elseif(!is_null($where) && $where == 'description'){
$merge_str = strtolower($items[$i]['description']);
$_cible = explode('|', \Config::get('where'));
if(count($_cible) > 1){
$merge_str = "";
foreach ($_cible as $cible) {
$merge_str .= " ".strtolower($items[$i][$cible]);
}
}else{
$merge_str = strtolower($items[$i]['title']." ".$items[$i]['description']);
if($_cible[0] && $_cible[0] != 'all'){
$merge_str = strtolower($items[$i][$_cible[0]]);
}else{
$merge_str = strtolower($items[$i]['title']." ".$items[$i]['description']." ".$items[$i]['link']);
}
}
// Bad and star words


+ 26
- 1
system/config/default.php View File

@ -61,4 +61,29 @@ $GLOBALS['TL_CONFIG']['RssReaderReferer'] = "RSS-Fusion with SimplePie";
*/
$GLOBALS['TL_CONFIG']['_starWords'] = array();
$GLOBALS['TL_CONFIG']['_badWords'] = array();
$GLOBALS['TL_CONFIG']['where'] = 'all'; //~ (title | description | all)
$GLOBALS['TL_CONFIG']['where'] = 'all'; //~ (title, description, link, all)
//*
// Search in title only
// $GLOBALS['TL_CONFIG']['where'] = 'title';
//*
//*
// Search in description only
// $GLOBALS['TL_CONFIG']['where'] = ' description';
//*
//*
// Search in url only
// $GLOBALS['TL_CONFIG']['where'] = 'link';
//*
//*
// Search in multiple content, separate with "|"
// $GLOBALS['TL_CONFIG']['where'] = 'title|description';
//*
//*
// Search in all content
// $GLOBALS['TL_CONFIG']['where'] = 'all';
//*

+ 0
- 1
system/config/localconfig.php View File

@ -1,2 +1 @@
<?php

Loading…
Cancel
Save