<?php
require("auto.prepend.inc.php");
require("search.classes.inc.php");
-// choix entre partie publique (annuaire_public est vrai) et partie privée de l'annuaire.
-$public_directory = ((isset($_REQUEST['public_directory']) && $_REQUEST['public_directory']==1));
-if ($public_directory)
- new_skinned_page('search.tpl', AUTH_PUBLIC);
-else
+
+new_skinned_page('search.tpl', AUTH_PUBLIC);
+if(logged()) {
new_skinned_page('search.tpl', AUTH_COOKIE,true);
+}
+
$page->assign('advanced',0);
-$page->assign('public_directory',$public_directory);
require_once("applis.func.inc.php");
require_once("geoloc.inc.php");
Recherche simple
{/if}
<div class="floatright">
- {if $advanced eq "1"}
- <a href="search.php">-> Recherche simple</a>
- {elseif $public_directory neq "1"}
- <a href="advanced_search.php">-> Recherche avancée</a>
+ {if $advanced}
+ [<a href="search.php">Recherche simple</a>]
+ {else}
+ {min_auth level="cookie"}
+ [<a href="advanced_search.php">Recherche avancée</a>]
+ {/min_auth}
{/if}
</div>
</div>
{/if}
<div class="center">
<form action="{$smarty.server.PHP_SELF}" method="post" name="recherche">
- <input type="hidden" name="public_directory" value="{$public_directory}">
<table class="tinybicol" cellpadding="3" summary="Recherche">
<tr>
<td>Nom</td>
<td>
<select name="egal1">
<option value="=" {if $smarty.request.egal1 eq "="}selected{/if}> = </option>
- <option value=">" {if $smarty.request.egal1 eq ">"}selected{/if}> > </option>
- <option value="<" {if $smarty.request.egal1 eq "<"}selected{/if}> < </option>
+ <option value=">" {if $smarty.request.egal1 eq ">"}selected{/if}> > </option>
+ <option value="<" {if $smarty.request.egal1 eq "<"}selected{/if}> < </option>
</select>
<input type="text" name="promo1" size="4" maxlength="4" value="{$smarty.request.promo1}" />
ET
<select name="egal2">
<option value="=" {if $smarty.request.egal2 eq "="}selected{/if}> = </option>
- <option value=">" {if $smarty.request.egal2 eq ">"}selected{/if}> > </option>
- <option value="<" {if $smarty.request.egal2 eq "<"}selected{/if}> < </option>
+ <option value=">" {if $smarty.request.egal2 eq ">"}selected{/if}> > </option>
+ <option value="<" {if $smarty.request.egal2 eq "<"}selected{/if}> < </option>
</select>
<input type="text" name="promo2" size="4" maxlength="4" value="{$smarty.request.promo2}" />
</td>
<td>Pays</td>
<td>
<select name="pays" onChange="javascript:document.recherche.submit();">
- {if isset($smarty.request.pays)}
+ {if $smarty.request.pays}
{assign var="pays" value=$smarty.request.pays}
{else}
{assign var="pays" value=""}
<td>Région ou département</td>
<td>
<select name="region">
- {if isset($smarty.request.region)}
+ {if $smarty.request.region}
{assign var="region" value=$smarty.request.region}
{else}
{assign var="region" value=""}
{if $nb_resultats_total==0}Aucune{else}{$nb_resultats_total}{/if} réponse{if $nb_resultats_total>1}s{/if}.
<div class="floatright">
{if $with_soundex==0}
- <a href="{$smarty.server.PHP_SELF}?public_directory={$public_directory}&with_soundex=1&rechercher=1&{$url_args}">
+ <a href="{$smarty.server.PHP_SELF}?with_soundex=1&rechercher=1&{$url_args}">
Etendre à la recherche par proximité sonore
</a>
{/if}
- <a href="{$smarty.server.PHP_SELF}?public_directory={$public_directory}">Nouvelle recherche</a>
+ <a href="{$smarty.server.PHP_SELF}">Nouvelle recherche</a>
</div>
</div>
<p class="normal">
<div class="contact">
<div class="{if $resultats[resultat].inscrit==1}pri3{else}pri1{/if}">
{include file="search.result.public.tpl" result=$resultats[resultat]}
- {if $public_directory!=1}
+ {min_auth level="cookie"}
{include file="search.result.private.tpl" result=$resultats[resultat]}
- {/if}
+ {/min_auth}
</div>
</div>
{/section}
{if $perpage<$nb_resultats_total}
<p class="normal">
{if $offset!=0}
- <a href="{$smarty.server.PHP_SELF}?public_directory={$public_directory}&with_soundex={$with_soundex}&rechercher=1&{$url_args}&offset={$offset-$perpage}">
+ <a href="{$smarty.server.PHP_SELF}?with_soundex={$with_soundex}&rechercher=1&{$url_args}&offset={$offset-$perpage}">
Précédent
</a>
{/if}
{section name=offset loop=$offsets}
{if $offset!=$smarty.section.offset.index*$perpage}
- <a href="{$smarty.server.PHP_SELF}?public_directory={$public_directory}&with_soundex={$with_soundex}&rechercher=1&{$url_args}&offset={$smarty.section.offset.index*$perpage}">
+ <a href="{$smarty.server.PHP_SELF}?with_soundex={$with_soundex}&rechercher=1&{$url_args}&offset={$smarty.section.offset.index*$perpage}">
{$smarty.section.offset.index+1}
</a>
{else}
{/section}
{if $offset<$nb_resultats_total-$perpage}
- <a href="{$smarty.server.PHP_SELF}?public_directory={$public_directory}&with_soundex={$with_soundex}&rechercher=1&{$url_args}&offset={$offset+$perpage}">
+ <a href="{$smarty.server.PHP_SELF}?with_soundex={$with_soundex}&rechercher=1&{$url_args}&offset={$offset+$perpage}">
Suivant
</a>