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

hook_nodeapi: check if add or edit

Hi there,
I would like to have a different validation for adding and for editing a form. For this the module must know if I´m adding or editing the node. I tried hook_nodeapi with $op = 'update' value, but it seem´s not to work because it is checked after submit .

How can I check if I´m adding or editing a node before and not after submitting?

Thanks

MySQL forms problem

Hi

Am a Noob with Drupal and finding the Forms API very frustrating. Could anyone help me?
I've had the same problems as the people in this post: http://drupal.org/node/119117, but none of the solutions there work, i still just get a blank output. What am I doing wrong?
This is really annoying me because it will be the core part of my site & it took about an hour to code in standard PHP/MySQL - but two days later I still can't get this blasted Drupal Forms API to work - and it's meant to make things easier!

Here's my code, which is completely derived from the Form API QuickStart:

<?php

function teachers() {
$form = array();

$form['title'] = array(
'#type' => 'textfield',
'#title' => t('title'),
);

$form['forename'] = array(
'#type' => 'textfield',
'#title' => t('forename'),
);

$form['surname'] = array(
'#type' => 'textfield',
'#title' => t('surname'),
);

$form['email'] = array(
'#type' => 'textfield',
'#title' => t('email'),
);

$form['submit'] = array (
'#type' => 'submit',
'#value' => t('Go'),
);

return $form;
}

function teachers_validate($form_id, $form_values) {
if ($form_values['surname'] == '') {
form_set_error('', t('You have to put in a surname'));
}
if ($form_values['forename'] == '') {

Blockbar Working - Layout Not Working

I got blockbar to work...sort of.

The functionality works, but the layout is sort of funky. The titles of each block are displaying one line below the open/close triangle, which in turn pushes the next title down, so it looks strange. Also strange is the fact that the first item in several of the menus displays indented.

I went into the css for the module and changed some stuff to make the title bars thicker and wider, and that worked, but it didn't fix the problem.

If you can help and want to take a look, the problem is here: serenafox.com/drupal

Custom login module: Login does not take

Apache/2.2.4 (Unix) , PHP Version 5.2.2, Drupal 5.1

I am writing a module to log a user into their preexisting drupal account based on the Remote_User environment variable.

When I access the site, I appear to be logged in correctly. My username appears on the menu, my theme is loaded and I can see the front page as usual. (The only thing wrong at this point is that the 'Who's Online' sections shows 0 users and 0 guests.

At this point if I click any of the links off the menu, I get an Access Denied page.

From the Access denied page, if I click the back button, everything works perfectly.
I can also, from the Access Denied page, click the login button without entering a username or password and it will go back to the main page and work right.
Also after first getting to my page, if i hit refresh, everything works correctly.
On browsers which do not clear their cookies, the problem does not occur.

It seems like there is a problem with the session. I am not sure if I have done everything correctly in my login module.

Node Import Module doesn't work

Node Import Module doesn't work :-(

I got errors and can't import anything. Any help?

Categories & sub categories in separate dropdown list box

Main Categiries & sub categories in seperate dropdown list box if u select a particular main category it sub category should be shown in the second list box

Pages

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