Changeset 1469


Ignore:
Timestamp:
Sep 28, 2010, 5:51:21 PM (10 years ago)
Author:
teymour
Message:

Correction du masque des tags dans résultat de recherche
+ pas de page pas de résultat pour les formats non html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/solr/actions/actions.class.php

    r1468 r1469  
    154154        $high_res = array();
    155155        foreach($results['highlighting'][$res['id']]['text'] as $h) {
    156           if (!preg_match('/=/', $h))
    157             array_push($high_res, $h);
     156          $h = preg_replace('/.*=/', '', $h);
     157          array_push($high_res, $h);
    158158        }
    159159        $this->results['docs'][$i]['highlighting'] = preg_replace('/^'."$this->results['docs'][$i]['personne']".'/', '', implode('...', $high_res));
     
    191191    }
    192192    if (!$results['response']['numFound']) {
    193       $this->setTemplate('noresults');
    194     }else{
    195       $this->fdates = array();
    196       $this->fdates['max'] = 1;
    197       foreach($results['facet_counts']['facet_dates']['date'] as $date => $nb) {
    198         if (preg_match('/^20/', $date)) {
    199           $pc = $nb/$results['response']['numFound'];
    200           $this->fdates['values'][$date] = array('nb' => $nb, 'pc' => $pc);
    201           if ($this->fdates['max'] < $pc) {
    202             $this->fdates['max'] = $pc;
    203           }
     193      if ($format)
     194        return ;
     195      return $this->setTemplate('noresults');
     196    }
     197    $this->fdates = array();
     198    $this->fdates['max'] = 1;
     199    foreach($results['facet_counts']['facet_dates']['date'] as $date => $nb) {
     200      if (preg_match('/^20/', $date)) {
     201        $pc = $nb/$results['response']['numFound'];
     202        $this->fdates['values'][$date] = array('nb' => $nb, 'pc' => $pc);
     203        if ($this->fdates['max'] < $pc) {
     204          $this->fdates['max'] = $pc;
    204205        }
    205206      }
Note: See TracChangeset for help on using the changeset viewer.