RE: [WebDNA] Show next.....

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 104606
interpreted = N
texte = Here is one that scales to meet any number of pages. It shows links to only 13 pages and automatically sorts out which of the 13 to show. It also shows 10 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]pa ge=1[/text][/else][/if] [search db=your.db&your search/sort terms&max=10&startat=[math](([page]-1)*10)+1[/math]] Page [page] of [math]ceil([numFound]/10)[/math] [genPaging path=[url][thisurl]?[/url]n=[numfound]&page=[page]&end=[math]ceil([numfound] /10)[/math]] [foundItems] Etc... [genPaging path=[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][loop start=1&end=3][index][/loop]...[loop start=[math][end]-9[/math]&end=[end]][if [page]=[index]][then][index][/then][else][index][/else][/if][/loop][/th en][else][loop start=1&end=3][index][/loop]...[loop start=[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 AM To: talk@webdna.us Subject: 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][math]ceil([end]/100)[/math] • [/shownext] [shownext position=middle][math]ceil([end]/100)[/math][/shownext] [shownext position=end] • [math]ceil([end]/100)[/math][/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 . >To unsubscribe, E-mail to: >archives: http://mail.webdna.us/list/talk@webdna.us >old archives: http://dev.webdna.us/TalkListArchive/ >Bug Reporting: http://forum.webdna.us/eucabb.html?page=topics&category=288 -- Terry Wilson | terry@terryfic.com | http://terryfic.com http://WhosComing.com - a simplified, affordable online reservation system http://TightJacket.com -- stylish protection for your laptop -------------------------------------------------------------------------- Attitude is the only difference between ordeal and adventure. --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us old archives: http://dev.webdna.us/TalkListArchive/ Bug Reporting: http://forum.webdna.us/eucabb.html?page=topics&category=288 Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Show next..... (Rich Kwas 2010)
  2. Re: [WebDNA] Show next..... (Donovan Brooke 2010)
  3. Re: [WebDNA] Show next..... (Tom Duke 2010)
  4. Re: [WebDNA] Show next..... ("Terry Wilson" 2010)
  5. Re: [WebDNA] Show next..... (Dan Strong 2010)
  6. Re: [WebDNA] Show next..... (Donovan Brooke 2010)
  7. Re: [WebDNA] Show next..... (Govinda 2010)
  8. Re: [WebDNA] Show next..... ("Terry Wilson" 2010)
  9. Re: [WebDNA] Show next..... ("Psi Prime Inc, Matthew A Perosi " 2010)
  10. RE: [WebDNA] Show next..... ("Olin Lagon" 2010)
  11. Re: [WebDNA] Show next..... (Donovan Brooke 2010)
  12. Re: [WebDNA] Show next..... ("Psi Prime Inc, Matthew A Perosi " 2010)
  13. Re: [WebDNA] Show next..... (Terry Wilson 2010)
  14. Re: [WebDNA] Show next..... (Govinda 2010)
  15. Re: [WebDNA] Show next..... (christophe.billiottet@webdna.us 2010)
Here is one that scales to meet any number of pages. It shows links to only 13 pages and automatically sorts out which of the 13 to show. It also shows 10 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]pa ge=1[/text][/else][/if] [search db=your.db&your search/sort terms&max=10&startat=[math](([page]-1)*10)+1[/math]] Page [page] of [math]ceil([numFound]/10)[/math] [genPaging path=[url][thisurl]?[/url]n=[numfound]&page=[page]&end=[math]ceil([numfound] /10)[/math]] [founditems] Etc... [genPaging path=[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][loop start=1&end=3][index][/loop]...[loop start=[math][end]-9[/math]&end=[end]][if [page]=[index]][then][index][/then][else][index][/else][/if][/loop][/th en][else][loop start=1&end=3][index][/loop]...[loop start=[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 AM To: talk@webdna.us Subject: 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][thisurl]?startat=[start]&(your parameters)">[math]ceil([end]/100)[/math] • [/shownext] [shownext position=middle][math]ceil([end]/100)[/math][/shownext] [shownext position=end] • [thisurl]?startat=[start]&(your parameters)">[math]ceil([end]/100)[/math][/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 . >To unsubscribe, E-mail to: >archives: http://mail.webdna.us/list/talk@webdna.us >old archives: http://dev.webdna.us/TalkListArchive/ >Bug Reporting: http://forum.webdna.us/eucabb.html?page=topics&category=288 -- Terry Wilson | terry@terryfic.com | http://terryfic.com http://WhosComing.com - a simplified, affordable online reservation system http://TightJacket.com -- stylish protection for your laptop -------------------------------------------------------------------------- Attitude is the only difference between ordeal and adventure. --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us old archives: http://dev.webdna.us/TalkListArchive/ Bug Reporting: http://forum.webdna.us/eucabb.html?page=topics&category=288 "Olin Lagon"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCat2 - Getting to the browser's username/password data (1997) The Form authentication trick (2000) Formulas.db + Users.db (1997) serial number dishing (1997) Sort Order on a page search (1997) Security Issue (1997) results in a table (2000) Plugin or CGI or both (1997) upgrade? (1997) New reserved words for [tags] (2000) AddLineItem Problem (1997) [ShowIf] and empty fields (1997) New Business Opportunity (2006) [urgent] Phone number at SM (2006) MacAuthorize order data fields WAS:How To question... (1997) Setting up shop (1997) linetiems in thankyou.tpl (1997) filtering extra characters from credit card numbers (2001) emailer on Windows Beta 18 (1997) [WebDNA] bulk e-mail (2011)