{** * Displays search results, used for both quick and advanced search, content template * Date: 19.11.09 * * @package saurus4 * * @author Saurus * *} {assign var="limit" value="20"} {if $smarty.request.page} {assign var="current_page" value=$smarty.request.page|intval} {else} {assign var="current_page" value=0} {/if} {init_search_results name="search" start=$current_page*$limit limit=$limit use_fulltext=1 query=$smarty.get.query exclude=$smarty.get.exclude search_type=$smarty.get.bool section=$smarty.get.section last_changed=$smarty.get.time order=$smarty.get.order} {* if fulltext searching is not working for your language omit the parameter from the tag or set it to 0, in this case LIKE search will be performed *} {if $smarty.request.label} {assign var="current_label" value=$smarty.request.label} {else} {assign var="current_label" value=$search[0]->name} {/if} {*** backwards comaptibility with 'otsi' ***} {if $smarty.request.query} {assign var="query" value=$smarty.request.query|xss_clean|htmlspecialchars} {elseif $smarty.request.otsi} {assign var="query" value=$smarty.request.otsi|xss_clean|htmlspecialchars} {else} {assign var="query" value=""} {/if} {*** /backwards comaptibility with 'otsi' ***}
{********* Search header **********}

{sysword word="Keyword" type="Search"}: {$query}

{sysword word="Results" type="Search"} ({$search_counttotal}) {foreach from=$search item="label"} {if $label->name == $current_label} {$label->title} ({$label->counttotal}) {assign var="current_count" value=$label->counttotal} {assign var="total_pages" value=$current_count/$limit|ceil} {else} name`"|replace:"&page=`$current_page`":""}{else}{$smarty.server.QUERY_STRING|replace:"&page=`$current_page`":""|cat:"&label=`$label->name`"}{/if}">{$label->title} ({$label->counttotal}) {/if} {/foreach}
{********* // Search header **********} {********* Search results **********} {if $search_counttotal}
{foreach from=$search item="label"} {if $label->name == $current_label} {foreach from=$label->results item="object"}
{$object->excerpt}
{/foreach} {/if} {/foreach}
{else} {********* No results article **********} {init_article name="art" system_message="no_search_results"} {if strlen($query) < 4}
{sysword word="keyword_too_short" type="saurus4"}
{/if} {if $art->show_headline}

{$art->buttons}{$art->title}

{/if}
{$art->lead} {$art->body}
{/if} {********* // Search results **********} {if $current_count} {********* Paging **********}
{if $current_page-1 >= 0}« <{/if} {if $total_pages <= 5} {assign var="pages_loop" value=$total_pages} {assign var="pages_loop_start" value="0"} {else} {assign var="pages_loop_start" value=$current_page-2} {if $pages_loop_start < 0}{assign var="pages_loop_start" value=0}{/if} {assign var="pages_loop" value=$pages_loop_start+5} {if $pages_loop > $total_pages} {assign var="pages_loop_start" value=$total_pages-5} {assign var="pages_loop" value=$total_pages} {/if} {/if} {section name="pages" loop=$pages_loop start=$pages_loop_start} {if $smarty.section.pages.index != $current_page}{/if}{$smarty.section.pages.index+1}{if $smarty.section.pages.index != $current_page}{/if} {/section} {if $current_page+1 != $total_pages}> »{/if}
{********* //Paging **********} {/if}