I've modified a couple of existing globals found in the forum and resources section to give me the Priority links by category, but I need to incorporate variations in the display.
sub {
# Displays the isPriority links per category on the category home pages.
my $id = shift;
my $db = $DB->table ('Links','CatLinks');
$db->select_options ('ORDER BY isPriority DESC', 'LIMIT 10');
my $sth = $db->select ( { isPriority => 'Yes'}, { 'CatLinks.CategoryID' => $id}, ['Links.ID', 'Links.Title', , 'Links.URL'], { isValidated => 'Yes'} );
my $premium;
while (my ($id,$name,$url) = $sth->fetchrow_array) {
$premium .= "<a href='$url'>$name</a><br>";
}
return $premium;
}
The out put / display I'm chasing is in the following global
sub {
# Displays the isPriority logo and links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ADD_DATE DESC Limit 5');
$sth = $search_db->select ( { isPriority => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link2', $link);
}
return $output;
}
So what I need to do is use the output type in the 2 nd global and incorporate it in the 1 st one.
Any pointers would be appreciated.
Regards
minesite
sub {
# Displays the isPriority links per category on the category home pages.
my $id = shift;
my $db = $DB->table ('Links','CatLinks');
$db->select_options ('ORDER BY isPriority DESC', 'LIMIT 10');
my $sth = $db->select ( { isPriority => 'Yes'}, { 'CatLinks.CategoryID' => $id}, ['Links.ID', 'Links.Title', , 'Links.URL'], { isValidated => 'Yes'} );
my $premium;
while (my ($id,$name,$url) = $sth->fetchrow_array) {
$premium .= "<a href='$url'>$name</a><br>";
}
return $premium;
}
The out put / display I'm chasing is in the following global
sub {
# Displays the isPriority logo and links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ADD_DATE DESC Limit 5');
$sth = $search_db->select ( { isPriority => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link2', $link);
}
return $output;
}
So what I need to do is use the output type in the 2 nd global and incorporate it in the 1 st one.
Any pointers would be appreciated.
Regards
minesite