Gossamer Forum
Home : Products : Links 2.0 : Customization :

XX new links on a single file (instead of split over multiple days pages) ?

Quote Reply
XX new links on a single file (instead of split over multiple days pages) ?
Hello,

is there any way to have the latest XX newest added links built on a single file (or something similar ) ?


Thanks,
Brakkar
Quote Reply
Re: [brakkar] XX new links on a single file (instead of split over multiple days pages) ? In reply to
not sure if this is what you are looking for but

http://www.gossamer-threads.com/..._string=topx;#168184


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] XX new links on a single file (instead of split over multiple days pages) ? In reply to
Thanks for your answer.

Actually, I would prefer something that builds a file.

Cordially,
Brakkar
Quote Reply
Re: [brakkar] XX new links on a single file (instead of split over multiple days pages) ? In reply to
by file do you mean like the links.db file?

Or and actual html page?


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] XX new links on a single file (instead of split over multiple days pages) ? In reply to
I mean an html file yes.
Quote Reply
Re: [brakkar] XX new links on a single file (instead of split over multiple days pages) ? In reply to
well, there is a links tree MOD in the Resources section of the Support section. I have never used it but, I might work.

or do something like

Code:
<html>
<head>
<title> new document </title>
</head>
<body>
<table>
<tr>
<td width=15 align=right valign=top>Line#</td>
<td width=100 valign=top>Link</td>
<td width=100 valign=top>City</td>
<td width=100 valign=top>Category</td>
<td width=100 valign=top>Email</td>
<td width=100 valign=top>Phone</td>
<td width=400 valign=top>Desc</td></tr>
<!--#exec cgi="/cgi-bin/links/list.cgi"-->
</table>
</body>
</html>


copy topx.cgi to list.cgi

Change the line: my @data = `tail -999 $db_links_name`;

I used -999

and do something like the following to the foreach section

Code:
foreach (@data) {
$i++;
chomp;
split /\|/;
$_[$db_desc] =~ s,``,<br>,g;
$_[$db_category] =~ s,_,&nbsp;,g;
($cat, $rest)= split(/\//,$_[$db_category]);
print qq|<tr>
<td width=15 align=right valign=top>$i.</td>
<td><a href="http://www.yoursite.com/cgi-bin/links/jump.cgi?id=$_[$db_key]">$_[$db_title]</a></td>
<td>$_[$db_city]&nbsp;</td>
<td>$rest&nbsp;$cat&nbsp;</td>
<td>$_[$db_contact_email]&nbsp;<a href="mailto:$_[$db_contact_email]">Email</a></td>
<td>$_[$db_phone]&nbsp;</td>
<td>$_[$db_desc]</td></tr>|;

}


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."

Last edited by:

esm: May 3, 2003, 5:33 AM
Quote Reply
Re: [brakkar] XX new links on a single file (instead of split over multiple days pages) ? In reply to
gene your suggestion is great, I was wondering how would I go about listing the resources in reverse order, in other word the newest listings first?



Second question: is it also posible to sort by field such as by the number of hits etc?
Quote Reply
Re: [snookie] XX new links on a single file (instead of split over multiple days pages) ? In reply to
it could be done in perl but I never tried that way.

I used a javascript to sort the table - I actually had to strip it out of the msg before I posted it. See it here

http://www.geocities.com/...cript/sorttable.html


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."