Gossamer Forum
Home : Products : Links 2.0 : Customization :

favourite domains get a "recommended" little icon???

Quote Reply
favourite domains get a "recommended" little icon???
Hi folks! I searched around but couldn't find a mod for this...
What I would like to do is have a list of domain names I trust (on a seaparate txt file for instance on favurl.txt) and when a link on one of those domains is submitted, I would like the script to add an extra image near that link, something with a thumbs up smiley, or a recommended gif, or something along those lines.

Here's what I think the first step would be - based on another blacklist mod I have so this might not be right at all, but hopefully I'm on the right track.
So I would add this to add.cgi (to verify if the domain is on my favourite url's list):
my $favurl = $db_lib_path . "/favurl.txt";
open (FAVURL, "< $favurl") or &cgierr("unable to open $favurl. Reason: $!");
$domain_list = join "", <FAVURL>;
@favurl = split /\s+/, $domain_list;
close FAVURL;
I guess the next step would be to test if the submission's domain is on my favourite url's list. So something like:
foreach $_ (@favurl) {
if ($in{'URL'} =~ /$_/i) {
and I'm not sure what has to happen next. I guess some varible should be set to 1 or a certain value, and then in link.html a IF condition should be included which checks whether or not that variable is 1, and if it is it will add an extra <img src=> in front of the link title...

I assume it would be fairly easy to do... so if you know how please help me out with this part, as I'm pretty clueless :)
Thank you!