Install PECL uploadprogress on Ubuntu 8.04.x LTS server


  • Installing PECL uploadprogress. To have a nice animated upload progress bar.

Notify author of parent comment and main node of new comments

Rules can not only extract information from objects passed to a rule -- such as the title of a node. Rules can also load new objects, such as referred nodes or users.

Attached is a basic example of how you can start with a comment object, and then fetch information about its parent comment (which applies to hierarchichal structures of comments only). The rule can be modified to send e-mail to both the node author and the author of the parent comment, to notify them that someone's commented on their thread. (As it is now, however, the e-mail information is merely displayd in a box as a proof-of-concept.)

The rule flow looks like this:

1. A triggered rule activates on new comment saved. It has a lot of information available, starting with the posted comment.
2. The parent comment is loaded with the action Load comment. There is no [Token]( available to fetch the comment ID for the parent comment, but the information is available in the comment object. A line of PHP extracts the wanted comment ID, $comment->pid.
3. Once the parent comment is loaded, the relevant e-mail address is available as a token. The author of the main node was alreade available when the rule was triggered -- the node was included from the triggered event.

Send e-mail to new users, 2 and 10 days after registering

If using Rules Scheduler, included in the Rules project, it is possible to schedule execution of rule sets to given dates.

You can for example add a rule that triggers when new user accounts are created, but sends an e-mail to the user in question 2 and 10 days afterwards. The basic flow is as follows:

1. Create a rule set that sends an e-mail to a user. Give the rule set an argument to take in user information (from whatever source). It could say "It has been two days since you registered on our site, and we hope you enjoy it."
2. Create another set as the one above, but with a different message. "It is now ten days since you registered on our site. We miss you!"
3. Make sure you have Rules Scheduler activated.
4. Create a triggered rule, activated on New user account created. Have the triggered rule not do anything in itself, but to schedule a rule set. In the time for evaluation you can type '+2 days' to have the rule set executed on a date relative to whatever time the rule was triggered on. Make sure to send along the registered user as argument to the rule set -- you also have the acting user as an option. (If a user account is created by an administrator, you don't want the e-mail to go to the administrator.)

That's it! Sit back, relax, and let Rules Scheduler do the job for you.

Installing SWF Tools 6.x-3.x

There are a number of new features and key changes in version 6.x-3.x of SWF Tools. As this documentation comes together it will slowly replace the old documentation. As this is currently is work in progress, pages in this section may be incomplete.

A. Numerous Resources // JSON Server // JavaScript Tips // MooTools

Numerous Resources // JSON Server // JavaScript Tips // MooTools

// Modules
// // # SERVICES 6.x-2.0 and JSON SERVER 6.x-2.0-alpha1

I've been posting numerous resources for JavaScript developers wanting insight into Drupal Services. As JSON Server is my current module choice, there are examples specific to it there.

Store "Form Multicrud" module array in a CCK Computed field


I love the Form Multicrud module, here it is:

I wanted to store this as a CCK field with my content type and collect data from users with it. It is a perfect solution for prompting and showing Tabular data.

For Computed Code:
(given your form element name is multicrud

$node_field[0]['value'] = serialize($node->multicrud);

In Display field

$rows = unserialize($node_field_item['value']);
$header = array(mycolumn1,mycolumn2,mycolumn3,mycolumn4);
$display = theme_table($header,$rows["items"]);

In your hook_form_alter (so that you display the form on node edit page:

function mymodule_form_alter(&$form, &$form_state, $form_id) {
if($form_id == "story_node_form")
$stored_multicrud = unserialize($form['#node']->field_my_computed_field_name['0']['value']);

$form['multicrud'] = array(
'#title' => 'Accounts',
'#type' => 'multicrud',
'#weight' => 100,
'#multicrud_elements' => array(
// overwrite these!
'mycolumn1' => array(
'#title' => 'Mycolumn1',
'#type' => 'textfield',
'#size' => 30,
'mycolumn2' => array(
'#title' => 'Mycolumn2',


Subscribe with RSS Subscribe to RSS - Programmers