Check version on every page

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@643 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-06-01 21:32:11 +00:00
parent ff85f12518
commit e70920e6ef
2 changed files with 3 additions and 16 deletions

View file

@ -9,16 +9,6 @@ function connect_error() {
echo '<p><a href="' . htmlspecialchars($SELF) . 'privileges=">' . lang('Privileges') . "</a></p>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'processlist=">' . lang('Process list') . "</a></p>\n";
echo "<p>" . lang('MySQL version: %s through PHP extension %s', "<b" . ($dbh->server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info</b>", "<b>$dbh->extension</b>") . "</p>\n";
echo "<p>" . lang('phpMinAdmin version: %s', "<b>$VERSION</b>") . ", <a href='http://www.phpminadmin.net/'>" . lang('current version') . "<span id='version'>" . (version_compare($VERSION, $_COOKIE["phpMinAdmin_version"]) < 0 ? ": <b>" . htmlspecialchars($_COOKIE["phpMinAdmin_version"]) . "</b>" : "") . "</span></a></p>\n";
if (!isset($_COOKIE["phpMinAdmin_version"])) {
?>
<script type="text/javascript">
onload = function () {
verify_version('<?php echo $VERSION; ?>');
};
</script>
<?php
}
echo "<p>" . lang('Logged as: %s', "<b>" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "</b>") . "</p>\n";
}
page_footer("db");

View file

@ -1,6 +1,6 @@
<?php
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $SELF, $LANG;
global $SELF, $LANG, $VERSION;
header("Content-Type: text/html; charset=utf-8");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@ -17,7 +17,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<?php } ?>
</head>
<body>
<body onload="load_jush();<?php echo (isset($_COOKIE["phpMinAdmin_version"]) ? "" : " verify_version('$VERSION');"); ?>">
<script type="text/javascript" src="functions.js"></script>
<div id="content">
@ -62,6 +62,7 @@ function page_footer($missing = false) {
<?php switch_lang(); ?>
<div id="menu">
<h1><a href="http://www.phpminadmin.net/"><?php echo lang('phpMinAdmin'); ?></a> <?php echo $VERSION; ?></h1>
<div class="version"><a href='http://www.phpminadmin.net/#download' id="version"><?php echo (version_compare($VERSION, $_COOKIE["phpMinAdmin_version"]) < 0 ? htmlspecialchars($_COOKIE["phpMinAdmin_version"]) : ""); ?></a></div>
<?php if ($missing != "auth") { ?>
<form action="" method="post">
<p>
@ -106,10 +107,6 @@ function page_footer($missing = false) {
?>
</div>
<?php if (!$missing) { ?>
<script type="text/javascript">onload = load_jush;</script>
<?php } ?>
</body>
</html>
<?php