texte = Here is one that scales to meet any number of pages. It shows links to only13 pages and automatically sorts out which of the 13 to show. It also shows10 hits at a time. You can change that easily as well. You can see it in action here: http://www.kanuhawaii.org/today/journals/The code:--- begin CSS ---/* paging */.Pages {text-align: center;clear: both;}.Paginator {font-size: 12px;padding-top: 10px;margin-left: auto;margin-right: auto;}.Paginator a, .pageList .this-page {padding: 2px 6px;border: solid 1px #ddd;background: #fff;text-decoration: none;}.Paginator .AtStart {margin-right: 20px;padding: 2px 6px;color: #334f73;}.Paginator .Prev {margin-right: 20px;padding: 2px 6px;border: solid 2px #ddd;background: #fff;}.Paginator .Next {margin-left: 20px;padding: 2px 6px;border: solid 2px #ddd;background: #fff;}.Paginator .AtEnd {margin-left: 20px;padding: 2px 6px;color: #334f73;}.Paginator .this-page {padding: 2px 6px;border-color: #999;font-weight: bold;font-size: 13px;color: #334f73;}.Paginator .onthis{color: #fff;background: #739dd3;border-color: #334f73;text-decoration: none;}.Paginator a:hover {color: #fff;background: #739dd3;border-color: #334f73;text-decoration: none;}.Pages div.Results {text-align: center;font: 11px/15px Arial, Helvetica;color: #aaa;margin-top: 8px;}--- end CSS ------ begin code on page ---[if[page]![raw][page][/raw]][then][text]page=[page][/text][/then][else][text]page=1[/text][/else][/if][search db=your.db&your search/sortterms&max=10&startat=[math](([page]-1)*10)+1[/math]]Page [page] of [math]ceil([numFound]/10)[/math][genPagingpath=[url][thisurl]?[/url]n=[numfound]&page=[page]&end=[math]ceil([numfound]/10)[/math]][foundItems]Etc...[genPagingpath=[url][thisurl]?[/url]n=[numfound]&page=[page]&end=[math]ceil([numfound]/10)[/math]][/foundItems][/search]You can also end the found items like this to get the paging on the bottom--- end code on page ------ put this function somewhere on your page or your functions lib ---[function name=genPaging]
[if [end]<18][then][loop start=1&end=[end]][if [page]=[index]][then]
[index][/then][else]
[index][/else][/if][/loop][/then][else][if [math][page]-8[/math]<0][then][loop start=1&end=10][if [page]=[index]][then]
[index][/then][else]
[index][/else][/if][/loop]...[loop start=[math][end]-2[/math]&end=[end]]
[index][/loop][/then][else][if [math][page]+7[/math]>[end]][then][loopstart=1&end=3]
[index][/loop]...[loopstart=[math][end]-9[/math]&end=[end]][if [page]=[index]][then]
[index][/then][else]
[index][/else][/if][/loop][/then][else][loop start=1&end=3]
[index][/loop]...[loopstart=[math][page]-3[/math]&end=[math][page]+3[/math]][if[page]=[index]][then]
[index][/then][else]
[index][/else][/if][/loop]...[loop start=[math][end]-2[/math]&end=[end]]
[index][/loop][/else][/if][/else][/if][/else][/if]
[/function]--- end function-----Original Message-----From: Terry Wilson [mailto:terry@terryfic.com] Sent: Thursday, January 28, 2010 5:39 AMTo: talk@webdna.usSubject: Re: [WebDNA] Show next.....I use a pretty simple and straightforward way to reduce the chunks to simple page numbers (that's a bullet inbetween):[hideif [numfound]<101]MORE PAGES (100 per page) >>>[shownext position=begin]
[/shownext][shownext position=middle][math]ceil([end]/100)[/math][/shownext][shownext position=end]
[/shownext][/hideif]Terry>> This goes back a few years.....>>>> Someone had a way to do "Next | Previous" search results>> in the same way Google does....>>>> I believe there was a charge for the code snippet (very moderate)>>>> Anyone remember who and where it might be?>>>> I have a need to show search results that way on a site redo......>>>> Thanks>>>> Richard>>Richard,>you might have been thinking of the notes on this (older docs) page:>>http://docs.webdna.us/ > At-a-Glance > [ShowNext]>A.K.A.:>http://docs.webdna.us/pages.html?context=ShowNextContext.html>>-G>>Govinda>govinda.webdnatalk@gmail.com>>>>>--------------------------------------------------------->This message is sent to you because you are subscribed to>the mailing list