Gossamer Forum
Home : Products : Links 2.0 : Customization :

jump.cgi and deleted/unknown IDs

Quote Reply
jump.cgi and deleted/unknown IDs
Hello

I've tryed calling jump.cgi?ID=43245 which doesn't exist in the database, but for some reason my browser tries to download jump.cgi. Is it possible to modify jump.cgi to give an errormessage (like the search-error) every time someone tries to jump to a link which doesn't exist?

------------------
Ronny Salomonsen <rsalomon@online.no>
Feline Medias

Quote Reply
Re: jump.cgi and deleted/unknown IDs In reply to
Yea...change all the &error references to something like &site_html_jump_error, and also add and exit; after the (""); codes, like the following:

Code:
&site_html_jump_error ("Record ID $id not Found") and exit;

Then create a new sub-routine in the site_html_templates.pl file that is called sub site_html_jump_error. This can be an exact copy of the sub site_html_search_failure routine. Except you will need to load a new template file called jump_error.html

Then create a new template file called jump_error.html. Remember to change its permissions to 666 and put it in your template directory. Edit the codes in this file to include the <%error%> tag.

Hope this helps...

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. Smile
----------------------











[This message has been edited by Eliot (edited February 12, 2000).]
Quote Reply
Re: jump.cgi and deleted/unknown IDs In reply to
Thanks Eliot -
However, I did exactly as you said, and once I changeed
Code:
&error ("Can't find link id: $id");
to
Code:
&site_html_jump_error ("Record ID $id not Found") and exit;
in jump.pl, I get the following error:
Code:
Error Message : fatal error: Undefined subroutine &main::site_html_jump_error called at D:\my server location\jump.pl line 92.

I created the sub site_html_jump_error right under the sub site_html_search_failure in site_html_templates.pl and I have a jump_error.html template in place.

What am I missing?
Quote Reply
Re: jump.cgi and deleted/unknown IDs In reply to
It doesn't work because initially jump.cgi doesn't require site_html_templates.pl

add this
Code:
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";

under
require "$db_lib_path/links.def";

------------------
LookHard Search
lookhard.hypermart.net
Lavon Russell