Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Add only to current category

Quote Reply
Add only to current category
Hi:

I know there was a mod for this in 2.0, but I can't find anything in SQL- is there anyone who may know how to only allow an add to the CURRENT category?

Thanks Bunches!

Dave
Quote Reply
Re: Add only to current category In reply to
If you turn db_gen_category_list on, this has the side effect you are looking for. What that option does is stop making drop down lists for category (as it assumes you have so many categories to make it impractical). It also requires people to go to the category they want to add to before clicking on Add.

Cheers,

Alex
Quote Reply
Re: Add only to current category In reply to
Alex!

Thanks- that one was easy!

Dave
Quote Reply
Re: Add only to current category In reply to
No, the submission services never view the add form, they just submit directly to the add.cgi script, bypassing the check.

Cheers,

Alex
Quote Reply
Re: Add only to current category In reply to
Hello!

Quote:
It also requires people to go to the category they want to add to before clicking on Add.
Alex, this also means that submission services will not be able to submit the forms from their servers. Correct?
Quote Reply
Re: Add only to current category In reply to
Alex!

You confused me further.

But how will they grab the category listings from the table within the form that add.cgi generates? This listing is generated only when add.cgi is executed.

May be they would copy all of it once!

Quote Reply
Re: Add only to current category In reply to
Has someone anwser this till now?
How should links able to know in which cat the user is, when the call is .../add.cgi???

Cause i dont understand this, i have dropped this function till yet. But in a couple of weeks i think my cat-list would be to big to show!

Robert
Quote Reply
Re: Add only to current category In reply to
You should do this in your category.html template:

<a href="<%db_cgi_url%>/add.cgi?ID=<%category_id%>">Add</a>

and similiar for modify. See the header.txt that comes with Links SQL regular tempaltes for an example.

Cheers,

Alex
Quote Reply
Re: Add only to current category In reply to
how to turn db_gen_category_list on?
I am beginner.
Quote Reply
Re: Add only to current category In reply to
Ok,

I've turn on the db_category_gen_list but when i click the add resouce link, it comes to an error, said :

Quote:
Oops, we had the following problem:

Please go to the category you want to add to, and click add from there.

FYI : I've already go to the category i want to add.

and Alex,

I also try to add a resource to your LinkSQL demo site, but it comes to an error just like mine.


Quote Reply
Re: Add only to current category In reply to
Infoshares - it's in Links.pm under build options.
Quote Reply
Re: Add only to current category In reply to
Now I have a problem. When I add links in admin, how do I know what the category ID is? ...short of going through and manually writing down the # & name of over 200 categories, what can I do??
Quote Reply
Re: Add only to current category In reply to
Make sure you make your link to add.cgi like it is in header.txt in the templates that come with Links SQL. That will pass in the ID number to add and modify.

Cheers,

Alex
Quote Reply
Re: Add only to current category In reply to
I have the links set up, and don't have a problem with the add page showing the current category for the users.

However, in the admin, if I want to add a new link myself, I now have to know the category ID. I was wondering if there is a way to list of all of my 230 categories & ID #s so I can print it out for reference when adding new links. I would like to avoid viewing categories page by page and recording ID #s for each by hand.

I do not want users to view the categories, so I can't turn the drop down box back on unless there is a way to only have them on in admin.
Quote Reply
Re: Add only to current category In reply to
If you are using version 1.1+ then you can enter in the Category Name, you don't need to remember the ID.

Cheers,

Alex
Quote Reply
Re: Add only to current category In reply to
Having to type out the whole category/subcat/subcat/subcat name will also be a pain.

I am assuming there is no easy way to get around this problem

Thanks for your input,
Amanda
Quote Reply
Re: Add only to current category In reply to
You could try this in Links.pm, replace the db_gen_category_list option with:

if ($ENV{REMOTE_USER}) {
$LINKS{db_gen_category_list} = 1;
}
else {
$LINKS{db_gen_category_list} = 0;
}

which means when called from within the admin, it will set it to 1 (because it's under a password protected area), but when called from the user, it will be set to 0. This wouldn't work within a mod_perl environment, but should be fine under normal cgi.

Cheers,

Alex
Quote Reply
Re: Add only to current category In reply to
This is exactly what I need... Thanks! It works great.

Amanda