Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Featured Site mod help

Quote Reply
Featured Site mod help
Hi,

I'm thinking of adding a subroutine to make Links SQL automate the maintenance of my "Featured Site" page. Previously, I was entering sites that link back to my site in a text file -- one link per line -- which would then randomly be selected by a cgi script and included in the HTML page. When upgrading to Links SQL, I realized that my method of using the jump.cgi link was a problem, as the Links SQL import compresses the link numbering... I went through and changed them to their actual URL's for the time being.

What I would like to do is add a field to the database, isFeatured. This would default to No and could be flagged as Yes, if appropriate. A subroutine would then be added to nph-build.cgi, which would assemble the text file mentioned above. Here's where I could use some help, as I don't think my Perl/SQL skills are quite up to putting it together.

I believe the shell of the sub would look like this:
Code:
if ($isFeatured == "Yes") {
$OUT = "<a target=\"_blank\" href=\"<%db_cgi_url%>/jump.cgi?ID=<%ID%>\"><%Title%></a> <%Description%><BR><BR>";
}

$file = "/path/to/featured.txt";
open (FEATURED, $file) or die "Can't open $file Reason: $!";
print FEATURED (\%OUT);
close FEATURED;
Do <%ID%>, <%Title%>, and <%Description%> need to be declared for this to work, and do quotes need to be escaped? Am I even on the right track as to how to write to the file? Also, I'm sure more needs to be done in terms of checking the isFeatured field.

Any help would be greatly appreciated in getting me started. Also, if you can think of better ways I should be approaching this, I am open to suggestions.

Thanks,
Dan

------------------
Run-Down -> Links SQL
http://run-down.com/
Subject Author Views Date
Thread Featured Site mod help Dan Kaplan 8022 Mar 13, 2000, 11:52 AM
Post Re: Featured Site mod help
phoule 7856 Mar 13, 2000, 1:38 PM
Post Re: Featured Site mod help
Dan Kaplan 7855 Mar 13, 2000, 4:39 PM
Post Re: Featured Site mod help
pugdog 7858 Mar 13, 2000, 5:26 PM
Post Re: Featured Site mod help
phoule 7853 Mar 13, 2000, 5:40 PM
Post Re: Featured Site mod help
Dan Kaplan 7859 Mar 13, 2000, 6:57 PM
Post Re: Featured Site mod help
pugdog 7895 Mar 13, 2000, 7:22 PM
Post Re: Featured Site mod help
phoule 7849 Mar 13, 2000, 7:34 PM
Post Re: Featured Site mod help
Dan Kaplan 7866 Mar 13, 2000, 7:52 PM
Post Re: Featured Site mod help
phoule 7850 Mar 13, 2000, 8:27 PM
Post Re: Featured Site mod help
phoule 7876 Mar 14, 2000, 3:39 AM
Post Re: Featured Site mod help
Dan Kaplan 7858 Mar 14, 2000, 3:49 AM
Post Re: Featured Site mod help
phoule 7855 Mar 14, 2000, 4:49 AM
Post Re: Featured Site mod help
Dan Kaplan 7852 Mar 14, 2000, 6:33 AM
Post Re: Featured Site mod help
Dan Kaplan 7861 Mar 14, 2000, 8:43 AM
Post Re: Featured Site mod help
Dan Kaplan 7855 Mar 14, 2000, 9:08 AM
Post Re: Featured Site mod help
phoule 7852 Mar 15, 2000, 3:41 AM
Post Re: Featured Site mod help
Dan Kaplan 7857 Mar 15, 2000, 7:19 AM
Post Re: Featured Site mod help
phoule 7857 Mar 15, 2000, 8:18 AM
Post Re: Featured Site mod help
Dan Kaplan 7868 Mar 15, 2000, 8:18 PM
Post Re: Featured Site mod help
Dan Kaplan 7858 Mar 16, 2000, 7:37 PM
Post Re: Featured Site mod help
pugdog 7861 Mar 16, 2000, 8:54 PM
Post Re: Featured Site mod help
Dan Kaplan 7866 Mar 16, 2000, 9:05 PM
Post Re: Featured Site mod help
Dan Kaplan 7865 Mar 17, 2000, 8:04 AM
Post Re: Featured Site mod help
pugdog 7845 Mar 17, 2000, 8:34 AM
Post Re: Featured Site mod help
pugdog 1367 Mar 17, 2000, 6:21 PM
Post Re: Featured Site mod help
Dan Kaplan 1367 Mar 18, 2000, 7:14 PM