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

Drupal Coding Style?

I am working on a couple of modules and am using the core modules as an example style. But it would be nice to know if there is a style guide for modules that the Drupal community prefers. A search found too many hits to be useful. Based on existing modules and some forum comments I am guessing something like:

Formatting:

Testing to see if a node's Organic groups 'audience' includes a particular group

Hello,

I am trying to modify event.module (the calendar module) so that the Upcoming events block will only list an event if its audience includes the group that the user is currently viewing. I think that I can get this behavior by modifying the following function from event.module so that the assignment statement in the body of the while loop is only executed if the audience of $node (an event) includes the group that the user is currently viewing (the group with node id equal to arg(1)). But I'm not sure how to perform that test.

flexinode excel export with taxonomy

Has anyone tweaked flexinode to enable exporting of each flexinode type's data into excel or CSV, and also export the data w/ it's associated taxonomy vocab and terms?

I see how the contact module does this, but it does not export w/ corresponding taxonomy data. Any ideas?

Ian

about ecommerce module

I install ecommerce module on drupal4.6,and it run well.I think the module is better,and I like it.
I need a webpage(can list all goods,list all goods on given classify) on the module.
Who can help me?
Thanks.

help with taxonomy_render_nodes

Hi all,

I've been stucked with this for two weeks now.

This block of code does exactly what I want

<?php
  $random_nid = 42;
  $tids = array_keys(taxonomy_node_get_terms($random_nid));
  $result = taxonomy_select_nodes($tids);
  $output .= '<p>';
  $output .= taxonomy_render_nodes($result);
  $output .= '</p>';
  return $output;
?>

but when I use it in my module below, the taxonomy_render_nodes function fails with "memory exausted".
I've tried to increase the memory, but it didn't help.

Any Ideas ?

function committee_view(&$node, $teaser = FALSE, $page = FALSE) {
  $content = theme('committee',$node);
  $node->body = $content;
  return $node; 
}

function theme_committee($node) {
  $output ='';

  $header = array(t("Chair"),t("Secretary"),t('Frequency'),t('Rep/Delegate'));

  $rep = ''; 
  $rows[0] = array($node->chair,$node->secretary,$node->frequency,$rep);

  $output .= theme('table', $header, $rows);

  $output .= '<div class="content">';
  $output .= l(t("Go to the Committee Homepage for more Information"), "$node->homepage");
  $output .= "<br/><br/>";
  $output .= t("$node->body\n");
  $output .= '</div>';

  $tids = array_keys(taxonomy_node_get_terms($node->nid));
  $result = taxonomy_select_nodes($tids);
  $output .= '<p>';
  $output .= taxonomy_render_nodes($result);
  $output .= '</p>';

  return $output;
}

Older module compatability with newer drupal versions?

I'm aware some of them wont work but off hand anyone know which ones do work out of the modules that haven't be updated specifically to the new 4.6.1? I'm thinking of using the cafepress one but unsure if it will bork if I attempt to use it.

Pages

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