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?
Jun 11, 2005, 2:12 AM
Veteran / Moderator (18436 posts)
Jun 11, 2005, 2:12 AM
Post #7 of 11
Views: 3309
Hi,
Can you post the global? Some of them are less effecient that others
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!
Can you post the global? Some of them are less effecient that others

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!
Jun 11, 2005, 5:19 AM
Novice (6 posts)
Jun 11, 2005, 5:19 AM
Post #8 of 11
Views: 3331
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;
}
Jun 11, 2005, 5:29 AM
Veteran / Moderator (18436 posts)
Jun 11, 2005, 5:29 AM
Post #9 of 11
Views: 3299
Hi,
Try this
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
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!
Try this

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

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!
Jun 11, 2005, 9:07 AM
Veteran / Moderator (18436 posts)
Jun 11, 2005, 9:07 AM
Post #11 of 11
Views: 3313
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!
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!