Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Problem with detailed pages

Quote Reply
Problem with detailed pages
When I'm buildning my detailed pages around 2k pages it stops when it only has built 500 pages. But this only happens when I use a global i call <%newlinks%> on my pages. Does that cause too much server load? How can I solve this?
Quote Reply
Re: [Raazo] Problem with detailed pages In reply to
Hard to say, what's that global do? Does your server have ulimits set?

Adrian
Quote Reply
Re: [brewt] Problem with detailed pages In reply to
In Reply To:
Hard to say, what's that global do? Does your server have ulimits set?

The global shows the newest links added, the more new links i want to show the less pages links SQL builds. So pretty sure it has to do with some server overload. But howto solve it?
Quote Reply
Re: [Raazo] Problem with detailed pages In reply to
Anyone? This is quite a problem for me :(
Quote Reply
Re: [Raazo] Problem with detailed pages In reply to
Try running it from shell, so you can see how it's dying.

Adrian
Quote Reply
Re: [brewt] Problem with detailed pages In reply to
Don't have telnet access on my server :(
Quote Reply
Re: [Raazo] Problem with detailed pages In reply to
Hi,

Can you post the global? Some of them are less effecient that others 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] Problem with detailed pages In reply to
In Reply To:
Hi,

Can you post the global? Some of them are less effecient that others Frown

Cheers

This is the global im using:

Code:
sub {
# Displays the Newest links.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ADD_DATE DESC Limit 8');
$sth = $search_db->select ( { isNew => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
Quote Reply
Re: [Raazo] Problem with detailed pages In reply to
Hi,

Try this Smile

Code:
sub {
my $max = $_[0] || 2;
my $id = $DB->table('CatLinks')->select( 'MAX(LinkID)' )->fetchrow;
my @links;
while (1) {
my $rand = int (rand() * $id);
my $link = $DB->table('Links')->get($rand);
push @links, $rand if $rand;
last if (@links >= $max);
}
return { rand_links_loop => \@links }
}

..and call with;

<%global_name(NUMBER_OF_LINKS_TO_GET)%>

..i.e to grab 5;[/code]<%global_name('5')%>
<%loop rand_links_loop%>
<%include link.html%><br/>
<%endloop%>[/code]
Hope that helps Smile

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!

Last edited by:

Andy: Jun 11, 2005, 9:06 AM
Quote Reply
Re: [Andy] Problem with detailed pages In reply to
Sorry, but it doesn't seem to work for me, it's not displaying any links :(
Quote Reply
Re: [Raazo] Problem with detailed pages In reply to
Sorry, this line;

my $id = $DB->table('CatLinks')->select(['MAX(LinkID)'])->fetchrow;

should be;

my $id = $DB->table('CatLinks')->select( 'MAX(LinkID)' )->fetchrow;

Hopefully that will fix it :)

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!