logo

New Response

« Return to the main article

You are replying to:

    • avatar
    • Mike T
    • Posted on Wed 7 Apr 2004

    I modified this already awesome formula to be alittle bit truer and a little bit more flexible: 1. a variable xcount allows you to quickly ocnfigure the record count. 2. The starting point is 1 instead of 0. 3. The ending point is the TotalHits instead of a blind mathematical multiple. 4. I also added a textual display record.

    enjoy. i didnt read this whole thread som i dont know if these enhances were already done.

    REM "NOTE: start param must be before count param in the original URL"; xcount:=25; qs:=@Middle(Query_String+"&";"Query=";"&"); sv:=@Middle(Query_String+"&";"sv=";"&"); pageString := "<a href=\"/"+dbname+"/"+ViewName+"?SearchView&Query=" + qs + "&start=";

    REM "We are limited to 250 docs by domino!!"; hitNum := @If(TotalHits > 250;250;TotalHits);

    adJust := @Integer(hitNum/xcount); endDate := @Text(@Adjust([01/01/1900];0;0;adJust;0;0;0);"D0S0"); numRange := @Explode(@TextToTime("01/01/1900 - " + endDate)); numList := (@TextToTime(numRange) - [01/01/1900]) / 86400;

    textList1 := @Text(numList*xcount+1) + " - " + @Text(@Min((numList + 1)*xcount;hitNum)); textList10 := @Text(numList * 25+1); tr1:="<tr><td>Displaying "+@Text(Start)+" to "+@Text(@Min(Start+Count;TotalHits))+" of "+@Text(TotalHits)+" Total...</td></tr>"; rnav:="<table>"+tr1+"<tr><td>"+@Implode(pageString + textList10 + "&count="+@Text(xcount)+"&sv="+sv+"\">" + textList1 + "</a>";" | ")+"</td></tr></table>"; @If(TotalHits > xcount;rnav ;"&nbsp;")

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: