Hi
If I understand your question correctly you will need to :
1- create a new link1.html file and place it in your template folder.
2- modify it the way you which your links to appear.
3- create a global New5:
sub {
# Displays the featured 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 ( { isNew => 'Yes'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}
4- in your SiteHtml.pm add the following sub:
sub site_html_link1 {
# --------------------------------------------------------
# Format a New link.
#
my $rec = shift;
# Convert the date formats.
if ($CFG->{date_db_format} ne $CFG->{date_user_format}) {
Links::init_date();
$rec->{Add_Date} = GT::Date::date_transform ($rec->{Add_Date}, $CFG->{date_db_format}, $CFG->{date_user_format});
$rec->{Mod_Date} = GT::Date::date_transform ($rec->{Mod_Date}, $CFG->{date_db_format}, $CFG->{date_user_format});
}
# Set new and pop to either 1 or undef for templates.
(defined $rec->{'isNew'} and ($rec->{'isNew'} eq 'Yes')) ? ($rec->{'isNew'} = 1) : ($rec->{'isNew'} = 0);
(defined $rec->{'isChanged'} and ($rec->{'isChanged'} eq 'Yes')) ? ($rec->{'isChanged'} = 1) : ($rec->{'isChanged'} = 0);
(defined $rec->{'isPopular'} and ($rec->{'isPopular'} eq 'Yes')) ? ($rec->{'isPopular'} = 1) : ($rec->{'isPopular'} = 0);
(defined $Links::USER->{Username} and ($rec->{'LinkOwner'} eq $Links::USER->{Username})) ?
($rec->{'isLinkOwner'} = 1) : ($rec->{'isLinkOwner'} = 0);
# Set the detailed_url.
$rec->{detailed_url} = "$CFG->{build_detail_url}/${$rec}{'ID'}$CFG->{build_extension}";
# Parse the template.
my $output = Links::load_template ('link1.html', $rec, 0);
return $output;
}
Just pass <%New5%> anywhere you want it
and that should do it
Regards
Abd
http://www.idleb.com