Use JUSH highlighter

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@95 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2007-07-10 06:30:04 +00:00
parent be38f7a22d
commit 4df1572bff
6 changed files with 9 additions and 6 deletions

View file

@ -21,9 +21,11 @@ PRE { margin: 0; margin: .12em 0; }
#menu { position: absolute; top: 8px; left: 8px; width: 15em; overflow: auto; white-space: nowrap; } #menu { position: absolute; top: 8px; left: 8px; width: 15em; overflow: auto; white-space: nowrap; }
#content { margin-left: 16em; } #content { margin-left: 16em; }
</style> </style>
<style type="text/css">@import url(http://jush.info/jush.css);</style>
<script type="text/javascript" src="http://jush.info/jush.js" defer="defer"></script>
</head> </head>
<body> <body onload="jush.highlight_tag('pre');">
<div id="content"> <div id="content">
<?php <?php

View file

@ -193,6 +193,7 @@ function select($result) {
$blobs = array(); $blobs = array();
for ($j=0; $j < count($row); $j++) { for ($j=0; $j < count($row); $j++) {
$field = mysql_fetch_field($result, $j); $field = mysql_fetch_field($result, $j);
//! table and column aliases
if (strlen($field->table) && $field->primary_key) { if (strlen($field->table) && $field->primary_key) {
$links[$j] = $field->table; $links[$j] = $field->table;
if (!isset($indexes[$field->table])) { if (!isset($indexes[$field->table])) {

View file

@ -5,8 +5,8 @@ session_start();
error_reporting(E_ALL & ~E_NOTICE); error_reporting(E_ALL & ~E_NOTICE);
$SELF = preg_replace('~^[^?]*/([^?]*).*~', '\\1?', $_SERVER["REQUEST_URI"]) . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen($_GET["db"]) ? 'db=' . urlencode($_GET["db"]) . '&' : ''); $SELF = preg_replace('~^[^?]*/([^?]*).*~', '\\1?', $_SERVER["REQUEST_URI"]) . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen($_GET["db"]) ? 'db=' . urlencode($_GET["db"]) . '&' : '');
$TOKENS = &$_SESSION["tokens"][$_GET["server"]][preg_replace('~([?&]sql=)upload~', '\\1', $_SERVER["REQUEST_URI"])]; $TOKENS = &$_SESSION["tokens"][$_GET["server"]][preg_replace('~([?&]sql=)upload~', '\\1', $_SERVER["REQUEST_URI"])];
include "./lang.inc.php";
include "./functions.inc.php"; include "./functions.inc.php";
include "./lang.inc.php";
include "./design.inc.php"; include "./design.inc.php";
include "./auth.inc.php"; include "./auth.inc.php";
include "./connect.inc.php"; include "./connect.inc.php";
@ -58,7 +58,7 @@ if (isset($_GET["dump"])) {
echo "<tr valign='top'>"; echo "<tr valign='top'>";
echo "<th>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</th>"; echo "<th>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</th>";
echo '<td><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf' : 'call') . '=' . urlencode($row["ROUTINE_NAME"]) . '">' . htmlspecialchars($row["ROUTINE_NAME"]) . '</a></td>'; echo '<td><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf' : 'call') . '=' . urlencode($row["ROUTINE_NAME"]) . '">' . htmlspecialchars($row["ROUTINE_NAME"]) . '</a></td>';
echo "<td><pre>" . htmlspecialchars($row["ROUTINE_DEFINITION"]) . "</pre></td>"; echo "<td><pre class='jush-sql'>" . htmlspecialchars($row["ROUTINE_DEFINITION"]) . "</pre></td>";
echo "</tr>\n"; echo "</tr>\n";
} }
echo "</table>\n"; echo "</table>\n";

View file

@ -17,7 +17,7 @@ if ($_POST && $error) {
$offset = $match[0][1] + strlen($match[0][0]); $offset = $match[0][1] + strlen($match[0][0]);
} else { } else {
$empty = false; $empty = false;
echo "<pre>" . htmlspecialchars(substr($query, 0, $match[0][1])) . "</pre>\n"; echo "<pre class='jush-sql'>" . htmlspecialchars(substr($query, 0, $match[0][1])) . "</pre>\n";
$result = mysql_query(substr($query, 0, $match[0][1])); $result = mysql_query(substr($query, 0, $match[0][1]));
$query = substr($query, $match[0][1] + strlen($match[0][0])); $query = substr($query, $match[0][1] + strlen($match[0][0]));
$offset = 0; $offset = 0;

View file

@ -50,7 +50,7 @@ if (mysql_get_server_info() >= 5) {
echo "<h3>" . lang('Triggers') . "</h3>\n"; echo "<h3>" . lang('Triggers') . "</h3>\n";
echo "<table border='0' cellspacing='0' cellpadding='2'>\n"; echo "<table border='0' cellspacing='0' cellpadding='2'>\n";
while ($row = mysql_fetch_assoc($result)) { while ($row = mysql_fetch_assoc($result)) {
echo "<tr valign='top'><th>$row[Timing]</th><th>$row[Event]</th><td><pre>" . htmlspecialchars($row["Statement"]) . "</pre></td></tr>\n"; echo "<tr valign='top'><th>$row[Timing]</th><th>$row[Event]</th><td><pre class='jush-sql'>" . htmlspecialchars($row["Statement"]) . "</pre></td></tr>\n";
} }
echo "</table>\n"; echo "</table>\n";
} }

View file

@ -1,3 +1,3 @@
<?php <?php
page_header(lang('View') . ": " . htmlspecialchars($_GET["view"])); page_header(lang('View') . ": " . htmlspecialchars($_GET["view"]));
echo "<pre>" . htmlspecialchars(preg_replace('~^.* AS ~U', '', mysql_result(mysql_query("SHOW CREATE VIEW " . idf_escape($_GET["view"])), 0, 1))) . "</pre>\n"; echo "<pre class='jush-sql'>" . htmlspecialchars(preg_replace('~^.* AS ~U', '', mysql_result(mysql_query("SHOW CREATE VIEW " . idf_escape($_GET["view"])), 0, 1))) . "</pre>\n";