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

Registration page ad-ons

I am looking for a good way to add options to the registration page. I would rather no use a profile string.

Here is what I am trying to do..

Users that sign up for a login on the site would be able to opt-in to an external hosted email list. They would click a box that says sign me up for this list and then when the user is created it would call the correct url in the back to post to the site the info needed such as username and email to add them to the mailing list.

insert data from form submit

I am trying to insert the data from this form...

/** 
 * Define the form for entering a new flavor. 
 */ 
function  milkshake_add() { 
  $form['milkshake'] = array( 
    '#type' => 'fieldset', 
    '#title' => t('Add A Flavor') 
  ); 
  
  $form['milkshake_add']['add'] = array( 
    '#type' => 'textfield',
    '#title' => t('Add Flavors'),
    '#default_value' => $edit['Add your new flavor here'],
    '#size' => 60,
    '#maxlength' => 64,
    '#description' => t('Add your new flavor one at a time'),
  ); 
  
  $form['milkshake_add']['select'] = array(
    '#type' => 'select',
	'#title' => t('Flavor Catagories'),
    '#options' => array(
	  ''        => t('--Select a Category--'),
	  '2' => t('Classic Flavors'),
      '3'   => t('Combination Flavors'),
      '4'   => t('Funky Flavors'),
    ),
	'#description' => t('Choose a Catagory for your new Flavor'),
  );

  $form['milkshake_add']['submit'] = array( 
    '#type' => 'submit', 
    '#value' => t('Add Flavor!') 
  ); 
  return $form; 
} 

Here is the code I have worked up...that does absolutely nothing...


function milkshake_flavor_form_submit($form_id, $form_values) {
$name = $form_values['name'];
$catid = $form_values['catid'];
db_query("INSERT INTO {msmenuflavors} (flvrid, catid, name) VALUES (%d, %d, '%s'), $flvrid, $catid, $name()");

Split the module structure in DRUPAL 6.X for better load performance

I think that a big change in next version of drupal 6 should be the structure of the modules.

A module should be splitted in various file ad each file only loaded when there is need of this:

An example module file struture:

mymodule.module

mymodule_hook_nodeapi.inc

mymodule_hook_view.inc

mymodule_hook_cck.inc

mymodule_hook_xmlrpc.inc

mymodule_admin.inc

So any mode is loaded when is need of this
In mymodule.module we puth only the base hooks like menu,link,permission,module information.

Custom node is saved but not rendered. What's wrong?

When saving my custom node under PHP 5.2.1 it is nicely rendered.

Doing the same under PHP Version 4.3.11 i get a barely rendered node (this is the full html):

<div id="node-" class="node">
  <h2><a href="/?q=node/" title="">Test</a></h2>
      <span class="submitted">Tue, 07/10/2007 - 19:15 — <a href="/?q=user/1" title="View user profile.">beheerder</a></span>
    <div class="content">
    <hr />

Going to the frontpage renders it the same way.

cannot insert into term_node

Hello,

I've been working on developing a module that connects locations and nodes using the taxonomy and location modules. Anyways, I'm using the hook_nodeapi() and im checking for updates and inserts on my specific node type. Well, I am able to set up the term_data table with my data and i can set up the hierarchy in the term_hierarchy table. Everythings looking fine in my views and the database, but my problem lies in the term_node table. I've created a recursive function that builds the terms and their relationship, then on the base case, I want to insert a relationship between my bottommost term in my hierarchy with the my specified node.

The problem is when I try to make that insert, it never shows up in the database. I've used taxonomy_node_save, db_query and the raw mysql_query, but none of them allow insertion. I'm not getting any errors either. I can manually insert it in phpmyadmin though. One thing though is that as I'm trying to insert, either before or after my insert, a node ($nid) is being linked with another term which is what I want to happen.

Automatic Parent Selection in Parent-Child node relationship

We're looking at developing a CCK-based solution for a petition website, where we have Petitions and Petitioners as separate node types linked together in a parent-child relationship.

Pages

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