This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Same user role, but only edit own page...

I might just be very obtuse, but I am trying to create a way for multiple users with the same limited ability role to create/edit their own content, but also comment on and view all content.

Under access control, I've allowed the following:

node module>
- access content
- revert revisions
- view revisions

page module>
- create pages

I would just leave edit own pages selected, but that still allows other users to edit another's content...

Include User Registration Page in Multistep Form

Hello:

I'm trying to include the user_register form in a multistep form process. I've also altered the user_register form with custom fields. I've tried a couple different methods to achieve this:

1. I have tried to alter the user_register form and turn it into the first step of my multistep form. I kept receiving errors in form.inc. (= Use existing form as first step.)

2. I want to include the altered user_register form in the first step of my multistep form. (= Include existing form as first step.)

My curent code looks like this:


function register_menu($may_cache){
$items = array();
if ($may_cache){
$items[] = array(
'path' => 'penregister',
'title' => t('Join'),
'callback' => 'drupal_get_form',
'callback arguments' => array('register_multiform'),
'type' => MENU_CALLBACK,
'access' => TRUE
);
}
return $items;
}

function register_multiform($form_values = NULL) {

if (!isset($form_values)) {
$step = 1;
}
else {
$step = $form_values['step'] + 1;
}

$form['step'] = array(
'#type' => 'hidden',
'#value' => $step,
);

switch ($step) {
case 1:

$output=drupal_get_form('user_register');

print $output;
break;

case 2:

$form['memberdues'] = array(
'#title' => t('Member Dues'),
'#type' => 'fieldset'
);

Add two fields from a User Profile-Node to the $user-object

Hello,

I created user a user profile for my site with the Node Profile module. This profile has
one field for the first name and one for the last name of the user.
I would like to add this piece of information to the $user-object.
My approach was to do this in a module via the "user_save()" function:


function uprofile_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
    .
    .
    .
case 'update': 
      if ($node->moderate && user_access('access submission queue')) { 
        drupal_set_message(t('The post is queued for approval')); 
      } 
      elseif ($node->moderate) { 
        drupal_set_message(t('The post is queued for approval. The editors will decide whether it should be published.')); 
      } 


     // I added this piece of code
     global $user;       
     if ($user->uid == $node->uid) {        // Only change something in $user-object of the profile's owner
       $firstname = array ('firstname' => $node->field_firstname[0]['value']);
       $lastname = array ('lastname' => $node->field_lastname[0]['value']);
       $fullname = array ('fullname' => ($node->field_firstname[0]['value'] . " " . $node->field_lastname[0]['value']));    
       user_save($user,$firstname);
       user_save($user,$lastname);
       user_save($user,$fullname);
      }


      break; 
    .
    .
    .

Solution for Unsupported operand types

I have got the following error

Fatal error: Unsupported operand types in C:\Program Files\xampp\htdocs\buzzintown\includes\form.inc on line 98

$form += _element_info('form');

blocks, form_ids, and hook_forms

Hey everybody,

I've having a small problem with form_ids that I can't seem to figure out.

I'm writing a module that allows the user to select the number of instances of a block that appear on any given page.
Each instance contains a form that can have custom properties. The problem is that since each form was creating using the same builder function, the forms all have the same "form_id", so the input from only the first form on the page is used in the submit function.

one content type - with another content type relation

i am using CCK to create the content type.

i have created two content type,
(1) request
(2) response

now i want to perform following task
(1) one user cas post a request using "request"
(2) another can give a response/reply to the posted request-"request".
i.e. on the post there is comment

i need same type of solution but it would be between two different content types.
so i can track that on one request how much response i have got.and on those response on which i have accepted and rejected.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions