Admin - executed SQL queries overlay

Allow admins to see executed SQL queries overlay
Useful for testing and optimizing query usage on website
This commit is contained in:
Znote 2021-07-24 01:56:03 +02:00
parent 9e790a71f6
commit 8f5487db2b
2 changed files with 52 additions and 2 deletions

View File

@ -673,6 +673,9 @@
'firstaccountName',
'secondaccountName',
);
// Allow admins to see executed SQL queries overlay
// Useful for testing and optimizing query usage on website
$config['admin_show_queries'] = true;
// Built-in FORUM
// Enable forum, enable guildboards, level to create threads/post in them

View File

@ -14,10 +14,57 @@
<!--
Designed By <a href="https://otland.net/members/snavy.155163/" target="_blank">Snavy</a>
-->
</footer>
</div><!-- Main container END -->
<?php
// If you are logged in as an admin, display SQL queries admin overlay
if ($config['admin_show_queries'] && user_logged_in() && is_admin($user_data)): ?>
<div id="admin-queries">
<label for="admin-toggle">Admin: Toggle Queries</label>
<input id="admin-toggle" name="admin-toggle" type="checkbox">
<div id="admin-show-queries">
<?php data_dump($accQueriesData, false, "Logged in as Admin: Showing executed SQL queries:"); ?>
</div>
</div>
<style type="text/css">
#admin-queries {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
background-color: rgb(30,33,40);
opacity: 0.94;
max-width: 95%;
max-height: 950px;
border: 1px solid #d1a233;
overflow: overlay;
}
#admin-queries pre {
margin: 0;
padding-right: 10px;
padding-bottom: 5px;
}
#admin-queries label {
user-select: none;
display: inline-block;
padding: 5px;
color: #b39062;
}
#admin-queries label:hover {
color: #e79424;
text-decoration: underline;
}
#admin-queries input,
#admin-queries #admin-show-queries,
#admin-queries br:last-of-type {
display: none;
}
#admin-queries input:checked + #admin-show-queries {
display: block;
}
</style>
<?php endif; ?>
</body>
</html>
<!--