Index: /trunk/htdocs/diagnosis/diagnosis.tpl.php
===================================================================
--- /trunk/htdocs/diagnosis/diagnosis.tpl.php	(revision 1089)
+++ /trunk/htdocs/diagnosis/diagnosis.tpl.php	(revision 1090)
@@ -1,2 +1,25 @@
 <?php include "../common/header.tpl.php"; ?>
+<table cellspacing="0" cellpadding="4" class="cycles">
+	<caption>
+		<?php echo _T("Diagnosis Result"); ?>
+	</caption>
+	<tr>
+		<th>
+			<?php echo _T("Level"); ?>
+		</th>
+		<th>
+			<?php echo _T("Reason"); ?>
+		</th>
+		<th>
+			<?php echo _T("Suggestion"); ?>
+		</th>
+	</tr>
+<?php foreach ($notes as $note) { ?>
+	<tr>
+		<td><?php echo ucfirst($note['type']); ?></td>
+		<td><?php echo $note['reason']; ?></td>
+		<td><?php echo $note['suggestion']; ?></td>
+	</tr>
+<?php } ?>
+</table>
 <?php include "../common/footer.tpl.php"; ?>
Index: /trunk/htdocs/diagnosis/index.php
===================================================================
--- /trunk/htdocs/diagnosis/index.php	(revision 1089)
+++ /trunk/htdocs/diagnosis/index.php	(revision 1090)
@@ -6,5 +6,5 @@
 
 $notes = array();
-function note($type, $reason, $suggestion)
+function note($type, $reason, $suggestion = "ok") // {{{
 {
 	global $notes;
@@ -15,5 +15,5 @@
 			);
 }
-
+// }}}
 function getCacheInfos() // {{{
 {
@@ -35,49 +35,105 @@
 	return $cacheInfos;
 }
+// }}}
 
-$cacheInfos = getCacheInfos();
+if (!extension_loaded('XCache')) {
+	ob_start();
+	phpinfo(INFO_GENERAL);
+	$info = ob_get_clean();
+	ob_start();
+	if (preg_match_all("!<tr>[^<]*<td[^>]*>[^<]*(?:Configuration|ini|Server API)[^<]*</td>[^<]*<td[^>]*>[^<]*</td>[^<]*</tr>!s", $info, $m)) {
+		echo '<div class="phpinfo">';
+		echo 'PHP Info';
+		echo '<table>';
+		echo implode('', $m[0]);
+		echo '</table>';
+		echo '</div>';
+	}
+	if (preg_match('!<td class="v">(.*?\\.ini)!', $info, $m)) {
+		echo "Please check $m[1]";
+	}
+	else if (preg_match('!Configuration File \\(php.ini\\) Path *</td><td class="v">([^<]+)!', $info, $m)) {
+		echo "Please put a php.ini in $m[1] and load XCache extension";
+	}
+	else {
+		echo "You don't even have a php.ini yet?";
+	}
+	echo "(See above)";
+	note("error", _T('XCache is not loaded'), ob_get_clean());
+}
+else {
+	note("info", _T('XCache loaded'));
 
-// if (!$ini['xcache.size'] || !$ini['xcache.cacher']) {
+	$cacheInfos = getCacheInfos();
 
-foreach ($cacheInfos as $cacheInfo) {
-	if ($cacheInfo['ooms']) {
+	if (!ini_get("xcache.size") || !ini_get("xcache.cacher")) {
+		note(
+			"error"
+			, _T("XCache is not enabled. Website is not accelerated by XCache")
+			, _T("Set xcache.size to non-zero, set xcache.cacher = On")
+			);
+	}
+	else {
+		note("info", _T('XCache Enabled'));
+	}
+
+	$ooms = false;
+	foreach ($cacheInfos as $cacheInfo) {
+		if ($cacheInfo['ooms']) {
+			$ooms = true;
+			break;
+		}
+	}
+	if ($ooms) {
 		note(
 			"warning"
-			, "Out of memory happened when trying to write to cache"
+			, _T("Out of memory happened when trying to write to cache")
 			, "Increase xcache.size and/or xcache.var_size"
 			);
-		break;
 	}
-}
+	else {
+		note("info", _T('XCache Memory Size'));
+	}
 
-foreach ($cacheInfos as $cacheInfo) {
-	if ($cacheInfo['errors']) {
+	$errors = false;
+	foreach ($cacheInfos as $cacheInfo) {
+		if ($cacheInfo['errors']) {
+			$errors = true;
+			break;
+		}
+	}
+	if ($errors) {
 		note(
 			"warning"
-			, "Error happened when compiling your PHP code"
-			, "This usually means there is syntax error in your PHP code. Enable PHP error_log to see what parser error is it, fix your code"
+			, _T("Error happened when compiling at least one of your PHP code")
+			, _T("This usually means there is syntax error in your PHP code. Enable PHP error_log to see what parser error is it, fix your code")
 			);
-		break;
 	}
+	else {
+		note("info", _T('All PHP scripts seem fine'));
+	}
+
+	/*
+	if ($ini['xcache.count'] < cpucount() * 2) {
+	}
+
+	if ($ini['xcache.size'] is small $ini['xcache.slots'] is big) {
+	}
+
+	if ($ini['xcache.readonly_protection']) {
+	}
+
+	if ($cache['compiling']) {
+	}
+
+	if ($cache['compiling']) {
+	}
+
+	if ($cache['disabled']) {
+	}
+	*/
 }
 
 /*
-if ($ini['xcache.count'] < cpucount() * 2) {
-}
-
-if ($ini['xcache.size'] is small $ini['xcache.slots'] is big) {
-}
-
-if ($ini['xcache.readonly_protection']) {
-}
-
-if ($cache['compiling']) {
-}
-
-if ($cache['compiling']) {
-}
-
-if ($cache['disabled']) {
-}
 
 if (($coredumpFiles = globCoreDumpFiles()) {
Index: /trunk/htdocs/cacher/index.php
===================================================================
--- /trunk/htdocs/cacher/index.php	(revision 1088)
+++ /trunk/htdocs/cacher/index.php	(revision 1090)
@@ -257,28 +257,5 @@
 xcache_count(XC_TYPE_PHP); // trigger auth
 if (!extension_loaded('XCache')) {
-	include "../common/header.tpl.php";
-	echo '<h1>XCache is not loaded</h1>';
-	ob_start();
-	phpinfo(INFO_GENERAL);
-	$info = ob_get_clean();
-	if (preg_match_all("!<tr>[^<]*<td[^>]*>[^<]*(?:Configuration|ini|Server API)[^<]*</td>[^<]*<td[^>]*>[^<]*</td>[^<]*</tr>!s", $info, $m)) {
-		echo '<div class="phpinfo">';
-		echo 'PHP Info';
-		echo '<table>';
-		echo implode('', $m[0]);
-		echo '</table>';
-		echo '</div>';
-	}
-	if (preg_match('!<td class="v">(.*?\\.ini)!', $info, $m)) {
-		echo "Please check $m[1]";
-	}
-	else if (preg_match('!Configuration File \\(php.ini\\) Path *</td><td class="v">([^<]+)!', $info, $m)) {
-		echo "Please put a php.ini in $m[1] and load XCache extension";
-	}
-	else {
-		echo "You don't even have a php.ini yet?";
-	}
-	echo "(See above)";
-	include "../common/footer.tpl.php";
+	header("Location: ../diagnosis");
 	exit;
 }
Index: /trunk/htdocs/common/common.php
===================================================================
--- /trunk/htdocs/common/common.php	(revision 1089)
+++ /trunk/htdocs/common/common.php	(revision 1090)
@@ -149,5 +149,5 @@
 	}
 	if (!empty($GLOBALS['config']['show_todo_strings'])) {
-		return '<span style="color:red">' . htmlspecialchars($str) . '</span>|';
+		return '<span style="color:red">' . $str . '</span>|';
 	}
 	return $str;
