Posted by sciman on July 22, 2008 at 2:49am
Is there a way to prevent PHP code from executing during the Cron Job?
Whenever I create a Page using the PHP Filter, the PHP code that I place on the page gets executed during the Cron Job. Is there an API call or some other code that I can call or wrap around the PHP code to prevent it from executing during the Cron?
Thanks for any insights.
Steve
Comments
you could use an if
you could use an if statement like this:
<?php
if (arg(0) == 'node' && is_numeric(arg(1))) {
//this is the actual node page, do the php...
}
?>
- Corey
- Corey
http://www.thefreecollege.com
Hi Corey, Not quite sure
Hi Corey,
Not quite sure what it is supposed to do, but I'll give it a try and see how it goes.
Thanks,
Steve
Basically, it makes sure
Basically, it makes sure that the PHP is only executed when you are looking at a node page (ex. www.example.com/node/7).
arg()is a drupal function that lets you know the parts of the url that determine what page to show.- Corey
- Corey
http://www.thefreecollege.com