I want to check whether an user have created a node from a specific content type for example

"you don't have created a page now"
or
"you already have created a page"

is this possible?

Thanks

Ken

Comments

blueflowers’s picture

you would need to write a custom function for this, something like:

D5

function check_if_submitted_content_type($type){
global $user;

$sql = "SELECT nid FROM {node} WHERE type = '%s' AND uid = %d";
$res = db_query($sql, $type, $user->uid);

...
}
kendrupal-1’s picture

That's great! thanks!

whan’s picture

Thanks, This saved my time.