Gossamer Forum
Home : Products : Links 2.0 : Customization :

Outputing actual url's to templates?

Quote Reply
Outputing actual url's to templates?
Can anyone help?

Basically what I would like to do is create a new set of pages derived from templates with just a total listing of the actual hyperlinks for sites stored in the database.
Something along the lines of <a href="url">Name of Url</a>, one per line or somesuch.
I understand how to do some of it but I'm no use with perl.

Thanks.

Quote Reply
Re: Outputing actual url's to templates? In reply to
Perhaps you could hack the Tree Mod in the Resources Center.

Smile

Quote Reply
Re: Outputing actual url's to templates? In reply to
and search the forum and resources section more carefully next time, PLEASE!

Regards,

Eliot Lee
Quote Reply
Re: Outputing actual url's to templates? In reply to
Thanks for the suggestion but its only really half way there.

I just need to output a single page of just the url's, or possibly spanning pages. And not using jump.cgi but the actual url's held in the database. I cannot suss out how to output the actual url's at all.

I did search the forums using all the terms I could think of but didnt turn up anything I could see was a match.

Thanks.

Quote Reply
Re: Outputing actual url's to templates? In reply to
quit whining Smile...
Code:
#!/usr/bin/perl
require '/absolute/path/to/links.cfg/';
require "$db_lib_path/links.def";
require "$db_lib_path/db_utils";
print header();
print start_html();
open (DB, $db_file_name);
while (<DB>) {
chomp;
my @values = split /$db_delim/;
my $url = $values[$db_url];
print qq|<li><a href="$url">$url</a>|;
}
close (DB);
print end_html();
If you want page spanning, read about SEEK and/or SLICE in the perldocs.

And if you want to see the URL in your link.html template, then use (of all things), <%URL%>.

--Drew
Free, hot camel soup for Links hackers...
http://www.camelsoup.com