Gossamer Forum
Quote Reply
add.cgi
Hi

I do not want the category list built if people try to add Site from the home page...the category list is too long.

So I want it to give a message saying please goto the relevant category first and then Add Site.

I have had a look in the add.cgi and there is this section:

# If we don't have an id, and can't generate a list, let's send the user a message.
if (! $id and ! $LINKS{db_gen_category_list}) {
&site_html_error ( { error => "Please go to the category you want to add to, and click add from there." }, $dynamic);

How can I make sure there is not an ID here so it always sends this message to the user?

Or is there another way?

Many Thanks

Tony
Quote Reply
Re: add.cgi In reply to
Well, without looking at the rest of the code, the easiest way is to simply ensure the test is ALWAYS true....

The easiest way would be to only check if the ID existed.

if (!$id)

That means the if the $id was blank, you'd enter the test, and be sent the message, whether the gen_cat_list was on or not.

If you had an ID, ie $id was not null or 0, you'd skip the jump to the error message.

Is that what you mean?
Quote Reply
Re: add.cgi In reply to
Did this work? Or did you figure something else out?