MyBB Community Forums

Full Version: Show debug for all
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can i show debug for all users?

You'd need a core file edit to do that.
Open ./inc/functions.php file and find; (around line # 17)
function output_page($contents)
{
	global $db, $lang, $theme, $plugins, $mybb;
	global $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;

	$contents = parse_page($contents);
	$totaltime = $maintimer->stop();

	if($mybb->usergroup['cancp'] == 1)
	{

and Change
$mybb->usergroup['cancp'] == 1
to
$mybb->user['uid'] != 0

Like this;
function output_page($contents)
{
	global $db, $lang, $theme, $plugins, $mybb;
	global $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;

	$contents = parse_page($contents);
	$totaltime = $maintimer->stop();

	if($mybb->user['uid'] != 0)
	{

Now all users of your forums will see debug info. (Guests are disabled though!)
I don't think this is a good idea... Wink
This is a big security risk and you shouldn't do it.
Ty, dont worry, i will disable "Advance view button", i only want to let people know if server is working fast, because server inet is very bad, but internal core procesation is high
How could one allow it for just one or two particular user groups ?
(2011-04-13, 12:01 PM)linguist Wrote: [ -> ]How could one allow it for just one or two particular user groups ?

Change;
function output_page($contents)
{
    global $db, $lang, $theme, $plugins, $mybb;
    global $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;

    $contents = parse_page($contents);
    $totaltime = $maintimer->stop();

    if($mybb->usergroup['cancp'] == 1)
    { 

to;
function output_page($contents)
{
    global $db, $lang, $theme, $plugins, $mybb;
    global $debug, $templatecache, $templatelist, $maintimer, $globaltime, $parsetime;

    $contents = parse_page($contents);
    $totaltime = $maintimer->stop();
   $group = array(3,4,6,8); // Edit these 3,4,6,8 to the Usergroup IDs you wish to allow them to see debug info.
   $groups = explode(",",$group);
    if(in_array($mybb->user['usergroup'],$groups))
    {