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

Accessing CCK field values from nodes

Let's say I have one usernode. When viewing that usernode I need to access certain CCK fields that belong to some other node, particularly I need to access an image CCK field from some other node... I'm trying to implement buddylisting feature when viewing usernode page. So, I can list all IDs of buddies that a usernode has.... but now for every ID I need to pull out CCK image field and display that image.

any thoughts on this one?

Changing node.status

I'm not sure what I'm missing exactly. I can update title and description just fine. Is there a lock or a special function that I'm missing to change a node's status? Is it reserved for something in particular?

- Martin

Custom authentication module auto-registration problem

I'm developing a Drupal 5 module for my University society's website to interface with a SOAP service I created a little while back. The SOAP service has two methods; the first accepts a University ID number/email address, password, and society name, and then checks that the ID and password are correct and that the person is a member of the supplied society. This returns one of six of codes, with two success codes: SUC_MEMBER (for a regular member) and SUC_EXEC (for a committee member). The second takes a University ID number/email address and returns the name of the person associated with that ID. I use the string 0123456 as an example University ID number.

LDAP Lookup Module

Inspired by the excellent LDAP Integration Module. I'm creating a module that will return user demographics from a LDAP query. There is just something that I'm not getting about the form submit process.

I have my form with 1 text field and 1 submit button:

function ldap_dir_menu() {
    $items = array();

    $items[] = array(
        'path' => 'directory',
        'title' => t(variable_get('form_title','LDAP Directory')),
        'callback' => 'drupal_get_form',
        'callback arguments' => array('ldap_dir_search_form'),
        'access' => user_access('administer ldap_dir'),
        'type' => MENU_CALLBACK,
    );

    return $items;
}

function ldap_dir_search_form(){

    $form['dir-search']['keyword'] = array(
        '#type' => 'textfield', 
        '#title' => t('Search directory'), 
        '#description' => t('Search the directory'),
        '#size' => 50, 
        '#maxlength' => 255, 
        '#required' => TRUE,
    );

    $form['dir-search']['submit'] = array(
        '#type' => 'submit', 
        '#value' => t('Search')
    );

    return $form ;
}

I have my "_submit" function:

function ldap_dir_search_form_submit($form_id, $form_values) {

// Run the LDAP query to get the matching entries from the form text field
$output = "bunch of logic to get LDAP entries"...

}

Preserving Tab State

I'm developing a module that makes heavy use of tabs. I was wondering what the best way is to preserve the user's tab state (i.e. keeping relevant tabs displayed) without including unneccessary tabs.

For example, here's an example menu structure:

node//doodad (trigger display of "doodads" relevant to my node)
node//doodad/add (triggers display then submission of form to add new doodad)
node//doodad/edit/ (triggers display them submission of form to edit doodad)

Required Terms&Condition page for users (after registration)

peace all
Lately, I've been facing a problem regarding displaying terms&conditions for using the site. I'm using Drupal 5 and PROFILE module for users.

I use CVS files to import and create users, then ask the users with given password and username to login and fill out some details about themselves using PROFILE module. A PHP snippet redirects them to fill out those fields every time they log in until they are filled. But beside redirecting them I can't do much to deny access from the users to the rest of the site.

Pages

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