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

Strip out glossary links: can anyone debug my PHP pattern please?

I'm trying to enhance the printer-friendly print function in book.module. Right now my issue is to remove all the glossary icons from the text. i can remove the glosaary link images ok with a simple replace but it leaves a lot of unseen rubbish in the HTML from the glossary link. Since I want users to be able to use the book text for their own purposes, I'm trying to remove the entire glossary link.

So far i have this
$output = preg_replace('#<a href="/\?q=glossary.+glossary\.gif" /></a>#', '', $output );

How do I create a simple custom node?

I need help creating a custom node that pulls info from another database when it displays the node. Basically the user will enter in a few fields into the form, including an MLS # (required field). Then when the user views that node it uses the MLS # to look up the info from another database and joins that information with fields filled out in the node form. Make sense?

How to NOT show link on index pages?

I have only one module
http://drupal.org/project/emailpage

that asks me, if to show link on index page. This is very useful feature. Any idea, how to impelment it to another modules?

Andrzej

Best way to set a session variable when some parameters is passed in URL

Hi,

I'm wondering what would be the best way to do the following :

I'm making a site that has no registered users. An option in the menu will give the possibility to change the theme by a single click (actually, it's not the theme, it's only some simple parameter of it)

I'm not experienced enough to guess the best (and simplest) strategy. Should I make a module ? If so, how to make it hooked to urls such as :

mysite.com/set_special_variable/3

custom node title

I have a custom node type and I want to set the node's title based on other user input or from data in my own db table. It seems to be impossible to do this with the module hooks.

4.7 does include the ability for node titles to be handled by modules but this does not seem to help me. It allows for hook_form() to ask the user for title. That's not what I want. I want to generate the title based on responses to other form items, or by retrieving data from a table. I do not want a title field in my form.

A module to integrate Macromedia Contribute content

I probably should have tried something simpler for my first module, but...
I'm working from the node_example.module code, and so far, along with all the other standard stuff, I have a form:


/**
* Implementation of hook_form().
*/
function mmcontrib_form(&$node) {
$form['title'] = array('#type' => 'textfield', '#title' => t('Title'),
'#size' => 60, '#maxlength' => 128, '#required' => TRUE,
'#default_value' => $node->title);
$form['body'] = array('#type' => 'textarea', '#title' => t('Body'),
'#default_value' => $node->body, '#required' => FALSE );

// Now we define the form elements specific to our node type.
$form['path'] = array('#type' => 'textfield', '#title' => t('Import Path'),
'#default_value' => $node->path, '#size' => 60, '#maxlength' => 256,
'#weight' => 0);
$form['subpath'] = array('#type' => 'textfield', '#title' => t('Substitution Path'),
'#default_value' => $node->subpath, '#size' => 60, '#maxlength' => 256,
'#weight' => 1);
$form['startdelim'] = array('#type' => 'textfield', '#title' => t('Start import at:'),
'#default_value' => $node->startdelim, '#size' => 60, '#maxlength' => 256,
'#weight' => 2);
$form['enddelim'] = array('#type' => 'textfield', '#title' => t('End import at:'),
'#default_value' => $node->enddelim, '#size' => 60, '#maxlength' => 256,
'#weight' => 3);

Pages

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