- build explain links a bit different...

- fix btn_ip reference (it is btn_info now)
- removed sql_report.css (we use the acp css)
- updated the sql report layout


git-svn-id: file:///svn/phpbb/trunk@5838 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-04-23 14:23:22 +00:00
parent d6af193b53
commit de4299c81c
9 changed files with 90 additions and 195 deletions

View file

@ -140,7 +140,8 @@ function adm_page_header($page_title)
function adm_page_footer($copyright_html = true) function adm_page_footer($copyright_html = true)
{ {
global $db, $config, $template, $SID, $user, $auth, $starttime, $phpbb_root_path, $phpEx, $cache; global $db, $config, $template, $user, $auth, $cache;
global $SID, $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
// Output page creation time // Output page creation time
if (defined('DEBUG')) if (defined('DEBUG'))
@ -169,7 +170,11 @@ function adm_page_footer($copyright_html = true)
} }
} }
$debug_output .= ' | <a href="' . (($_SERVER['REQUEST_URI']) ? htmlspecialchars($_SERVER['REQUEST_URI']) : "index.$phpEx$SID") . ((strpos($_SERVER['REQUEST_URI'], '?') !== false) ? '&amp;' : '?') . 'explain=1">Explain</a>'; $explain_url = $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);
$explain_url = (strpos($explain_url, '?') !== false) ? str_replace('?', $SID . '&amp;', $explain_url) : $explain_url . '?' . str_replace('?', '', $SID);
$explain_url .= ((strpos($explain_url, '?') === false) ? '?' : '&amp;') . 'explain=1';
$debug_output .= ' | <a href="' . $explain_url . '">Explain</a>';
} }
} }

View file

