Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [hegu] Help needed with different form for different category: Edit Log

Here is the list of edits for this post
Re: [hegu] Help needed with different form for different category
This is because on main page, will not pass category ID number to add.cgi.

Try this code:
Code:
sub {
my $catid_current = shift;
my $catid_check = shift;
return 0 if $catid_current =~ /^\d$/;
return 0 if $catid_check =~ /^\d$/;
return 1 if $catid_check eq $catid_current;
my @children = $DB->table('Category')->children($catid_check);
foreach (@children) {
return 1 if $_ eq $catid_current;
}
}
EDIT: further checking added, to allow only numbers, as ID.

This will ignore the situation, when you are clicking add.cgi in home.html or no ID is passed.
Also I changed to avoid second input parameter to be 0, since it's the root category.

Hope that helps.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: May 8, 2003, 9:47 AM

Edit Log: