Source for file _post_notifications.job.php
Documentation is available at _post_notifications.job.php
* This file implements the post notifications Cron controller
* @author fplanque: Francois PLANQUE
* @version $Id: _post_notifications.job.php,v 1.1.2.6 2006/11/27 19:12:50 fplanque Exp $
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
if( $Settings->get( 'outbound_notifications_mode' ) !=
'cron' )
{ // Autopruning is NOT requested
$result_message =
T_('Post notifications are not set to run as a scheduled task');
// Get the ID of the post we are supposed to post-process:
if( empty( $job_params['item_ID'] ) )
$result_message =
'No item_ID parameter received.'; // No trans.
$item_ID =
$job_params['item_ID'];
// Notify that we are going to take care of that post's post processing:
$DB->query( 'UPDATE T_posts
SET post_notifications_status = "started"
WHERE post_ID = '.
$item_ID.
'
AND post_notifications_status = "todo"
AND post_notifications_ctsk_ID = '.
$job_params['ctsk_ID'] );
if( $DB->rows_affected !=
1 )
{ // We would not "lock" the requested post
$result_message =
sprintf( T_('Could not lock post #%d. It may already be processed.'), $item_ID );
require_once $model_path.
'items/_itemcache.class.php';
$edited_Item =
& $ItemCache->get_by_ID( $item_ID );
$edited_Item->send_outbound_pings( false );
// Send email notifications now!
$edited_Item->send_email_notifications( false );
// Record that processing has been done:
$edited_Item->set( 'notifications_status', 'finished' );
// Save the new processing status to DB
$edited_Item->dbupdate();
$result_message =
T_('Done.');
* $Log: _post_notifications.job.php,v $
* Revision 1.1.2.6 2006/11/27 19:12:50 fplanque
* 1.9 POT has gone public. No more unnecessary changes.
* 1.9.x language packs should work for ALL 1.9.x versions.
* Adding strings is okay. Removing strings/changing strings for fun is not OK.
* Revision 1.1.2.4 2006/11/25 07:41:21 fplanque
* Backporting: the best way to W.A.S.T.E. time.
* Revision 1.1.2.3 2006/10/14 04:23:31 blueyed
* Fixed E_FATAL / used get_Cache()
* Revision 1.1.2.2 2006/10/12 20:38:14 blueyed
* Merged Pingers-as-plugins etc from HEAD
* Revision 1.1 2006/08/24 00:43:28 fplanque
* Revision 1.1 2006/07/06 19:59:08 fplanque
* better logs, better stats, better pruning