name="notify_contact_friends" value="1" /> <?php _e('Send admin a copy to "share listing" email'); ?> </label> </div> </div> </div> <div class="form-row"> <div class="form-label"><?php _e('Warn about expiration'); ?> </div> <div class="form-controls"> <input type="text" class="input-small" name="warn_expiration" value="<?php echo osc_esc_html(osc_warn_expiration()); ?> " /> <?php _e('days'); ?> </div> <span class="help-box"><?php _e('This option will send an email X days before an ad expires to the author. 0 for no email.'); ?> </span> </div> <div class="form-row"> <div class="form-label"> <?php _e('Title length'); ?>
Cron::newInstance()->update(array('d_last_exec' => $d_now, 'd_next_exec' => $d_next), array('e_type' => 'HOURLY')); osc_runAlert('HOURLY', $cron['d_last_exec']); // Run cron AFTER updating the next execution time to avoid double run of cron $purge = osc_purge_latest_searches(); if ($purge == 'hour') { LatestSearches::newInstance()->purgeDate(date('Y-m-d H:i:s', time() - 3600)); } else { if (!in_array($purge, array('forever', 'day', 'week'))) { LatestSearches::newInstance()->purgeNumber($purge); } } osc_update_location_stats(true, 'auto'); // WARN EXPIRATION EACH HOUR (COMMENT TO DISABLE) // NOTE: IF THIS IS ENABLE, SAME CODE SHOULD BE DISABLE ON CRON DAILY if (is_numeric(osc_warn_expiration()) && osc_warn_expiration() > 0) { $items = Item::newInstance()->findByHourExpiration(24 * osc_warn_expiration()); foreach ($items as $item) { osc_run_hook('hook_email_warn_expiration', $item); } } $files = glob(osc_content_path() . 'uploads/temp/qqfile_*'); if (is_array($files)) { foreach ($files as $file) { if (time() - filectime($file) > 2 * 3600) { @unlink($file); } } } osc_run_hook('cron_hourly'); } }