<?php
-
-$exa_max_length = 20;
+$exa_max_length = 16;
function display_group(&$group, &$exalead_data, $keywords=false,$class = 'exa_groupe', $img_path = 'images/'){
- $compteur = 0;
- $titre = ($keywords)?'Mot-clés':$group->title;
- $gid = ($keywords)?'k':$group->gid;
- if($keywords)
- $array = & $group;
- else
- $array = & $group->categories;
-?>
-<div class="exa_groupe">
- <div class="titre"><?php echo $titre?> :</div>
- <ul id="exa_group_<?php echo $gid?>">
-<?php
- foreach($array as $categorie){
- $compteur++;
-?>
- <li class="exa_categorie" id="exa_group_<?php echo $gid.'_'.$compteur;?>">
-<?php
- if($categorie->is_normal()){
-?>
- <a style="text-decoration: none;"
- href="?_C=<?php echo $exalead_data->query->context.'/'.$categorie->refine_href;?>&_f=xml2"
- title="Afficher seulement ces résultats"
- ><img style="vertical-align: text-bottom;" src="images/select.png" alt="[+]" />
- <?php echo (empty($categorie->display)?$categorie->name:$categorie->display).(empty($categorie->count)?'':' ('.$categorie->count.')');?></a>
- <a href="?_C=<?php echo $exalead_data->query->context.'/'.$categorie->exclude_href;?>&_f=xml2"
- title="Ne pas afficher ces résultats"
- ><img style="vertical-align: text-bottom;" src="images/moins.png" alt="[-]"/></a>
-<?php
- }
- elseif($categorie->is_excluded()){
-?>
- <span style="text-decoration: line-through;">
- <a href="?_C=<?php echo $exalead_data->query->context.'/'.$categorie->reset_href;?>&_f=xml2"><img style="vertical-align: text-bottom;" src="images/select.png" alt="[+]" />
- <?php echo $categorie->display;?></a>
- </span>
-<?php
- }
- else{
-?>
- <strong><?php echo $categorie->display;?></strong>
- <a href="?_C=<?php echo $exalead_data->query->context.'/'.$categorie->reset_href;?>&_f=xml2"><img style="vertical-align: text-bottom;" src="images/moins.png" alt="[-]"/></a>
-<?php
- }
- echo '</li>';
- }
-?>
- </ul>
-</div>
-<?php
+ $compteur = 0;
+ $titre = ($keywords)?'Mot-clés':$group->title;
+ $gid = ($keywords)?'k':$group->gid;
+ if($keywords){
+ $array = & $group;
+ }
+ else{
+ $array = & $group->categories;
+ }
+ $res=" <div class=\"exa_groupe\"
+ <div class=\"titre\">".$titre.":</div>
+ <ul id=\"exa_group_".$gid."\">";
+ foreach($array as $categorie){
+ $compteur++;
+ $res+="<li class=\"exa_categorie\" id=\"exa_group_".$gid."_".$compteur.";\">";
+ if($categorie->is_normal()){
+ $res+="<a style=\"text-decoration: none;\"
+ href=\"?_C=".$exalead_data->query->context."&".$categorie->refine_href.";?>&_f=xml2\"
+ title=\"Afficher seulement ces résultats\">
+ <img style=\"vertical-align: text-bottom;\" src=\"images/select.png\" alt=\"[+]\" />";
+ if (empty($categorie->display)){
+ $res+=$categorie->name;
+ }
+ else{
+ $res+=$categorie->display;
+ }
+ if(!empty($categorie->count)){
+ $res+=$categorie->count;
+ }
+ $res+="</a>
+ <a href=\"?_C=".$exalead_data->query->context."&".$categorie->exclude_href.";&_f=xml2\"
+ title=\"Ne pas afficher ces résultats\">
+ <img style=\"vertical-align: text-bottom;\" src=\"images/moins.png\" alt=\"[-]\"/></a>";
+ }
+ elseif($categorie->is_excluded()){
+ $res+="<span style=\"text-decoration: line-through;\">
+ <a href=\"?_C=".$exalead_data->query->context."&".$categorie->reset_href.";&_f=xml2\">
+ <img style=\"vertical-align: text-bottom;\" src=\"images/select.png\" alt=\"[+]\" />
+ ".$categorie->display.";</a>
+ </span>";
+ }
+ else{
+ $res+="<strong>".$categorie->display.";</strong>
+ <a href=\"?_C=".$exalead_data->query->context."&".$categorie->reset_href.";&_f=xml2\">
+ <img style=\"vertical-align: text-bottom;\" src=\"images/moins.png\" alt=\"[-]\"/></a>";
+ }
+ $res+="</li>";
+ }
+ $res+=" </ul>
+ </div>";
+ return $res;
}
+
+
+
function _display_groupes($params, &$smarty){
if(!empty($params['exalead_data'])){
else{
$nb_hits = (int) $exalead_data->nhits;
}
+ $date=false;
+ foreach($exalead_data->query->query_parameters as $parameter){
+ if($parameter->name=="_sf"){
+ if($parameter->value=="-date")
+ $date=true;
+ }
+ }
+
+
$res = '';
$nb_numero = 5;//We want 5 links
$current_page = (empty($_GET['_s'])?1:1+(int) ($_GET['_s'] / $nb_res_per_page));
}
}
- if ($current_page*$nb_res_per_page >$nb_res_per_page)
- $res.="<a href=\"?_C={$exalead_data->query->context}&_s=".(($current_page-2)*$nb_res_per_page)."\">Precedent</a> ";
- for($i = $first_number; $i <= $nb_numero + $first_number-1; $i++){
- $k=$nb_res_per_page*($i-1)+1;
- $j=$nb_res_per_page*$i;
- if($i == $current_page){
- $res .= "<strong>$k-$j</strong> ";
- }
- else{
- $res .= "<a href=\"?_C={$exalead_data->query->context}&_s=".(($i-1)*$nb_res_per_page)."\">$k-$j</a> ";
- }
+ if ($current_page*$nb_res_per_page >$nb_res_per_page){
+ $res.="<a href=\"?_C={$exalead_data->query->context}&_s=".(($current_page-2)*$nb_res_per_page);
+ if($date) $res.="&_sf=-date";
+ $res.="\">Précédent</a> ";
}
- if ($current_page*10<$nb_hits)
- $res.="<a href=\"?_C={$exalead_data->query->context}&_s=".(($current_page)*$nb_res_per_page)."\">Suivant</a>";
- $date=false;
- foreach($exalead_data->query->query_parameters as $parameter){
- if($parameter->name=="_sf"){
- if($parameter->value=="-date")
- $date=true;
- }
+ for($i = $first_number; $i <= $nb_numero + $first_number; $i++){
+ $k=$nb_res_per_page*($i-1)+1;
+ $j=$nb_res_per_page*$i;
+ if($i == $current_page){
+ $res .= "<strong>$k-$j</strong> ";
+ }
+ elseif($k<=$nb_hits){
+ $res .= "<a href=\"?_C={$exalead_data->query->context}&_s=".(($i-1)*$nb_res_per_page);
+ if($date) $res.="&_sf=-date";
+ $res.="\">$k-$j</a> ";
+ }
+ }
+ if ($current_page*10<$nb_hits){
+ $res.="<a href=\"?_C={$exalead_data->query->context}&_s=".(($current_page)*$nb_res_per_page);
+ if($date) $res.="&_sf=-date";
+ $res.="\">Suivant</a>";
}
-
if($date)
- $res.=" - <a href=\"?_C={$exalead_data->query->context}/_sf=relevance&_f=xml2\">[Classer par pertinence]</a>";
+ $res.=" - <a href=\"?_C={$exalead_data->query->context}&_f=xml2\">[Classer par pertinence]</a>";
else
- $res.=" - <a href=\"?_C={$exalead_data->query->context}/_sf=-date&_f=xml2\">[Classer par date]</a>";
+ $res.=" - <a href=\"?_C={$exalead_data->query->context}&_sf=-date&_f=xml2\">[Classer par date]</a>";
return $res;
}
CV : ".$num." / {$exalead_data->nhits} -";
}
if($date)
- $res.="<a href=\"ec_cherche_cv.php?_C={$exalead_data->query->context}/_sf=-date&_f=xml2&_s=".$dizaine."\">Retour à la recherche</a>";
+ $res.="<a href=\"ec_cherche_cv.php?_C={$exalead_data->query->context}&_sf=-date&_f=xml2&_s=".$dizaine."\">Retour à la recherche</a>";
else
- $res.="<a href=\"ec_cherche_cv.php?_C={$exalead_data->query->context}/_sf=-relevance&_f=xml2&_s=".$dizaine."\">Retour à la recherche</a>";
+ $res.="<a href=\"ec_cherche_cv.php?_C={$exalead_data->query->context}&_f=xml2&_s=".$dizaine."\">Retour à la recherche</a>";
$res .="</td>";
if($box)
$res.="<td class=\"droite\">";
function _display_3_columns($title, $count, $refine, $exclude, $categorie){
if ($title!='Inconnu'){
global $exa_max_length;
- if($categorie) $title_exclude = 'Ne pas afficher cette catégorie';
- else $title_exclude = 'Ne pas afficher ce mot-clé';
+ if($categorie) $title_exclude = 'Ne pas afficher cette catégorie';
+ else $title_exclude = 'Ne pas afficher ce mot-clé';
$extract = ((strlen($title) > $exa_max_length + 3)?substr($title,0,$exa_max_length).'...':$title);
return "<tr class=\"categ\">
<td>
function _display_2_columns($title, $reset, $excluded, $categorie){
global $exa_max_length;
if($excluded){
- if($categorie) $title_link = 'Afficher de nouveau cette catégorie';
- else $title_link = 'Afficher de nouveau ce mot-clé';
+ if($categorie) $title_link = 'Afficher de nouveau cette catégorie';
+ else $title_link = 'Afficher de nouveau ce mot-clé';
$link = '[+]';
$style = 'text-decoration: line-through;';
} else{
- if($categorie) $title_link = 'Voir les autres catégories';
- else $title_link = 'Voir les autres mots-clés';
+ if($categorie) $title_link = 'Voir les autres catégories';
+ else $title_link = 'Voir les autres mots-clés';
$link = '[-]';
$style = 'text-decoration: none; font-weight: bold;';
}
foreach($group->categories as $categorie){
$title = (empty($categorie->display)?$categorie->name:$categorie->display);
$count = (empty($categorie->count)?'':' ('.$categorie->count.')');
- $refine = $context.'/'.$categorie->refine_href;
- $exclude = $context.'/'.$categorie->exclude_href;
- $reset = $context.'/'.$categorie->reset_href;
+ $refine = $context.'&'.$categorie->refine_href;
+ $exclude = $context.'&'.$categorie->exclude_href;
+ $reset = $context.'&'.$categorie->reset_href;
if($categorie->display != ''){
if($categorie->is_normal()){