OldMoney;
Thanks for your help. I see what it does now. However I got a little confused here. Can you explaine for me. Because when I built it again, in the front page I got the same format of the link.html (with added dated, description and more) It does not look like the home_link.html.
here is where I got confused:
Quote:
3. copy your site_html_link subroutine in site_html_template.pl, rename it
site_html_home_link, and change the line that loads the template to
code:
return &load_template ('home_link.html', {
Do you mean that I have to create another site_html_template.pl or just copy the sub site_html_link and paste if right below it and change the name to sub site_html_home_link?
Here is what I have in my site_html_template.pl:
Quote:
sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
my %rec = @_;
my $days_old = &days_old($rec{'Date'});
my $new_img = "";
# Set new and pop to either 1 or 0 for templates.
if ($days_old <= 2) { $new_img = $new_1; }
elsif ($days_old <= 7) { $new_img = $new_3; }
elsif ($days_old <= 14) { $new_img = $new_7; }
else { (delete $rec{'isNew'}); }
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('link.html', {
new_img => $new_img,
detailed_url => "$build_detail_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
sub site_html_home_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
my %rec = @_;
my $days_old = &days_old($rec{'Date'});
my $new_img = "";
# Set new and pop to either 1 or 0 for templates.
if ($days_old <= 2) { $new_img = $new_1; }
elsif ($days_old <= 7) { $new_img = $new_3; }
elsif ($days_old <= 14) { $new_img = $new_7; }
else { (delete $rec{'isNew'}); }
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('home_link.html', {
new_img => $new_img,
detailed_url => "$build_detail_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
Please help me.