Make all new blog posts "unpublished", but only for certain roles?

esllou - June 5, 2008 - 09:08

Is it possible to make new content "unpublished" by default (for moderation purposes) but only for a particular role?

I want to do this with blog posts on my site. Authenticated Users should have new blog posts go into moderation but "Full Members" have them immediately published. I'm using Userpoints module to change users from one role to the other.

one way is

kuldip - Gloscon - June 5, 2008 - 09:42

Hi

i can suggest you one solution there may be other solution or module for that

you can do this by using hook_nodeapi()

you can write your code into 'insert' case

function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'submit':
case 'insert':
// you can write your code here like
// you can check user role by using global $user;
// and write query to unpublish the node or take change value of status in node array
case 'update':

break;
}

Thanks,
--
Kuldip Gohil
Software Engineer - Global Software Consulting (Gloscon)
1-888-DRUPAL-9 (378-7259)
http://www.gloscon.com

 
 

Drupal is a registered trademark of Dries Buytaert.