Joined: Dec 02, 2006 Posts: 1251 Location: Texas, USA
Posted:
Tue Feb 10, 2009 3:20 pm
This Ms-Analysis Cron Job script broke under RN2.3, was working under RN until then. Probably something simple with the include path but after a few attempts no luck, so here I am
modules/MS_Analysis/include/cronmaintenance.php
Code:
global $prefix, $db;
// Set time limit and ignore user abort
if( !get_cfg_var('safe_mode') )
{
@set_time_limit( 300 );
@ignore_user_abort( 1 );
}
// Next setting ($forum_admin) is needed so that PHP-Nuke finds the required files in the correct path
define('FORUM_ADMIN', true);
require_once("../../../config.php");
require_once("../../../db/db.php");
// END: Next setting ($forum_admin) is needed so that PHP-Nuke finds the required files in the correct path
// Set last update time
$db->sql_query( "update $prefix"._msanalysis_admin." set lastupdate = '$MSAdata[logdate]' where id='1'" );
// Carry out maintenance every hour (by cron deamon)
if( $MSArow[staticupdate] ) {
require_once( "class.maintenance.php" ); // Routine Classes for tracker
$msamainteneance = new msa_maintenance();
$msamainteneance->hourly_maintenance( $MSAdata[slogdate] );
}
// Every day default clear the hits for this day. If set, also prune MS-Tables
if( $MSAdata[slogdate] != $MSArow[curdate] ) {
if( $MSArow[staticupdate] ) {
// Set new logdate in Admin Table
$db->sql_query( "update $prefix"._msanalysis_admin." set curdate='$MSAdata[slogdate]' where id = '1'" );
require_once( "class.maintenance.php" ); // Routine Classes for tracker
$msamainteneance = new msa_maintenance( );
$msamainteneance->daily_maintenance( );
if( $MSArow[allow_pruning] ) $msamainteneance->pruning_maintenance( );
}
}
unset( $MSAdata );
Heres the full download if needed
Only registered users can see links on this board! Get registered or login to the forums!
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum