array ( 'rules' => array ( 'rules_1' => array ( '#type' => 'rule', '#set' => 'event_cron', '#label' => 'Unpublish past events', '#active' => 1, '#weight' => '0', '#status' => 'custom', '#conditions' => array ( ), '#actions' => array ( 0 => array ( '#weight' => 0, '#type' => 'action', '#settings' => array ( 'code' => '$field_dates_info = content_database_info(content_fields(\'field_dates\')); $results = db_query("SELECT n.nid FROM {node} n INNER JOIN {". $field_dates_info[\'table\'] ."} c ON n.vid = c.vid WHERE type=\'event\' AND status=1 AND ". $field_dates_info[\'columns\'][\'value\'][\'column\'] ." < now()"); while ($result = db_fetch_object($results)) { $node = node_load($result->nid); $node->status = 0; node_save($node); } ', 'vars' => array ( ), ), '#name' => 'rules_action_custom_php', '#info' => array ( 'label' => 'Unpublish past events', 'label callback' => false, 'module' => 'PHP', 'eval input' => array ( 0 => 'code', ), ), ), ), ), ), )