From: x2000habouzit Date: Sat, 13 Nov 2004 11:46:31 +0000 (+0000) Subject: a good heuristic for OG X-Git-Tag: xorg/old~970 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=22138f77835eab99c071702fca15021ef861edaf;p=platal.git a good heuristic for OG --- diff --git a/htdocs/advanced_search.php b/htdocs/advanced_search.php index beb77cc..e51dbc5 100644 --- a/htdocs/advanced_search.php +++ b/htdocs/advanced_search.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: advanced_search.php,v 1.27 2004-11-06 17:22:11 x2000habouzit Exp $ + $Id: advanced_search.php,v 1.28 2004-11-13 11:46:31 x2000habouzit Exp $ ***************************************************************************/ require("auto.prepend.inc.php"); @@ -145,5 +145,16 @@ else { } +function display_lines($text) { + $n = 0; + $i=-1; + while(($i=strpos($text,'',$i+1))!==false) $n++; + $i=-1; + while(($i=strpos($text,'
',$i+1))!==false) $n++; + return $n; +} + +$page->register_modifier('display_lines', 'display_lines'); + $page->run(); ?> diff --git a/templates/search.tpl b/templates/search.tpl index b95b144..9bdd705 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: search.tpl,v 1.26 2004-11-13 10:52:50 x2000habouzit Exp $ + $Id: search.tpl,v 1.27 2004-11-13 11:46:31 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -34,6 +34,7 @@
+ {capture name=list} {section name=resultat loop=$resultats} {if !$resultats[resultat].inscrit || $resultats[resultat].decede}
{/if} {if $resultats[resultat].contact || $resultats[resultat].watch} @@ -44,6 +45,8 @@ {include file=include/minifiche.tpl c=$resultats[resultat] show_action=$show_action inscrit=$resultats[resultat].inscrit} {if !$resultats[resultat].inscrit || $resultats[resultat].decede}
{/if} {/section} + {/capture} + {$smarty.capture.list|smarty:nodefaults}
{if $perpage < $nb_resultats_total} @@ -69,11 +72,11 @@ {min_auth level='cookie'}
- {if $advanced && $smarty.section.resultat.total>10}{include file=search.adv.links.tpl do_title=1}{/if} + {if $advanced && $smarty.capture.list|smarty:nodefaults|display_lines > 20}{include file=search.adv.links.tpl do_title=1}{/if} -

Astuces

- -

Si tu survoles une fiche, tu sauras quand elle a été mise à jour la dernière fois !

+

+ Astuce: + Si tu survoles une fiche, tu sauras quand elle a été mise à jour la dernière fois !

{/min_auth} {else} {if $advanced}