[drupal-support] Applying filter(s) to a node upon cron

Gerhard Killesreiter killesreiter at physik.uni-freiburg.de
Fri Jan 14 19:27:14 UTC 2005



On Fri, 14 Jan 2005, Mark Quinn wrote:

> I have a "page" node on my corporate intranet that contains deadlines
> and other date information. I've developed a filter which "lives
> inside" the html filter so that deadlines that are approaching or
> overdue are rendered in a different style to highlight them.
>
> Now, of course, this filter will only run on the node's body when the
> node is updated. I would like to update the node each night from a
> cron hook.
>
> I understand I can load the node with: $node = node_load( $nid => x );
> manipulate the body by setting $node->body
> and save the node with node_save( $node );
>
> But i'm lost on how to apply the filters. How is this done?
>
> Am I anywhere near the mark, or would the proposed cron method have to
> do a lot more (ignoring any  of the time related issues)

The Really Simple Solution(tm) is to invalidate all filter caches at
midnight. Drupal will then regenerate the filtered output when the node is
accessed the next time.

Cheers,
	Gerhard



More information about the drupal-support mailing list