"0", "txtar_log" => ""); update_option('gc_al_options', $arr); } } // Delete options table entries only when plugin deactivated AND deleted function gc_al_delete_plugin_options() { delete_option('gc_al_options'); delete_option('gc_al_admin_log'); } // Use the Settings API for our Plugin options function gc_al_init(){ register_setting( 'gc_al_plugin_options', 'gc_al_options' ); } // Add menu page function gc_al_add_options_page() { add_options_page('Admin Log Options Page', 'Admin Log', 'manage_options', __FILE__, 'gc_al_render_form'); } // Draw the menu page itself function gc_al_render_form() { ?>

Admin Log

Admin log erased!

Current log count: (max. limit 200)

The Admin Log page will be included in the log by default. This can inflate the log which may be undesirable.

     

= 200 ) $log = gc_al_remove_first_line($log); // Is user logged in? if ($user) { if ( !(isset($options['chk_ignore_adminlog']) && $options['chk_ignore_adminlog']=="1") ) { $url = explode("/wp-admin/", $_SERVER["REQUEST_URI"]); $txt = date('j/n/y @ G:i:s').', ('.$user->user_login.', '.$user->first_name.' '.$user->last_name.') => '.$url[1]."\r\n"; $txt = $log.$txt; update_option('gc_al_admin_log', $txt); } } } } function gc_al_remove_first_line($txt) { return substr( $txt, strpos($txt, "\r\n")+1 ); } // Get URL of current page function gc_al_currURL() { $pageURL = 'http'; if( isset($_SERVER["HTTPS"]) ) { if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} } $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?>