Gossamer Forum
Home : Products : Links 2.0 : Customization :

Glenn's Affiliate Search Mod

Quote Reply
Glenn's Affiliate Search Mod
Glenn, I just recently decided to visit your site, and I'm going nuts over all of the great mods! Thank you very much! I am however having a bugger of a time with the affiliate mod where users can create a custom search for their websites. All is well, and uploaded in the correct places (I hope) but I keep getting "Internal Server Error" when using search.cgi either directly or through an affiliate search. I believe it might be a problem with search.cgi

At the bottom of sub main find:

&site_html_search_results;

Replace it with:

if ($in{'afil'} =~ /[0-9]+/) {
require "customsearch.def";
my (%rec) = &get_record ($in{'afil'});

&site_html_custom_results (%rec);

}
else {
&site_html_search_results;
}

Any tips? Thanks in advance for your time...

Quote Reply
Re: Glenn's Affiliate Search Mod In reply to
Where is customsearch.def? If that is in the /admin/ folder then it will cause an error as it is looking for it in the same place as the search.cgi script.

Not sure if that is what is the prob, but its worth a try Wink

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: Glenn's Affiliate Search Mod In reply to
Use the full path to the def file and you should also change:

if ($in{'afil'} =~ /[0-9]+/) {

to

if ($in{'afil'} =~ /^\d+$/) {




Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com

Quote Reply
Re: Glenn's Affiliate Search Mod In reply to
Thanks guys... I'll try both this weekend. I appreciate the help.

Quote Reply
No dice... In reply to
I've tried every variation of the 3 changes both of you listed with no luck...

I appreciate your help, but I'm at a loss :(

Quote Reply
Re: No dice... In reply to
do you have telnet access? If so, CD to the directory containing the script, and type:
Code:
./search.cgi
or
Code:
perl -c search.cgi
Additionally, if you have Perl error logs, please look through them and post anything related to this script.

If not, I would suggest adding this to the top of the script:
Code:
use CGI::Carp qw(:fatalsToBrowser);
These three things will definately help diagnose the program and help us find a solution.

--Drew
Links 2.0 stuff
http://www.camelsoup.com
Quote Reply
DICE! In reply to
I added:
BEGIN {open (STDERR, ">/path/to_my/cgi-bin/error.txt");

to the top of search.cgi and found that the last lines 309 & 311 were missing } somehow... I have no idea why! I do have the custom.def file in the same dir as search.cgi and in search.cgi I used the full path to .def which works fine.

Now my only problem is that in my search results I'm not getting the category names listed, just the colon. More digging fr me, but if anyone knows what I messed up this time I'll take the hint.

Thanks for everyone's help!