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

Insert node to body of another node (filter)

I post text of my quick hack-filter. Syntax:

[node:123] - insert full text (themed by theme('node'))
[node:123 body] - insert node's body
[node:123 teaser] - insert node's teaser
[node:123 link] - insert link to node
[node:123 collapsed] - insert collapsed node's body

Code (put it to file node_filter.module):

<?php

function node_filter_help($section) {
switch($section) {
case 'admin/modules#description':
return t('Filter for including node to body of another node by its ID.');
}
}

function _node_filter_replacer($matches) {
$node = node_load(array('nid'=>$matches[1]));
switch ($matches[2]) {
case 'body':
return $node->body;
case 'teaser':
return $node->teaser;
case 'link':
return l($node->title, "node/$node->nid");
case 'collapsed':
return theme('fieldset', array('#collapsible'=>true, '#collapsed'=>true, '#title'=>$node->title, '#value'=>$node->body));
default:
return theme('node', $node);
}
}

function node_filter_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(0 => t('Include/link node by ID'));
case 'description':
return '';
case 'prepare':
return $text;
case "process":
$text = preg_replace_callback('/\[node:([0-9]+)(?:\s+(body|link|collapsed|teaser))?\]/', '_node_filter_replacer', $text);
return $text;
default:
return $text;
}

Customised Advanced Search Form

Hey guys,

I'm trying to create an advanced search form with fields for selecting terms of particular taxonomy categories.

Yes, these are already available in the Advanced Search form, but they are all combined into one select field - and we need them in separate fields.. as some of the categories have dozens of terms to choose from.

Authentication against drupal database

Hi,

I'm working on a integration plugin for a php calendar script called WebCalendar. http://www.k5n.us/webcalendar.php

The idea is that the WebCalendar script will authenticate against the Drupal database and check whether they have permissions such as "administer webcalendar" provided by a Drupal module.

Show a user list with common user_profile settings

Hi,

I've got severl customised user profile fields such as the state where they are from, the year they were born in etc.

I would like to integrate a little drop down menu with all states in a block, so that someone can choose a state and gets a list of users from that state.

There are several attempts for modules that allow user_profile filtering and showing results in a list. I'm a bit confused and am wondering if there is ONE module that is final, runs on 4.7 and does exactly what I described?!

OnChange submit page issues

Is there a way to disable the form validation (required fields) for certain page loads? I have a select onChange event that needs to happen to basically reload a dependant select box.

It's purely for data change.

unfortuantly I get all of these red message that would normally display if the user tried to submit the form themselves.

Also I need to grab the posted value of that select box. I know with _submit functions I can access $values, but if I am still working in the orginal 'display' page how can I acces that?

Thanks

How to hack the ecommerce modules?

Drupal 4.6.9
custom theme

This is a gobal feature request concerning the ecommerce module, particularly the product module.
Since i'm not a PHP expert and i'm relatively new to Drupal, i can't program it myself.

So what admin would need, is a possibility of creating attributes for products. Attributes that, afterwards, user would have to choose from as radio buttons or drop down menu. Let me explain.

Pages

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