Gossamer Forum
Home : Products : Links 2.0 : Customization :

Page Number & Links Numbering

Quote Reply
Page Number & Links Numbering
Does anybody know how to get the current page number and the links number range to display on the categories page?

What I want is:

Links 26-50 of 123 -- Page 2 of 5

Thanks
Paul



Quote Reply
Re: Page Number & Links Numbering In reply to
One suggestion is taking the spanning codes used in Widgetz's Category and Search Mod (which can be found in this forum), and put them in your sub build_category_pages.

Regards,

Eliot Lee
Quote Reply
Re: Page Number & Links Numbering In reply to
Eliot,

I am confused what the Category and Search Mod does exactly...hence I am confused how this will help my problem.

Thanks,
Paul

(Tell me to search the forum some more) :)

-- I actually have...almost all links have become visited and are the color gray...

Quote Reply
Re: Page Number & Links Numbering In reply to
Welp...the codes in the search.cgi replace the old spanning results from:

Code:

[<<] 1 | 2 | 3 | 4 [>>]


to the following codes:

Code:

[<<] 1 | 2 | 3 | 4 [>>] Displaying 11-20 Results of 7 Pages


To see an example, go to:

http://vlib.anthrotech.com/...p;order=a&sort=1

The codes in Widgetz's search.cgi script are closest to what you want....that I could think of.

Regards,

Eliot Lee
Quote Reply
Re: Page Number & Links Numbering In reply to
Thanks Eliot that helped (for the search part) ... now I'll have to figure out the category part, not as easy. Any tips on that? I can't get the page number from the input parms..

I'll post this code for others

in site_html.pl in sub site_html_search_results

add the following code after the "my" field definitions:

my $nh = &urlencode ($in{'nh'});
$totalpages = int($link_hits/$maxhits);
if ($totalpages < $link_hits/$maxhits) { $totalpages++; }
if ($highrange > $link_hits) { $highrange = $link_hits; }

Then use the following fields respectively:

$nh = current page number
$totalpages = total pages returned by search
$lowrange = first link number on page displayed
$highrange = fast link number on page displayed
$link_hits = total number of links returned

So to display "Page 1 of 2 -- Links 1-25 of 123" use:

print "Page $nh of $totalpages -- Links $lowrange-$highrange of $link_hits";


Have fun!
Paul


Quote Reply
Re: Page Number & Links Numbering In reply to
For Template users....follow these steps:

1) Add the following codes at the top of the sub site_html_search_results in the site_html_templates.pl file:

Code:

my $nh = &urlencode ($in{'nh'});
$totalpages = int($link_hits/$maxhits);
if ($totalpages < $link_hits/$maxhits) {
$totalpages++;
}
if ($highrange > $link_hits) {
$highrange = $link_hits;
}
$display .= qq|Page $nh of $totalpages -- Links $lowrange-$highrange of $link_hits|;


2) Then define the display tag as follows:

Code:

display => $display,


(Delete the comma if this is the last tag in the list.)

3) Then use the following tag in your search_results.html file:

Code:

<%display%>


Smile

Regards,

Eliot Lee
Quote Reply
Re: Page Number & Links Numbering In reply to
Eliot,

(Holding my head in shame)

After joking you about your standard answers "search the forum!" ... "search the forum!!" :) I have solved my problem.

There is a "Download.com" mod that will work great....BUT in my defense....I downloaded the mod and installed it...had it running, BUT the Links x-x of z was NOT in the code I had. I read the documentation again and realized it did NOT match the source I had... the fields I needed where not in the source. I download the source again (new version I guess) ...

All is well...

Thanks,
Eliot

Quote Reply
Re: Page Number & Links Numbering In reply to
GOOD!

See...there are answers to questions in these forums!!

Wink

Regards,

Eliot Lee