Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Block adding to category

Quote Reply
Block adding to category
Discussed before, did not found anything ...

I want to block some categories for adding a record there, because user should choose a subcat of this directory.



Quote Reply
Re: Block adding to category In reply to
just an idea not sure how it work or if it does.

the best way will be to add a field to the category table, Allow _adding_links with the default set to yes.
then you can change the categories you do not want to allow addition to to NO.
It requires hacking several files in the links.

I think , may be one of the fine helpers around here will give you a better idea.


Quote Reply
Re: Block adding to category In reply to
This would be another option Alex should build into the core logic. But it may take time.

This is an extension of some of the other ideas, and "hacking" it in doesn't solve the larger problem.

In short, it would require a new field (or logic) to allow a category to have "attributes" such as "Allow Links". These attributes would be checked during the appropriate phase of link processing to see if that feature was allowed. There are more than just the "Allow Links" attribute that would be nice to have.

Hacking this stuff in weakens the over all potential for the program. Figuring out the solution that would work for most people, then actually going and doing it is the better one.

This is something that should get people involved in ideas for functionality attached to the categories.

PUGDOG® Enterprises, Inc.
Quote Reply
Re: Block adding to category In reply to

I'm not sure if this would work with 2.0 (I've got it in operation on 1.13) or if it's the solution you're looking for, but the way I 'block' submissions to certian categories is to NOT put the submission link on the category page that I want blocked.

This is how it works for me:

• Added a field to Category table called "isSub" (Yes/No) - default to Yes
• In footer.txt added the following: (You could probably add this to the category.html template instead if you like)

<%if isSub eq 'Yes'%>
<a href="<%db_cgi_url%>/add.cgi?ID=<%category_id%>">Suggest a Site</a> -
• Finally, to pass the value for the category when building the pages, edited nph-build.cgi at # Get the category info. and added this:

$OUT{isSub} = $category_r->{'isSub'};
If you don't want submissions from a particular category, edit it and change 'isSub' to "NO".

Like I said, I'm not sure if it'll work with 2.0 (I haven't had time to try 2.0 yet), but it might be worth a shot. Hope this helps.

All the best