Gossamer Forum
Home : Products : Links 2.0 : Customization :

How to add new links to front page?

(Page 2 of 2)
> >
Quote Reply
Re: How to add new links to front page? In reply to
Gotze;
Wow, you're super. Thats' all I want. You're good. Man, I have to say this aloud to everybody..hahaha.

I looked into the site that you gave me http://www.gotzespace.dk/books/linksmod/

But this is exactly look like th last link that I looked before. So when I use this do I need to use Alex's code up there. I still don't get it. Let's say I am dump. But please provide me more details (step and step)

Thanks to you a lot.
Quote Reply
Re: How to add new links to front page? In reply to
OK, the LastLink release 1.99 as I call it is using Alex' code with oldmoney's twist to make the order reverse. The instruction are similar to the old LastLink, but not the same. The link I gave you is correct and updated. In there, I give as good instructions as I can. Note that the lastlink.txt includes the instructions.
Quote Reply
Re: How to add new links to front page? In reply to
Thanks God. I got it run well just like what I wanted. Thanks to you all.
Quote Reply
Re: How to add new links to front page? In reply to
Thanks Gotze;
Yes. I got it run well with no errors. However, I just have a thought that can we just put the title and the aded date in the front page instead of everything like a normal link?I want to put just th title and added date different from the normal link. So it will cut short a little bit.
Quote Reply
Re: How to add new links to front page? In reply to
Tim, see my instructions above for creating a home_link template...
Quote Reply
Re: How to add new links to front page? In reply to
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.
Quote Reply
Re: How to add new links to front page? In reply to
I would first try and steal from Widgetz' early code for LatsLink 1.0, and set LastLink 1.99 to something like:
Quote:
$lastlink .= qq~$tmp{'Title'} - $tmp{'Date'}<p>\n~;
instead of
Quote:
$lastlink .= &site_html_link (%tmp);
Quote Reply
Re: How to add new links to front page? In reply to
Bad Post

[This message has been edited by Gian (edited October 09, 1999).]
Quote Reply
Re: How to add new links to front page? In reply to
Yeb.. It's grest... But, $tmp{'Title'} is too long. Its size is maybe max. 75. How i can limit showing title as 30 size without chane links.def and links.db. in front page. Is it possiable ?

------------------
Kusi
kisantrading.co.kr/kusi
kusi@kisantrading.co.kr
> >