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

MOD: Add Resource only to specific categories

Quote Reply
MOD: Add Resource only to specific categories
I've come up with the following to restrict the categories people can submit to;

First add a new field to your category table:

Column: isSub
Type: CHAR
Form Length: 3
Max Length: 3
Not Null: YES
Default Value: YES (people can submit as default)
Validation: YES|NO
Index Weight: 0

Next update nph-build.cgi at # Get the category info. and at the end of the $OUT list add the following: $OUT{isSub} = $category_r->{'isSub'};

Now in your category template/footer change the Add Resource link to the following:

<%if isSub eq 'Yes'%>
<a href="<%db_cgi_url%>/add.cgi?ID=<%category_id%>">Add Resource</a>
<%endif%>

To turn OFF submissions, simply add/edit a category and change isSub to NO.

Make sure at least one category has 'isSub' changed to YES, then re-build your directory to effect the changes.

Update Sept 2000
-----------------
Have been informed that this mod doesn't work if you're using page.cgi and displaying links 'on the fly' as the mod requires the 'Suggest/Submit' link is hard-coded into a generated static HTML page.

If anyone mod's it to work with page.cgi let me know :)


All the best
Shaun
Subject Author Views Date
Thread MOD: Add Resource only to specific categories qango 1655 Jul 7, 2000, 5:02 AM
Post Re: MOD: Add Resource only to specific categories
Robert 1549 Nov 25, 2000, 10:32 PM