Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [hegu] Form display based on the user name

Quote Reply
Re: [hegu] Form display based on the user name In reply to
Is it only one category you don't wanna let them submit to? If so, try using a new global:

check_if_can_submit
Code:
sub {
my $category_name = $DB->table('Category')->select( ['Full_Name'], { ID =>$_[0] } )->fetchrow;
if ($category_name =~ /^Category Name Your Dont want to let them add to/) {
return { cant_add => 1 }
}
}

..then call with:
Code:
<%check_if_can_submit($ID)%>
<%if cant_add%>
They can't add here
<%else%>
They can add here
<%endif%>

Just change the text in "red" to the root-category you don't want them to be allowed to add to (this will also stop sub-categories)

Untested, but should work fine.

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!
Subject Author Views Date
Thread Form display based on the user name hegu 12499 Apr 22, 2009, 1:34 PM
Thread Re: [hegu] Form display based on the user name
brewt 12255 Apr 22, 2009, 2:59 PM
Thread Re: [brewt] Form display based on the user name
hegu 12255 Apr 22, 2009, 3:27 PM
Thread Re: [hegu] Form display based on the user name
brewt 12263 Apr 22, 2009, 4:13 PM
Thread Re: [brewt] Form display based on the user name
hegu 12257 Apr 22, 2009, 9:10 PM
Thread Re: [hegu] Form display based on the user name
hegu 12229 Apr 23, 2009, 11:35 AM
Thread Re: [hegu] Form display based on the user name
hegu 12205 Apr 25, 2009, 9:23 PM
Thread Re: [hegu] Form display based on the user name
Andy 12271 Apr 26, 2009, 1:56 AM
Post Re: [Andy] Form display based on the user name
hegu 12183 Apr 26, 2009, 7:17 AM
Thread Re: [Andy] Form display based on the user name
hegu 12124 May 17, 2009, 7:00 AM
Thread Re: [hegu] Form display based on the user name
Andy 12105 May 17, 2009, 9:01 AM
Thread Re: [Andy] Form display based on the user name
hegu 12074 May 19, 2009, 10:14 AM
Thread Re: [hegu] Form display based on the user name
Andy 12140 May 19, 2009, 11:02 AM
Thread Re: [Andy] Form display based on the user name
hegu 12095 May 19, 2009, 12:02 PM
Thread Re: [hegu] Form display based on the user name
VishalT 12082 May 19, 2009, 3:26 PM
Thread Re: [SWDevil.Com] Form display based on the user name
hegu 12060 May 19, 2009, 5:01 PM
Thread Re: [hegu] Form display based on the user name
VishalT 12090 May 19, 2009, 5:26 PM
Thread Re: [SWDevil.Com] Form display based on the user name
hegu 12035 May 19, 2009, 5:31 PM
Thread Re: [hegu] Form display based on the user name
Andy 12074 May 20, 2009, 12:05 AM
Post Re: [Andy] Form display based on the user name
hegu 12015 May 20, 2009, 7:11 AM