Gossamer Forum
Home : Products : Links 2.0 : Customization :

Cool Links without sex links - how ?

Quote Reply
Cool Links without sex links - how ?
Hi everybody,

I've searched for 30 minutes to find a resource or a thread about 'how to display the Cool Links page without sex links'. Is it possible ?
I ask that because I want to insert my Cool links in my homepage, and I don't want to show any sex link in it.

:-) Thank you for your help !

Regards,
Gautier.

Quote Reply
Re: Cool Links without sex links - how ? In reply to
Yep think it'll be quite easy to do. I'll take a quick look.

Glenn

Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: Cool Links without sex links - how ? In reply to

You could do it this way and bloack links which contain the word 'sex' for instance.

Go into nph-build.cgi and find the sub build stats

under:


my $staggered_mode = shift || undef;

Add where filter are the words you want to stop links containing. and fields are the title and description you want to check thru. Can add more such as 2 for url

@filter = ('sex');
@filter_fields = (1, 5);


find:


# Add the link to the list of cool links if it is popular.
push (@{$cool_links{$category}}, @values) if ($values[$db_ispop] eq "Yes");

replace it with:

my $add = 0;
FILTER: foreach $field (@filter_fields) {
$_ = $values[$field];
foreach $one (@filter) {
last FILTER if (m/$one/i) and ($add++);
}
}
if ($add < 1){
# Add the link to the list of cool links if it is popular.
push (@{$cool_links{$category}}, @values) if ($values[$db_ispop] eq "Yes");
}


You could do the same if you want to block ones being added to the new page also like putting the code to add the new links inside the loop also:



my $add = 0;
FILTER: foreach $field (@filter_fields) {
$_ = $values[$field];
foreach $one (@filter) {
last FILTER if (m/$one/i) and ($add++);
}
}
if ($add < 1){
# Add the link to the list of new links if it is new.
push (@{$new_links{$category}}, @values) if ($values[$db_isnew] eq "Yes");

# Add the link to the list of cool links if it is popular.
push (@{$cool_links{$category}}, @values) if ($values[$db_ispop] eq "Yes");
}













Glenn

Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: Cool Links without sex links - how ? In reply to
Or for better control over "sex" related links that do NOT have sex in their domain name, you could simply do the following:

1) Add a field called isSexLink. (To do this follow instructions for adding isLinked and isDetailed fields. Instructions provided in the MOD links in the Resources section. This field should be a binary YES/NO field.)

2) After adding the field successfully, select Yes for all the sex links in your directory.

3) Then in the build_update_newpop subroutine in the nph-build.cgi script, change the following codes:

Code:

if ($values[$db_hits] >= $cutoff) {
print "\tUpdating record: $id, marking as popular ($values[$db_hits]).\n";
$values[$db_ispop] = "Yes";
}
else {
$values[$db_ispop] = "No";
}


to the following codes:

Code:

if (($values[$db_hits] >= $cutoff) and ($values[$db_issexlink eq "No")) {
print "\tUpdating record: $id, marking as popular ($values[$db_hits]).\n";
$values[$db_ispop] = "Yes";
}
else {
$values[$db_ispop] = "No";
}


Probably more codes need to be hacked, but this is more reliable than what Glennu recommended.

Regards,

Eliot Lee
Quote Reply
Re: Cool Links without sex links - how ? In reply to
That's true if they don't have sex etc.. in their description, title etc.. One other suggestion would be to alter the codes very slightly above so that all links in a particular category are banned. I guess some sites have one or more categories which are for sites with adult content, then they could ban links from just these categories.

Glenn

Links 2 Mods Site:
http://cgi-resource.co.uk/pages/links2mods.shtml
Quote Reply
Re: [glennu] Cool Links without sex links - how ? In reply to
Add where filter are the words you want to stop links containing. and fields are the title and description you want to check thru. Can add more such as 2 for url

@filter = ('sex');
@filter_fields = (1, 5);


find:



Is there an easy way to do this mod to check against a flat file for the banned words? I am trying to implement the same thing to check URL, Title, and a Keywords field for a fairly long list (@100 words) of banned words, which will from time to time be updated.

Thanks in advance,

Charlie