Gossamer Forum
Home : Products : Gossamer Links : Discussions :

show less pages in results

Quote Reply
show less pages in results
Hi,

if a user searches for a term that has lots of results Links SQL displays at the top Pages 1 2 3 4 5...... [>>]

Can I restrict this to just going up to 8 as anything above this goes onto a new line which mucks up my formatting, ideally it would stop at 8 and not what looks to be a default 15

i.e Pages 1 2 3 4 5 6 7 8 [>>]

Cheers
KevM
Quote Reply
Re: [KevM] show less pages in results In reply to
I don't think there is an option to do this. You would need to edit the .pm file which handles this (think its in /admin/Links/Build.pm). If I remember though, its a pretty 'busy' routine, so its hard to find what you are looking for,unless you really know what you are doing Frown

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] show less pages in results In reply to
your're right, it looks a bit hairy so I'll just code around it

rgds

Cheers
KevM
Quote Reply
Re: [Andy] show less pages in results In reply to
You don't want to make changes in Build.pm, because then that affects everything that might use the span routine. The relevant code for the search bar is in Links::User::Search, in sub query.

Code:
# Generate a toolbar if requested.
my $toolbar;
if (($link_count > $args->{mh}) or ($cat_count > $args->{mh})) {
my $url = $IN->url ( { query_string => 1 } );
$url =~ s/([;&?]?)nh=(\d+)/($1 and $1 eq '?') ? '?' : ''/eg;
$toolbar = Links::Build::build ('search_toolbar', {
url => $url,
numlinks => $link_count > $cat_count ? $link_count : $cat_count,
nh => $args->{nh},
mh => $args->{mh}
});
}
else {
$toolbar = '';
}

basicly, you'd want $link_count to max out at $args->{mh} * 8... ie,

Code:
if ($link_count > $args->{mh} * 8) {
$link_count = $args->{mh} * 8;
}

untested... but I don't see why it wouldn't work.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [KevM] show less pages in results In reply to
You could just use your own span global - then you wouldn't have to edit the core code. Here's an example that would need a bit of modification to work on the search pages:

http://www.gossamer-threads.com/...i?post=249350#249350
Quote Reply
Re: [afinlr] show less pages in results In reply to
Thanks Fuzzy/Afinlr,

Thats given me 2 options to play around with, I'm a bit more inclined towards the Fuzzy solution as it looks a bit easier to implement (I'm easily out of my depth you see) but will let you know how I get on.

many thanks

Cheers
KevM