@ -871,6 +871,7 @@ table.pmask td.name {
color: #333333; color: #333333;
} }
/* Tooltip for permission roles */
.tooltip { .tooltip {
width: 200px; width: 200px;
color: #000; color: #000;

View file

@ -1,131 +0,0 @@
/*
$Id$
The original "subSilver" theme for phpBB2
Created by subBlue design :: http://www.subBlue.com
Updated for phpBB 2.2 by psoTFX :: phpBB Group
Copyright (c) 2002 phpBB Group
*/
body {
background-color: white;
font-family: Verdana, Arial, Helvetica, sans-serif;
margin: 0;
border: 0;
padding: 0;
}
p {
font-size: 8pt;
}
.maintitle, h1 {
font: bold 18pt 'Trebuchet MS', Verdana, sans-serif;
text-decoration:none;
line-height: 120%;
}
h2 {
font: bold 12pt Arial, Helvetica, sans-serif;
text-decoration:none;
line-height: 120%;
}
.maintitle {
color: #12749B
}
/*
Anchors
*/
a:link, a:active, a:visited { color: #006699; text-decoration: none; }
a:hover { color: #DD6900; text-decoration: underline; }
a.nav { color: #006699; text-decoration: none; }
a.nav:hover { text-decoration: underline; }
a.th:link { color: #FFA34F; text-decoration: none; }
a.th:active { color: #FFA34F; text-decoration: none; }
a.th:visited { color: #FFA34F; text-decoration: none; }
a.th:hover { color: #FFA34F; text-decoration: underline; }
/*
Non-tag specific
*/
.gen, .gensmall {
color: black;
}
.gen {
font-size: 8pt;
}
.gensmall {
font-size: 7pt;
}
.nav {
color: black;
font-size: 7pt;
font-weight: bold;
}
.error { color: #FF0000 }
/*
Tables
*/
table.bg {
background-color: #ACBBC6
}
th, td {
font: normal 8pt Verdana, Arial, Helvetica, sans-serif;
}
th {
height: 25px;
background-color: #006699;
color: #FFA34F;
font-weight: bold;
font-size: 11px;
}
td.cat {
height: 28px;
background-color: #D1D7DC;
}
.row1 {
background-color: #EFEFEF;
}
.row2 {
background-color: #DEE3E7;
}
.row3 {
background-color: #D1D7DC;
}
/*
Misc
*/
hr {
height: 0px;
border: solid #D1D7DC 0px;
border-top-width: 1px;
}
/*
Forms
*/
input {
text-indent: 2px;
}
textarea, select {
border: 1px solid;
}
input, textarea, select {
color: black;
font: normal 8pt Verdana, Arial, Helvetica, sans-serif;
border-color: black;
}

View file

@ -454,7 +454,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'site_logo', 'site_logo',
), ),
'buttons' => array( 'buttons' => array(
'btn_post', 'btn_reply', 'btn_locked', 'btn_quote', 'btn_edit', 'btn_delete', 'btn_report', 'btn_post_pm', 'btn_reply_pm', 'btn_profile', 'btn_pm', 'btn_ip', 'btn_search', 'btn_email', 'btn_www', 'btn_icq', 'btn_aim', 'btn_yim', 'btn_msnm', 'btn_jabber', 'btn_online', 'btn_offline', 'btn_post', 'btn_reply', 'btn_locked', 'btn_quote', 'btn_edit', 'btn_delete', 'btn_report', 'btn_post_pm', 'btn_reply_pm', 'btn_profile', 'btn_pm', 'btn_info', 'btn_search', 'btn_email', 'btn_www', 'btn_icq', 'btn_aim', 'btn_yim', 'btn_msnm', 'btn_jabber', 'btn_online', 'btn_offline',
), ),
'icons' => array( 'icons' => array(
'icon_unapproved', 'icon_reported', 'icon_attach', 'icon_post', 'icon_post_new', 'icon_post_latest', 'icon_post_newest',), 'icon_unapproved', 'icon_reported', 'icon_attach', 'icon_post', 'icon_post_new', 'icon_post_latest', 'icon_post_newest',),

View file

@ -277,43 +277,42 @@ class dbal
$mtime = explode(' ', microtime()); $mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime; $totaltime = $mtime[0] + $mtime[1] - $starttime;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">'; <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
echo '<head>'; <head>
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'; <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
echo '<title>SQL Report</title>'; <meta http-equiv="Content-Style-Type" content="text/css" />
echo '<link href="' . $phpbb_root_path . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />'; <meta http-equiv="imagetoolbar" content="no" />
echo '<link href="' . $phpbb_root_path . 'adm/style/sql_report.css" rel="stylesheet" type="text/css" media="screen" />'; <title>SQL Report</title>
echo '</head>'; <link href="' . $phpbb_root_path . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
echo '<body id="errorpage">'; </head>
echo '<div id="wrap">'; <body id="errorpage">
echo ' <div id="page-header">'; <div id="wrap">
echo ' <a href="' . htmlspecialchars(preg_replace('/&explain=([^&]*)/', '', $_SERVER['REQUEST_URI'])) . '">Return to previous page</a>'; <div id="page-header">
echo ' </div>'; <a href="' . htmlspecialchars(preg_replace('/&explain=([^&]*)/', '', $_SERVER['REQUEST_URI'])) . '">Return to previous page</a>
echo ' <div id="page-body">'; </div>
echo ' <div class="panel">'; <div id="page-body">
echo ' <span class="corners-top"><span></span></span>'; <div class="panel">
echo ' <div id="content">'; <span class="corners-top"><span></span></span>
echo ' <h1>SQL Report</h1>'; <div id="content">
echo ' <table width="95%" cellspacing="1" cellpadding="4" border="0" align="center"><tr> <h1>SQL Report</h1>
<td height="40" align="center" valign="middle"><b>Page generated in ' . round($totaltime, 4) . " seconds with {$this->num_queries} queries" . (($this->cache_num_queries) ? " + {$this->cache_num_queries} " . (($this->cache_num_queries == 1) ? 'query' : 'queries') . ' returning data from cache' : '') . '</b></td> <br />
</tr><tr> <p><b>Page generated in ' . round($totaltime, 4) . " seconds with {$this->num_queries} queries" . (($this->cache_num_queries) ? " + {$this->cache_num_queries} " . (($this->cache_num_queries == 1) ? 'query' : 'queries') . ' returning data from cache' : '') . '</b></p>
<td align="center" nowrap="nowrap">Time spent on MySQL queries: <b>' . round($this->sql_time, 5) . 's</b> | Time spent on PHP: <b>' . round($totaltime - $this->sql_time, 5) . 's</b></td>
</tr></table>
<table width="95%" cellspacing="1" cellpadding="4" border="0" align="center"><tr>
<td>' . $this->sql_report . '</td>
</tr></table>';
echo ' </div>';
echo ' <span class="corners-bottom"><span></span></span>';
echo ' </div>';
echo ' </div>';
echo ' <div id="page-footer">';
echo ' Powered by phpBB &copy; ' . date('Y') . ' <a href="http://www.phpbb.com/">phpBB Group</a>';
echo ' </div>';
echo '</div>';
echo '</body>';
echo '</html>';
<p>Time spent on MySQL queries: <b>' . round($this->sql_time, 5) . 's</b> | Time spent on PHP: <b>' . round($totaltime - $this->sql_time, 5) . 's</b></p>
<br /><br />
' . $this->sql_report . '
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div>
<div id="page-footer">
Powered by phpBB &copy; ' . date('Y') . ' <a href="http://www.phpbb.com/">phpBB Group</a>
</div>
</div>
</body>
</html>';
exit; exit;
break; break;
@ -322,17 +321,22 @@ class dbal
$endtime = $endtime[0] + $endtime[1]; $endtime = $endtime[0] + $endtime[1];
$this->sql_report .= ' $this->sql_report .= '
<hr width="100%"/><br />
<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0"> <table cellspacing="1">
<thead>
<tr> <tr>
<th>Query #' . $this->num_queries . '</th> <th>Query #' . $this->num_queries . '</th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td class="row1"><textarea style="font-family:\'Courier New\',monospace;width:100%" rows="5">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td> <td class="row3"><textarea style="font-family:\'Courier New\',monospace;width:99%" rows="5" cols="10">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td>
</tr> </tr>
</table> ' . $this->html_hold . ' </table>
<p align="center">
' . $this->html_hold . '
<p style="text-align: center;">
'; ';
if ($this->query_result) if ($this->query_result)
@ -349,7 +353,7 @@ class dbal
$this->sql_report .= '<b style="color: red">FAILED</b> - ' . SQL_LAYER . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']); $this->sql_report .= '<b style="color: red">FAILED</b> - ' . SQL_LAYER . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']);
} }
$this->sql_report .= '</p>'; $this->sql_report .= '</p><br /><br />';
$this->sql_time += $endtime - $this->curtime; $this->sql_time += $endtime - $this->curtime;
break; break;
@ -373,11 +377,11 @@ class dbal
if (!$html_table && sizeof($row)) if (!$html_table && sizeof($row))
{ {
$html_table = true; $html_table = true;
$this->html_hold .= '<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"><tr>'; $this->html_hold .= '<table cellspacing="1"><tr>';
foreach (array_keys($row) as $val) foreach (array_keys($row) as $val)
{ {
$this->html_hold .= '<th nowrap="nowrap">' . (($val) ? ucwords(str_replace('_', ' ', $val)) : '&nbsp;') . '</th>'; $this->html_hold .= '<th>' . (($val) ? ucwords(str_replace('_', ' ', $val)) : '&nbsp;') . '</th>';
} }
$this->html_hold .= '</tr>'; $this->html_hold .= '</tr>';
} }
@ -412,8 +416,10 @@ class dbal
$time_db = $splittime - $endtime; $time_db = $splittime - $endtime;
$color = ($time_db > $time_cache) ? 'green' : 'red'; $color = ($time_db > $time_cache) ? 'green' : 'red';
$this->sql_report .= '<hr width="100%"/><br /><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0"><tr><th>Query results obtained from the cache</th></tr><tr><td class="row1"><textarea style="font-family:\'Courier New\',monospace;width:100%" rows="5">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td></tr></table><p align="center">'; $this->sql_report .= '<table cellspacing="1"><thead><tr><th>Query results obtained from the cache</th></tr></thead><tbody><tr>';
$this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed [cache]: <b style="color: ' . $color . '">' . sprintf('%.5f', ($time_cache)) . 's</b> | Elapsed [db]: <b>' . sprintf('%.5f', $time_db) . 's</b></p>'; $this->sql_report .= '<td class="row3"><textarea style="font-family:\'Courier New\',monospace;width:99%" rows="5" cols="10">' . preg_replace('/\t(AND|OR)(\W)/', "\$1\$2", htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n", $query))) . '</textarea></td></tr></tbody></table>';
$this->sql_report .= '<p style="text-align: center;">';
$this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed [cache]: <b style="color: ' . $color . '">' . sprintf('%.5f', ($time_cache)) . 's</b> | Elapsed [db]: <b>' . sprintf('%.5f', $time_db) . 's</b></p><br /><br />';
// Pad the start time to not interfere with page timing // Pad the start time to not interfere with page timing
$starttime += $time_db; $starttime += $time_db;

View file

@ -2612,7 +2612,11 @@ function page_footer()
} }
} }
$debug_output .= ' | <a href="' . (($_SERVER['REQUEST_URI']) ? htmlspecialchars($_SERVER['REQUEST_URI']) : "index.$phpEx$SID") . ((strpos($_SERVER['REQUEST_URI'], '?') !== false) ? '&amp;' : '?') . 'explain=1">Explain</a>'; $explain_url = $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);
$explain_url = (strpos($explain_url, '?') !== false) ? str_replace('?', $SID . '&amp;', $explain_url) : $explain_url . '?' . str_replace('?', '', $SID);
$explain_url .= ((strpos($explain_url, '?') === false) ? '?' : '&amp;') . 'explain=1';
$debug_output .= ' | <a href="' . $explain_url . '>Explain</a>';
} }
} }

