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

Field set and accessing return variable (newbie que)

Hi

I have a form in my module which includes the following segment:

 $form['evalform']= array(
   '#type' => 'fieldset',
   '#title' => t('Evaluation fields:'),
   '#tree' => TRUE,
   '#collapsible' => TRUE,
  );
  $form['evalform']['principles_rating'] = array(
    '#type' => 'radios',
    '#title' => t('Principles rating'),
    '#default_value' =>   $node->principles_rating,
    '#options' => $ratingbuttons,
    '#description' => t('Principles rating description'),
  );

when it comes time to insert I user var_dump($node) to check the values and things are fine except that
there is level issue which I just don't understand yet. What I mean is that 'principles_rating' cannot be accessed via $node->principles_rating because its inside an array called 'evalform'. The var_dump gives:

object(stdClass)(23) { ["nid"]=> int(20) ["vid"]=> int(20) ["uid"]=> string(1) "1" ["created"]=> int(1137046448) ["changed"]=> int(1137046448) ["type"]=> string(21) "fhsstadmin-evaluation" ["evalcontentdiv"]=> array(1) { ["pagecontent"]=> string(0) "" } ["evalform"]=> array(5) { ["principles_rating"]=> string(1) "2" ... ["validated"]=> bool(true) ["is_new"]=> bool(true) }

How do I actually access the value in my insert fucntion, i.e. what do I need to change in:


db_query("INSERT INTO {fhsstadmin}_mediation (nid,
uid,

nodeapi_example in HEAD isn't 4.7 compatible is it?

Hi

I am trying to implement exactly this idea of extending an existing node:

http://drupaldocs.org/api/head/function/nodeapi_example_nodeapi

but on 4.7.0-beta3. For some reason (my lack of understand ;) I cannot get the values back to store in my database.
I post a question about my code in http://drupal.org/node/44352 before discovering the example above.

Calendar Systems

I tried searching around a bit for this,

Has anyone developed a calendar system for Drupal similar to ExtCalendar 2? Or, has anyone installed ExtCalendar 2 and had it work well with Drupal?

Adding a field to a node and storing its value

Hi

I am using 4.7.0-beta3 and I want to add another textfield to other nodes, say "page", then add to the edit form and save it into a table I created. I think it should be pretty simple but I've missed something and would really appreciate an expert looking over it quickly - should be obvious.

I use nodeapi and form_alter hooks as I understand it - the field I want is a syllabus field for a page so I have done the following:

function fhsstadmin_form_alter($form_id, &$form) {
if (isset($form['type'])) {
$node = $form['#node'];

if ($form['type']['#value'] .'_node_settings' == $form_id) {
$form['fhsstadmin'] = array('#type' => 'fieldset', '#title' => t('Syllabus'));
$form['fhsstadmin']['fhsstadmin_options_'. $form['type']['#value']] = array(
'#type' => 'radios',
'#title' => t('Syllabus'),
'#default_value' => variable_get('fhsstadmin_options_'. $form['type']['#value'], 1),
'#options' => array(t('Disabled'), t('Enabled')),
'#description' => t('Choose whether syllabus should be shown or not.')
);
}

if ($form['type']['#value'] .'_node_form' == $form_id && variable_get('fhsstadmin_options_'. $node->type, 1)) {
$form['fhsstadmin_syllabus'] = array(
'#type' => 'textarea',
'#title' => t('Syllabus'),
'#default_value' => $node->syllabus,
'#cols' => 60,

Voting control member

Hi,

I have setup the voting module for the image gallery and members can vote on images.

I would like to control the number of times a member can vote. for example, members can vote only once or for 5 pictures, etc.

All comments greatly appreciated.

Thanks, Darly

help with blog.module hack?

I am looking for a little help to modify the blog module (4.6.5)

When you are in 'list' view, eg: http://mysite.com/blog or http://mysite.com/blog/99
...it shows a teaser. I want to change this so the full node prints here, as it would for a 'normal' blog.

Has anyone successfully done this?
Willing to share your code?

Additionally - does anyone now if this functionality was implemented for 4.7?

Thanks in advance to anyone who can help.

Pages

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