0

I would like to unpublish automatically the content profile node of the users who updates their user account at user/%/eidt.

I found a event "User account details have been updated" in Rules but didn't find the action to unpublish their content profile node.

2 Answers 2

0

There's also a hook you can use to react to user operations. Could do something pretty simple like this (untested code btw, you'll also have to adapt it for the name of your content type):

<?php
  /**
   * Implements hook_user()
   */
  function MODULENAME_user($op, &$edit, &$account, $category = NULL) {
    if( $op == 'update' ) {
      $type = 'name_of_your_profile_content_type';
      $profile = content_profile_load($type, $account->uid);
      $profile->status = 0;
      node_save($profile);
    }
  }
?>
0
0

You can use the "Set data"-action to set the profile node's status to 0: status=1 means published, status=0 means unpublished.

1
  • Where is "Set data"-action ? I can't find it..
    – chinita7
    Commented Jul 6, 2012 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.