Give this a go; (untested!)
my $current_catid = $_[0] || 0;
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('CatLinks','Links');
$search_db->select_options ('ORDER BY ID DESC Limit 5');
my $sth;
if ($current_catid > 0) {
$sth = $search_db->select ( { CategoryID => $current_catid }, { isNew => 'Yes', isValidated => 'Yes' });
} else {
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
}
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
Call with;
...in category.html
Hope that works
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!
Code:
sub { my $current_catid = $_[0] || 0;
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('CatLinks','Links');
$search_db->select_options ('ORDER BY ID DESC Limit 5');
my $sth;
if ($current_catid > 0) {
$sth = $search_db->select ( { CategoryID => $current_catid }, { isNew => 'Yes', isValidated => 'Yes' });
} else {
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes' });
}
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}
Call with;
Code:
<%global_name($ID)%>...in category.html
Hope that works
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!