. */ if ( !defined('EQDKP_INC') ){ header('HTTP/1.0 404 Not Found');exit; } /*+---------------------------------------------------------------------------- | awards_crontask +--------------------------------------------------------------------------*/ if ( !class_exists( "awards_crontask" ) ) { class awards_crontask extends crontask { public function __construct(){ register('pm'); } public function run(){ $arrAchIDs = $this->pdh->get('awards_achievements', 'id_list'); foreach($arrAchIDs as $intAchID){ if( $this->pdh->get('awards_achievements', 'active', array($intAchID)) ){ $arrMemberIDs = $this->pdh->get('member', 'id_list'); $arrAchModules = unserialize($this->pdh->get('awards_achievements', 'module', array($intAchID))); $arrAchModuleSettings = unserialize($this->pdh->get('awards_achievements', 'module_set', array($intAchID))); $arrAchModuleConditions = $arrAchModules['conditions']; $arrAchModules = array_slice($arrAchModules, 1); if($arrAchModuleConditions == 'all'){ foreach($arrAchModules as $strAchModule){ include_once($this->root_path.'plugins/awards/cronjob/modules/'.$strAchModule.'_cronmodule.class.php'); $strModuleClass = $strAchModule.'_cronmodule'; $objModule = new $strModuleClass($arrAchModuleSettings[$strAchModule]); $arrMemberIDs = $objModule->cron_process($intAchID, $arrMemberIDs); if(!empty($arrMemberIDs) && is_array($arrMemberIDs)) $arrMemberIDs = array_unique($arrMemberIDs); else break; } if(!empty($arrMemberIDs) && is_array($arrMemberIDs)) $this->awards->add_assignment($intAchID, $arrMemberIDs); }elseif($arrAchModuleConditions == 'any'){ foreach($arrAchModules as $strAchModule){ include_once($this->root_path.'plugins/awards/cronjob/modules/'.$strAchModule.'_cronmodule.class.php'); $strModuleClass = $strAchModule.'_cronmodule'; $objModule = new $strModuleClass($arrAchModuleSettings[$strAchModule]); $arrMemberIDs = $objModule->cron_process($intAchID, $arrMemberIDs); if(!empty($arrMemberIDs) && is_array($arrMemberIDs)) $this->awards->add_assignment($intAchID, $arrMemberIDs); } }else{ continue; } } } } } } ?>