Community Documentation

Schedule cclink event

Last updated March 7, 2009. Created by nekobul on May 3, 2008.
Edited by bryan kennedy, taylesia. Log in to edit this page.

I needed a way to schedule a cclink event 30 days after a node was created. The standard cclinks Set event scheduling event action doesn't allow php code, so I found a way to do it with a php action. You may use the following code to control your event date:

<?php
// Schedule event in 30 days.
$event_date = time() + 60 * 60 * 24 * 30;
cclinks_link_apply_schedule_date($node, 'cclink1', strftime( "%Y-%m-%d %H:%M:%S", $event_date));
?>

where cclink1 is your cclink internal name.

When you setup your rule configuration in Workflow-ng, you have to "Add an action" - "Execute custom PHP code". This is where you place the code.

About this page

Drupal version
Drupal 5.x
Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.