actually, after some thought I cleaned up the code a bit and optomized some
silliness.  Here's the final CVS diff versus the current CVS branch.  The
same patch works in 3.1.6, except config is an object, not a pointer, so you
change the "->" to a ".".

[adamn@fbucks4 htsearch 11:15:57]$ cvs diff -c3 Display.cc
Index: Display.cc
===================================================================
RCS file: /cvsroot/htdig/htdig/htsearch/Display.cc,v
retrieving revision 1.105
diff -c -3 -r1.105 Display.cc
*** Display.cc  14 Jun 2002 22:31:39 -0000      1.105
--- Display.cc  3 Dec 2002 19:08:55 -0000
***************
*** 696,702 ****
        QuotedStringList        sep(config->Find("page_number_separator"), "
\t\r\n");
        if (nPages > config->Value("maximum_page_buttons", 10))
            nPages = config->Value("maximum_page_buttons", 10);
!       for (i = 1; i <= nPages; i++)
        {
            if (i == pageNumber)
            {
--- 696,707 ----
        QuotedStringList        sep(config->Find("page_number_separator"), "
\t\r\n");
        if (nPages > config->Value("maximum_page_buttons", 10))
            nPages = config->Value("maximum_page_buttons", 10);
!         int pageSpan = config->Value("results_page_span", 10);
!         int pageStart = pageNumber - pageSpan;
!         int pageEnd = pageNumber + pageSpan;
!         if ( pageStart < 1 ) pageStart = 1;
!         if ( pageEnd > nPages ) pageEnd = 1;
!       for (i = pageStart; i <= pageEnd; i++)
        {
            if (i == pageNumber)
            {

----- Original Message -----
From: "Geoff Hutchison" <[EMAIL PROTECTED]>
To: "Adam Ness" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 8:53 PM
Subject: Re: [htdig-dev] Google-style paging



On Monday, December 2, 2002, at 04:42  PM, Adam Ness wrote:

> We wanted the search engine for our site to do paging in the google
> style, so I've made the following changes to our htsearch/Display.cc
> that sets up another config variable (results_page_span) that allows
> you to display a set number of pages before and after the current
> page. You still have to come up with graphics, or just use the text
> links, but it's great for large search result sets

Could you provide a bit more information about your patch? What release
of ht://Dig was this patch written for? Could you provide the patch as a
"diff -c3p" so we have more context to go with the patched lines?

We appreciate the patch, and I'm sure there are plenty of other users
who'd be interested!

Thanks,
-Geoff

--
-Geoff Hutchison
Williams Students Online
http://wso.williams.edu/



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T
handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
htdig-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htdig-dev




-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
htdig-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/htdig-dev

Reply via email to