Gossamer Forum
Home : Products : Links 2.0 : Customization :

BLOCK URL MOD 404 Where is it?

Quote Reply
BLOCK URL MOD 404 Where is it?
I am trying to find the Block Mod URL, I've done a lot of searching, and found links to the Block Mod that was here:http://lookhard.hypermart.net/...-mods/blockurls.html but that URL is 404. I tried this one:

http://www.gossamer-threads.com/...g=block%20url;#26202

But I couldn't get it to work, I added it in the add.cgi right before the #update counter and put a link to the lockout.txt file and added some words, but it blocked everything.

Sorry, I really did search alot before I posted it, and everything I found seemed to be old posts that the URL's were 404.

My first post, I appreciate the help.
Quote Reply
Re: [ShooterGirl] BLOCK URL MOD 404 Where is it? In reply to
    

Ah, you're in luck, I have it on disk! I have not used it, so can offer no advice.


First, In your admin directory, make a blockurls.txt file. Make sure its readable.

Put this in it : @blockurl = ('yahoo.com', 'netscape.com','macromedia.com');

Change the urls to what you want, or add more in the format you see ,'url','etc . Make sure it ends with a ' though like macromedia.com does.


Then in add.cgi, in the require part:

require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";

put this under require "$db_lib_path/site_html.pl";

require "$db_lib_path/blockurl.txt"

that works for the array later on.
Now lower under

# Validate the form input..
$status = &validate_record(%in);

but before

if ($status eq "ok") {
put :

$domain = $in{'URL'};
foreach $url (@blockurl) {
if ($in{'URL'} =~ /$url/i) {
&site_html_add_failure (qq|Url <a href="$domain">$url</a> is restricted from addition|);
return;
}

}


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Aug 30, 2004, 1:35 PM
Quote Reply
Re: [PerlFlunkie] BLOCK URL MOD 404 Where is it? In reply to
It works great! Tried adding a domain that I blocked, and it stopped it. Added a good url, and went through fine. :) Thanks alot. Now I just have to track all the domains I need to block and add them.

In the @blockurl = ('yahoo.com', 'hotmail.com',' thirddomain.com');

if this gets long and spans several lines, will it still work? I'm guessing yes.