Page 1 of 1

Problem in search Script

Posted: Fri Nov 30, 2007 9:33 am
by hiti
Hello Everybody

I have integrated search script with my website.Everything works fine but i hav 1 problem that when records are less than 6 then the result count does not appears .I have tried in script but culdn't make it appear at the site.Plz help.
Letme know where to make a change in search script so as to get the result count at the top of page

Here is the part of my code

<A NAME=summary>
<local dispstart=$start dispend=$end>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 align=left>
<TR><TD align=center nowrap><FM>
<div id="pagecount"><!-- remove deleted (unauthorized/skipped) results: -->
Results <$dispstart = ($start - $sumua)>
<$dispend = ($end - $sumua - $curpgua)>
<b>$dispstart </b> - <b>$dispend</b> of about
<!-- if resauth off, or we have a user-visible count, then ok to show: -->
<if "ok" neq $ResAuthInitResult or "" neq $resultcount>
<!-- avoid pathological "1 to X of at least Y" where X == Y:
== only show "at least Y" if X != Y:
-->
<if $dispend neq $resultcount or "ok" eq $ExitReason>
<if "ok" neq $ExitReason> at least </if>
<if "" neq $resultcount>
<!-- wtf check $ResultCountApprox/<UserResultsIsEstimate>
== for "about"
-->
<fmt " %kd " $resultcount>
<else>
<if "Y" eq $IndexCountApprox> about </if>
<fmt " %kd " $indexcount>
</if>
</if>
</if></div>
<if $cmd eq mlt><!-- doing a "more like this" query -->
similar documents.
<else>
<local order=$order>
<switch $order>
<case "da">oldest pages first. &nbsp;&nbsp;
<$order="r"><A HREF="$pageUrl/$UrlFunc$UrlExt$urlq$mltvar" class="blulinks13">Sort by relevance</A>
<case "dd">latest pages first.
<$order="r"><A HREF="$pageUrl/$UrlFunc$UrlExt$urlq$mltvar" class="blulinks13">Sort by relevance</A>
<default>best matches first.
<$order="dd"><A HREF="$pageUrl/$UrlFunc$UrlExt$urlq$mltvar" class="blulinks13">Sort by date</A>
</switch>
</local>
</if>
</F></TD></TR>
<IF $indexcount gt $SSc_hitsperpage and $start gt 0 or $indexcount gt $end>
<TR><TD ALIGN=CENTER VALIGN="bottom"><FM>
<IF $jump gt 0> <!-- show previous link -->
<!-- Last value of $ua applies to previous page:
== subtract from $jump and remove from $ua export:
-->
<local j>
<rex "\digit+>>=" $ua> <!-- last value of $ua -->
<$j = ($jump - $SSc_hitsperpage - $ret)>
<rex ".*\F,=\digit+>>=" $ua> <!-- all but last value -->
<if "" neq $ret><strfmt "&ua=%s" $ret></if>
<!-- <A HREF="$url/$UrlFunc$UrlExt$urlq$mltvar&jump=$j$ret"><<previous</A>-->
&nbsp;&nbsp;<A HREF="$pageUrl/$UrlFunc$UrlExt$urlq$mltvar&jump=$j$ret" class="b"><B>Previous</B></A>&nbsp;&nbsp;<A HREF="$pageUrl/$UrlFunc$UrlExt$urlq$mltvar&jump=$j$ret"><img src="http://www.naubo.com/images/pagePrev.gif" border="0"></a>
<ELSE><!-- <credit> -->
</IF>
&nbsp;</F>
<FM><font size=-1><pageno></font></F>
<FM>&nbsp;
<IF "y" eq $shownext> <!-- show next link -->
<!-- Append $curpgua to $ua for next-page link: -->
<if "" neq $curpgua> <!-- resauth active -->
<if "" neq $ua>
<strfmt "&ua=%s,%d" $ua $curpgua>
<else>
<strfmt "&ua=%d" $curpgua>
</if>
<else>
<$ret = >
</if>
<!-- <A HREF="$url/$UrlFunc$UrlExt$urlq$mltvar&jump=$end$ret">next>></A> -->
<A HREF="$pageUrl/$UrlFunc$UrlExt$urlq$mltvar&jump=$end$ret"><img src="http://www.naubo.com/images/pageNext.gif" border="0"></a>&nbsp;&nbsp;<A HREF="$pageUrl/$UrlFunc$UrlExt$urlq$mltvar&jump=$end$ret" class="b"><B>Next</B></A>
<ELSE><!-- <credit> -->
</IF>
</F></TD></TR>
</IF>
</TABLE>
</a>

Problem in search Script

Posted: Fri Nov 30, 2007 10:26 am
by mark
You're looking in the wrong place. The summary function is always called for the top of the result list. If the list is short, less than 6, it's not called for the bottom since the whole list will probably be visible to the user and the second summary would be redundant. Look where summary is called to make adjustments.