View file

@ -244,7 +244,7 @@ $lang = array_merge($lang, array(
'IMG_BTN_EMAIL' => 'Send email', 'IMG_BTN_EMAIL' => 'Send email',
'IMG_BTN_SEARCH' => 'Search posts', 'IMG_BTN_SEARCH' => 'Search posts',
'IMG_BTN_WWW' => 'Website', 'IMG_BTN_WWW' => 'Website',
'IMG_BTN_IP' => 'Show IP', 'IMG_BTN_INFO' => 'Show post details',
'IMG_BTN_EDIT' => 'Edit post', 'IMG_BTN_EDIT' => 'Edit post',
'IMG_BTN_AIM' => 'AIM', 'IMG_BTN_AIM' => 'AIM',
'IMG_BTN_ICQ' => 'ICQ', 'IMG_BTN_ICQ' => 'ICQ',

View file

@ -31,7 +31,7 @@ img_btn_locked = {LANG}/btn_locked.gif*27*97
img_btn_profile = {LANG}/btn_profile.gif*20*72 img_btn_profile = {LANG}/btn_profile.gif*20*72
img_btn_pm = {LANG}/btn_pm.gif*20*72 img_btn_pm = {LANG}/btn_pm.gif*20*72
img_btn_delete = {LANG}/btn_delete.gif*20*20 img_btn_delete = {LANG}/btn_delete.gif*20*20
img_btn_ip = {LANG}/btn_ip.gif*20*20 img_btn_info = {LANG}/btn_ip.gif*20*20
img_btn_quote = {LANG}/btn_quote.gif*20*90 img_btn_quote = {LANG}/btn_quote.gif*20*90
img_btn_search = {LANG}/btn_search.gif*20*72 img_btn_search = {LANG}/btn_search.gif*20*72
img_btn_edit = {LANG}/btn_edit.gif*20*90 img_btn_edit = {LANG}/btn_edit.gif*20*90

View file

@ -21,9 +21,11 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
html { html {
font-size: 100%; font-size: 100%;
} }
body { body {
/* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */ /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */
font-family: Verdana, Helvetica, Arial, sans-serif; font-family: Verdana, Helvetica, Arial, sans-serif;
@ -39,12 +41,16 @@ body {
background-repeat: repeat-x; background-repeat: repeat-x;
padding: 0 25px 15px 25px; padding: 0 25px 15px 25px;
} }
#wrapcentre { #wrapcentre {
margin: 25px; margin: 25px;
} }
#wrapfooter { #wrapfooter {
text-align: center; text-align: center;
clear: both;
} }
#wrapnav { #wrapnav {
width: 100%; width: 100%;
margin: 0px; margin: 0px;
@ -53,15 +59,19 @@ body {
border-style: solid; border-style: solid;
border-color: #A9B8C2; border-color: #A9B8C2;
} }
#logodesc { #logodesc {
} }
#menubar { #menubar {
} }
#datebar { #datebar {
margin-top: 10px; margin-top: 10px;
} }
#findbar { #findbar {
width: 100%; width: 100%;
margin: 0px; margin: 0px;