Gossamer Forum
Quote Reply
Limit Category Choices
Haven't seen this one (or did I miss it?)

Example - Two Categories with subs. Cats - Dogs
Registered user is limited to submission choices, exclusive to Category they are reading / using and subs beneath.
Quote Reply
Re: [gatman] Limit Category Choices In reply to
You havn't missed it. I have a plugin called Limit_Links_Add, which will limit a username to submitting only X number of links. With some modifications, it could probably do you what are wanting. Let me get this right....each user can only submit to certain categories? Is this defined per user, or for groups of them?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Limit Category Choices In reply to
In regards to my project requirements, there are at the moment 2 categories - 1 is traditional links type data (which will replicate users required registration info - called it Company Info - reg users posts to this category once (since I am validating, I can manually block duplicates) and the other category is News and Press. Registered user is not limited by number of times he can post here , in fact it is encouraged that he post alot - but in the right root category (he can pick whatever sub he may wish)

That make sense??
Quote Reply
Re: [gatman] Limit Category Choices In reply to
Please see PM....

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Limit Category Choices In reply to
My solution (from earlier thread)



sub {
# Used For Company Info Links
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table('CatLinks');
my @sids = $db->select ( ['CategoryID'], { 'LinkID' => $id } )->fetchall_list;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name ASC');
my $sth = $cat_db->select ( { 'Description' => 'SUB1' }, ['ID', 'Full_Name'] );
my $output;
$output .= "<SELECT name='CatLinks.CategoryID'>";
$output .= "<option value=''>-----------------</option>";
$output .= "<option value='2'>Something2</option>";
$output .= "<option value='3'>Something3</option>";
$output .= "<option value='4'>Something4</option>";
$output .= "<option value='5'>Something5</option>";
$output .= "<option value='6'>Something6</option>";
while (my ($cid,$name) = $sth->fetchrow_array) {
$output .= "<option value='$cid'";
foreach my $sid (@sids) {
if ($sid eq $cid) {
$output .= " selected";
}
}
$output .= ">$name</option>";
}
$output .= "</SELECT>";
return $output;
}