Gossamer Forum
> >
Quote Reply
Re: [katabd] SQL syntax In reply to
It looks like you are missing the mh variable - I assume this is because the tag available is maxhits as you have originally. Try this line instead:

my $mh = (ref $tags->{maxhits} ? ${$tags->{maxhits}} : $tags->{maxhits});
Quote Reply
Re: [afinlr] SQL syntax In reply to
Thanks Laura

That worked great...

In the template user_list should I change anything as the spanning is no longer visible..

What I used to use was:


<%ifnot nh%><%set nh=1%><%endif%>
<%set numhits=5000%>
<%set maxhits=100%>
<%span_page%><P>

<%users_list%></font>
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] SQL syntax In reply to
Think you may need to post the span_page global you are using before I can help there (may be a similar problem to the global above).
Quote Reply
Re: [afinlr] SQL syntax In reply to
Thanks Laura

I got it corrected..

sub {
# ---------------------------------------------------------------
# Display/calculate a span pages toolbar.
#
my $tags=shift;
my $nh = (ref $tags->{nh} ? ${$tags->{nh}} : $tags->{nh});
my $page= (ref $tags->{p} ? ${$tags->{p}} : $tags->{p});
my $maxhits= (ref $tags->{maxhits} ? ${$tags->{maxhits}} : $tags->{maxhits})||10000;
my $numhits= (ref $tags->{numhits} ? ${$tags->{numhits}} : $tags->{numhits})||100000;
my ($next_url, $max_page, $next_hit, $prev_hit, $left, $right, $upper, $lower, $first, $url, $last, $i);

# Return if there shouldn't be a speedbar.
return unless ($numhits > $maxhits);

$next_hit = $nh + 1;
$prev_hit = $nh - 1;
$max_page = int ($numhits / $maxhits) + (($numhits % $maxhits) ? 1 : 0);

# First, set how many pages we have on the left and the right.
$left = $nh;
$right = int($numhits/$maxhits) - $nh;

# Then work out what page number we can go above and below.
($left > 7) ? ($lower = $left - 7) : ($lower = 1);
($right > 7) ? ($upper = $nh + 7) : ($upper = int($numhits/$maxhits) + 1);

# Finally, adjust those page numbers if we are near an endpoint.
(7 - $nh >= 0) and ($upper = $upper + (8 - $nh));
($nh > ($numhits/$maxhits - 7)) and ($lower = $lower - ($nh - int($numhits/$maxhits - 7) - 1));
$url = "";
# Then let's go through the pages and build the HTML.
($nh > 1) and ($url .= qq~<a href="$CFG->{db_cgi_url}/page.cgi?p=$page">[&lt;&lt;]</a> ~);
($nh > 1) and ($url .= qq~<a href="$CFG->{db_cgi_url}/page.cgi?p=$page&nh=$prev_hit">[&lt;]</a> ~);
for ($i = 1; $i <= int($numhits/$maxhits) + 1; $i++) {
if ($i < $lower) { $url .= " ... "; $i = ($lower-1); next; }
if ($i > $upper) { $url .= " ... "; last; }
($i == $nh) ? ($url .= qq~$i ~) : ($url .= qq~<a href="$CFG->{db_cgi_url}/page.cgi?p=$page&nh=$i">$i</a> ~);
if ($i * $maxhits == $numhits) { $nh == $i and $next_hit = $i; last; }
}
$url .= qq~<a href="$CFG->{db_cgi_url}/page.cgi?p=$page&nh=$next_hit">[&gt;]</a> ~ unless ($next_hit == $nh or ($nh * $maxhits > $numhits));
$url .= qq~<a href="$CFG->{db_cgi_url}/page.cgi?p=$page&nh=$max_page">[&gt;&gt;]</a> ~ unless ($next_hit == $nh or ($nh * $maxhits > $numhits));
return $url;
}
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory

Last edited by:

katabd: Apr 5, 2005, 10:34 PM
> >