Location: PHPKode > scripts > Nudalytics > nudalytics/core/movement.php
<?php
//####################################################
//管理者ページの状態
//####################################################
function Nudalytics_adminpage() {
	global $wpdb;
	$tablename = $wpdb->prefix.'Nudalytics';
?>
<div class="wrap">
<h2><?php _e('Movement in Admin', 'Nudalytics') ?></h2>
<ul class="nt h">
	<li class="w10"><?php _e('Date', 'Nudalytics'); ?></li>
	<li class="w18"><?php _e('IP address / Host', 'Nudalytics'); ?></li>
	<li class="w70"><?php _e('URL', 'Nudalytics'); ?></li>
</ul>
<?php
	$list = $wpdb->get_results("SELECT * FROM $tablename WHERE URL LIKE '%wp-admin%' ORDER BY $tablename.Time DESC LIMIT 0, 250;");
	foreach ($list as $data) {
		$prop = explode('?', $data->URL);
		//ディレクトリパスを取得
		$place = explode('/', $prop[0]);
		if($place[2] == 'index-exula.php')
			continue;
		elseif(strpos($data->URL, '/admin.php?') >= 1)
			$place[2] = 'Somewhere plugin\'s page';
		elseif($place[2] == '' || $place[2] == 'admin.php')
			$place[2] = 'Admin home';

		//ディレクトリパスの出力など
		echo '<ul class="nt">'.
			'<li class="w10">'.$data->Time.'</li>'.
			'<li class="w18 sf">'.$data->IP.'<br />'.$data->Host.'</li>'.
			'<li class="w70 lf">';
		_e($place[2], 'Nudalytics');

		//操作情報を取得
		if($place[2] != 'index.exula.php' && $place[2] != 'Admin home') {
			$action = explode('&', $prop[1]);
			for($i = 0; $i < count($action); $i++)
				$action[$i] = explode('=', $action[$i]);
			
			if($action[0][0] != null)
				echo '<hr style="border: 1px solid #888; border-width: 1px 0 0 0;" />';
			
			for($n = 0; $n < count($action[$n]); $n++) {
				//操作項目
				switch($action[$n][0]) {
					case 'action':
						_e('Action: ', 'Nudalytics');
						break;
					case 'file':
						_e('Editted file\'s pass: ', 'Nudalytics');
						break;
					case 'page':
						_e('Being stayed: ', 'Nudalytics');
						break;
					case 'paged':
						_e('Target of page: ', 'Nudalytics');
						break;
					case 'plugin':
						_e('Target of plugin: ', 'Nudalytics');
						break;
					case 'plugin_status':
						_e('Plugin\'s status is changed: ', 'Nudalytics');
						break;
					case 'post':
						_e('Post number: ', 'Nudalytics');
						break;
					case 'post_type':
						_e('The post type is: ', 'Nudalytics');
						break;
					case 'settings-updated':
						_e('Changed settings: ', 'Nudalytics');
						break;
					case 'theme':
						_e('Theme name: ', 'Nudalytics');
						break;
				}
				//動作および対象
				switch($action[$n][0]){
					case 'action':
					case 'file':
					case 'plugin_status':
					case 'settings-updated':
						echo '<span class="r">'.$action[$n][1].'</span><br />';
						break;
					case 'page':
						echo '<span class="brwn">'.$action[$n][1].'</span><br />';
						break;
					default:
						echo $action[$n][1].'<br />';
						break;
				}
			}
		}

		//おしめ
		echo '</li></ul>';
	}

?>
</div>
<?php
}
?>
Return current item: Nudalytics