deactivating create content when post is already submitted.

nikitas - June 17, 2009 - 19:32

Hi.
I know from php-mysql programming but i've just started with drupal so what to do is this.
When a user submits content at a specific content type with a specific vocabulary term ( taxonomy term )
he can only submit once.SO what i am asking is this.
Which file .tpl.php to add ( or it's not working like this ) and what mysql query to run.
If for example i run a query like this.

$q=select * from node where content_type=x and vocabulary.taxonomy_term=y and user=z
$result=mysql_query($q,$conn);
if(mysql_num_rows($result)>0){
print "Sorry but u've already submitted your content at this content type";
}else{
//continue with drupal
}

. . .
How can i make something like this at drupal.
P.S:I know about user-quota modules but i'm running this a live site with drupal 6.9

_

WorldFallz - June 17, 2009 - 19:36

First things first-- if you're talking about a live site you should upgrade to the latest secure release, which at this point is 6.12.

Second, if you don't want to use one of the user quota modules, why not just take the code you need from one of them.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

i'll upgrade to 6.12 as soon as possible

nikitas - June 17, 2009 - 19:58

. . . but i want this as a quick fix . . .
and about the user quota module . . . there's not a documentation about how to use this . . . and i'm quite new at this process with _hooks ant etc. . . so i'll probably have to read a lot before using 'drupal compatible' code. . .

_

WorldFallz - June 18, 2009 - 15:59

I'm not sure I understand-- the quickest fix would be to simply use one of the quota modules.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

ok i totally agree about the quickest fix

nikitas - June 18, 2009 - 19:24

. . . but user quota doesnt do what i want.It allows you to apply restriction per user and i want per role ?
is this possible>? or is it another module ?

_

WorldFallz - June 18, 2009 - 19:46

Seem to be two options: http://drupal.org/project/node_limit or http://drupal.org/project/quota_by_role (easily located with a simple search).

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

 
 

Drupal is a registered trademark of Dries Buytaert.