// Name, path, namepsace $loader->addResourceType('model', 'models', 'Model'); // Get our config file $config = new Zend_Config_Ini($apppath . '/application/configs/application.ini'); Zend_Registry::set('config', $config->production); // Because our models need it this way // Get the messages model // Set up our current timestamp // Log the start of this read logWrite("####################################"); logWrite("User property update starts " . date('Y-m-d H:i:s')); logWrite("------------------------------------"); $usrprop = array(63, 64, 74, 65, 66, 77, 78); $mrkinfo = array(67, 68, 69, 70, 71, 72, 75, 76, 73); $rep = new Application_Model_Report(); $accounts_id = $rep->accountids(); $countusrid = count($accounts_id); if ($rep->subscribers_reportUpdate()) { $myla = $rep->getMylaFoldersId(); for ($uid = 0; $uid < $countusrid; $uid++) { $val = $rep->reportCountRegGrpBySubscribersByUserIdNewKeys($accounts_id[$uid], "daily"); $rep->activateUserproperty($accounts_id[$uid], $usrprop[0], $val); $val_w = $rep->dashboard_totalOptedInsByWebform($accounts_id[$uid], "daily"); $rep->activateUserproperty($accounts_id[$uid], $usrprop[1], $val_w); if ($myla[$accounts_id[$uid]]) { $fd = $myla[$accounts_id[$uid]]; $val_m = $rep->getMyla($accounts_id[$uid], $fd, "daily"); $rep->activateUserproperty($accounts_id[$uid], $usrprop[2], $val_m); } else { $val_m = 0; $rep->activateUserproperty($accounts_id[$uid], $usrprop[2], $val_m);
$loader = new Zend_Loader_Autoloader_Resource(array('basePath' => $apppath . '/application/', 'namespace' => 'Application')); // Name, path, namepsace $loader->addResourceType('model', 'models', 'Model'); // Get our config file $config = new Zend_Config_Ini($apppath . '/application/configs/application.ini'); Zend_Registry::set('config', $config->production); // Because our models need it this way // Get the messages model // Set up our current timestamp $timestamp = date('Y-m-d H:i:s'); // Log the start of this read logWrite("####################################"); logWrite("Begin hollyday campaign: {$timestamp}"); logWrite("------------------------------------"); $rpt = new Application_Model_Report(); $usrids = $rpt->accountids(); echo '<pre>'; print_r($usrids); //$usr = new Application_Model_User(); logWrite("\n---------------------"); logWrite("end of hollyday campaign: {$timestamp}"); logWrite("####################################\n"); return 0; /** * Simply writes a log message line to the log file * * @param string $msg The message to write */ function logWrite($msg) { global $logfile;