'.$text .'

'.$text2.'

'; $result = $logcache->log_cache_event($text); $result = $logcache->log_cache_event($text2); return (true); } return (false); } /* ---------------------------------------------------------------*/ function ameta_cron_unschedule () { /* This should be done once on activation only or once if settings changed, or perhaps only if requested */ $network = ausers_job_prefix(); if (function_exists ('wp_clear_scheduled_hook')) { wp_clear_scheduled_hook('amr_'.$network.'regular_reportcacheing'); $logcache = new adb_cache(); $text = __('Deactivated any existing regular cacheing of lists','amr-users'); $logcache->log_cache_event($text); echo ''.$text .'

'; } } /* ----------------------------------------------------------------*/ function amrmeta_validate_cache_settings() { global $amain; global $aopt; $amain['notonuserupdate'] = true; if (isset($_POST['notonuserupdate'])) { if ($_POST['notonuserupdate'] == 'true') $amain['notonuserupdate'] = true; else $amain['notonuserupdate'] = false; } else $amain['notonuserupdate'] = false; if (!isset ($amain['cache_frequency'] )) $amain['cache_frequency'] = 'notauto'; if (isset($_POST['cache_frequency'])) { if (!($_POST['cache_frequency'] == $amain['cache_frequency'])) { $amain['cache_frequency'] = $_POST['cache_frequency']; ameta_schedule_regular_cacheing ($_POST['cache_frequency']); } } else $amain['cache_frequency'] = 'notauto'; $amain['version'] = AUSERS_VERSION; if (isset($_POST)) { ausers_update_option ('amr-users-main', $amain) ; //ausers_update_option ('amr-users', $aopt); } return; } /* ---------------------------------------------------------------*/ function amrmeta_cache_settings_page() { global $aopt; global $amr_nicenames; global $pluginpage; global $amain; if (empty($amain)) $amain = ausers_get_option('amr-users-main'); $tabs['settings'] = __('Cache Settings','amr-users'); $tabs['logs'] = __('Cache Logs', 'amr-users'); $tabs['status'] = __('Cache Status', 'amr-users'); if (isset($_GET['tab'])) { if ($_GET['tab'] == 'logs') { amr_users_do_tabs ($tabs,'logs'); amrmeta_cache_logs_page(); return; } elseif ($_GET['tab'] == 'status') { amr_users_do_tabs ($tabs,'status'); amrmeta_cachestatus_page(); return; } } amr_users_do_tabs ($tabs,'settings'); //amr_meta_main_admin_header('Cache Settings'); amr_meta_admin_headings ($plugin_page=''); // does the nonce check etc if ((!ameta_cache_enable()) or (!ameta_cachelogging_enable())) echo '

Problem creating DB tables

'; if (isset ($_POST['action']) and ($_POST['action'] == "save")) { amrmeta_validate_cache_settings(); } if (isset ($_REQUEST['rebuildback'])) { echo '

'.__('Background cache request received', 'amr-users').'

'; if (isset($_REQUEST['rebuildreal'])) { $ulist = (int) $_REQUEST['rebuildreal']; amr_request_cache_with_feedback($ulist); } else amr_request_cache_with_feedback(); return; }/* then we have a request to kick off run */ elseif (isset ($_REQUEST['rebuildreal'])) { /* can only do one list at a time in realtime */ $ulist = (int) $_REQUEST['rebuildreal']; amr_rebuild_in_realtime_with_info ($ulist); //echo amr_build_cache_for_one($_REQUEST['rebuildreal']); //echo '

'.sprintf(__('Cache rebuilt for %s ','amr-users'),$_REQUEST['rebuildreal']).'

'; /* check that allowed */ //echo au_view_link(__('View Report','amr-users'), $_REQUEST['rebuildreal'], __('View the recently cached report','amr-users')); return; }/* then we have a request to kick off cron */ else { /* validation will have been done */ $freq = array ('notauto'=> __('No scheduled auto cacheing', 'amr-users'), 'hourly' => __('Hourly', 'amr-users'), 'twicedaily'=> __('Twice daily', 'amr-users'), 'daily' => __('Daily', 'amr-users'), // 'monthly' => __('Monthly', 'amr-users') ); if (!isset ($amain['cache_frequency'])) $freqchosen = 'notauto'; else $freqchosen = $amain['cache_frequency']; echo '

'; _e('Activate regular cache rebuild ? ', 'amr-users'); echo '

'; echo '

'; _e('This cacheing grabs all the raw data it can find and does some preprocessing. ', 'amr-users'); echo '
'; _e('The data is stored in a flat db table for later formatting and reporting. ', 'amr-users'); echo '

'; echo '

'; _e('The cache log will tell you the last few times that the cache was rebuilt and why. ', 'amr-users'); echo ''.__('Go to cache log','amr-users').''; echo '
'; _e('A cron plugin may also be useful.', 'amr-users'); echo ' amr cron manager'; echo '

'; echo'

'.__('More information','amr-users').'

'; echo '

'; /* echo ''; */ echo '

'; echo '


'; echo '
'; echo '

'; _e('If you have very frequent user updates consider only cacheing at regular intervals', 'amr-users'); echo ' '; _e('This will help prevent excessive database activity', 'amr-users'); echo '
'; _e('EG: Are you tracking every page ? every login.. you do not want it recaching all the time?!', 'amr-users'); _e('Rather cache hourly only. A refresh can be requested.', 'amr-users'); echo '
'; _e('Wordpress transients are also used to cache the html in public lists and front end', 'amr-users'); echo '

'; echo '

'; _e('To switch off all auto cacheing, select "Do not.." above AND "No..." below.', 'amr-users'); echo '
'; _e('Lists will then be re-generated on manual refresh request only.', 'amr-users'); echo '

'; foreach ($freq as $i=> $f) { echo '
'; } echo alist_update(); echo alist_rebuild(); } echo ausers_form_end(); }