Add 'Show Debug Information' setting to Server Settings

Started by Deprecated, October 22, 2008, 09:35:13 AM

Previous topic - Next topic

Deprecated

Link to Mod

Obsolete

Deprecated

LoLoL, the story behind this one is really funny.

I was modifying an area in ManageServer.php in spite of the comment that warned, "If you're writing a mod, it's a bad idea to add things here...." Fools rush in where wise men fear to tread, so I added a setting anyway. >:D When it didn't appear in the database smf_settings table I went hunting for it, and found it in my Settings.php file! "Hrmmm..." I thought, this ain't gonna work!

Then suddenly it dawned on me that the $db_show_settings is stored that file too. Why not just add a configuration setting for it, and then nobody has to manually edit and FTP their Settings.php file all the time? So I banged it up and my mistake became my newest mod package! :P

This is going to be GREAT for developers since you can easily turn the query debug information on and off without the edit/FTP thing. In fact I'm putting this in the "must have" category for all code developers. :)

ro3k4wa_86

   
damn I try to make this forum, but even my errors, the header written $ db_show_debug = false;?> when I uninstall, but there is still writing it and every time I change anything on the menu admin erorr how to make correct my forum??

hxxp:forum.abghot.com [nonactive]

Deprecated

Look at your Settings.php and Settings_bak.php files. It appears that one or both are a little bit garbled. Shound not contain $db_show_debug=false; Should start out with <?php at beginning of file, and end up with ?> at end of file.

LC-Designz

Thanks, I had the same prob, now I just have to get the other issues resolved

Deprecated

For anybody who has problems with this modifications I'll help you but you need to do the following:

1.) State your SMF version.

2.) Attach your ManageServer.php file to a post.

3.) Cut and paste the last few lines of your Settings.php into your post between CODE and /CODE bbcode tags.

Renissi

Thank you for your effort.. When I visit the link I read

Latest Version: 1.0
Compatible With: 1.1.6, 1.1.7, 2.0 Beta 4

1.) State your SMF version. 2.0.4

2.) Attach your ManageServer.php file to a post. I will do this later if you wish

3.) Cut and paste the last few lines of your Settings.php into your post between CODE and /CODE bbcode tags.I will do this later if you wish

Since aug 2013 I have 85 emails with the message SMF Database error: There has been a problem with the database!

This is a notice email to let you know that SMF could not connect to the database, contact your host if this continues.

The host tells me to activate the debugging in my smf2.0.4 otherwise they can't help. But I can't find debuuging in my smf forum.

Is it possible to use this mod to find this database error????

Thank you for your answer.

Deprecated

I've just returned to active SMF code development so my skills and knowledge of the code base are pretty rusty. Perhaps in a month or so I'll be current enough to help you with your problem.

roshaoar

Hello,

I was just wondering if this could be updated?

thanks

Deprecated

Suggestions will be appreciated, particularly if code is included.

My day job is soaking up too much of my time to work on open source.

Matthew K.

I was looking into what modifications you've written (again), and found this one. I've actually been thinking about doing this for SMF 2.1, but not shoving it in the footer, and making it only show for admins. Anyway, kudos for writing this already.

Deprecated

Thanks! Funny thing, I forgot I wrote this mod! I could'a been using it the last several weeks when I've been writing mods 10 hours/day 7 days/week. Sometimes it really beats reading code because it tells you which code to read!

Darn, I can see it isn't 2.0.11 compatible. I'll see if I can get the author to update it tomorrow. I sleep with him, you know? ROFL! LOL!

:D <---- STUPID SMF default smiley

Deprecated

Do you ever forget the mods you wrote? I'll have to read my signature link and see if I can find anything I need.....

Oh, Matthew? Could you please make your signature a bit bigger? I can't read it from 30 feet away! :P

live627


Deprecated

I wish I had a good chat/shout box mod I forgot I wrote. A good tagging mod would be good too but I remember I haven't written that. Yet.

Deprecated

Well, dudes and dudettes, I just updated this mod for SMF 2.0.11 and I'm currently using the great debug information it enables to develop more mod packages! :D

It should work on earlier 2.0.x versions back to the last time the devs changed ManageServer.php, but whenever that file was updated only the devs know for sure (and maybe summa youse smat axxes). ;)

If you want to help other users with SMF < 2.0.11, post what version you are using and whether this mod is compatible. If you want to help yourself, upgrade your forum to SMF 2.0.11. And you PPL who are running SMF 1.x, I have absolutely nothing to say to you.

Note that this mod adds a setting to your Settings.php, either $db_show_debug = true; if the feature is enabled (check box checked), or $db_show_debug = false; if the feature is not enabled (check box unchecked). When true this setting enables SMF's debug information features which are just fantastic for helping you debug your code.

Enjoy! :D

Deprecated

Quote from: Matthew K. on February 29, 2016, 06:37:38 PM
I was looking into what modifications you've written (again), and found this one. I've actually been thinking about doing this for SMF 2.1, but not shoving it in the footer, and making it only show for admins. Anyway, kudos for writing this already.

If you are not going to "shove it in the footer" just where are you going to shove it? And please, no anatomical references! ;)

If you want to make it show only for admins (and possibly change its location) you will be turning a trvial (but useful) mod into a big honkin' fat axx mod. And for what? You should be doing your debugging on test forum where only your admin account and maybe some test accounts exist. There is no reason to put this mod on a production forum. My advice to all is to have several test forums, and at least one of them should have the exact same mods as your production forum. Then copy your live database to its database so you can work on an exact copy of your production forum without the inconvenience of having real users.

I thought you decided you have had enough after a few zillion mods. If you wanna fix something that ain't broke, be my guest! :P

Matthew K.

Quote from: Deprecated on February 29, 2016, 08:44:31 PM
Do you ever forget the mods you wrote? I'll have to read my signature link and see if I can find anything I need.....

Oh, Matthew? Could you please make your signature a bit bigger? I can't read it from 30 feet away! :P
Yes, I barely remember what mods I wrote now, especially since I wrote many of them years ago well before I became a proficient programmer anyway.

Quote from: Deprecated on March 01, 2016, 12:56:40 PM
Quote from: Matthew K. on February 29, 2016, 06:37:38 PM
I was looking into what modifications you've written (again), and found this one. I've actually been thinking about doing this for SMF 2.1, but not shoving it in the footer, and making it only show for admins. Anyway, kudos for writing this already.

If you are not going to "shove it in the footer" just where are you going to shove it? And please, no anatomical references! ;)

If you want to make it show only for admins (and possibly change its location) you will be turning a trvial (but useful) mod into a big honkin' fat axx mod. And for what? You should be doing your debugging on test forum where only your admin account and maybe some test accounts exist. There is no reason to put this mod on a production forum. My advice to all is to have several test forums, and at least one of them should have the exact same mods as your production forum. Then copy your live database to its database so you can work on an exact copy of your production forum without the inconvenience of having real users.

I thought you decided you have had enough after a few zillion mods. If you wanna fix something that ain't broke, be my guest! :P
In another project of mine, we did a similar thing to SMF's debugging information and query log, and threw it in a modal. That way it's out of the way, unless you want to see it. A very popular design trend right now anyway as well.

Actually, a modification like this COULD be useful on a production site. Why is my load time so high? Well, it'd be nice to look at the query log and see what queries are being hit -- specifically from mods that weren't implemented wisely. And help improve their load times for their forums. That has happened a few times recently, and I had to turn it on in Settings and then back off so I could see what queries were the culprit.

Deprecated

I'll concede that there may be some situations where it could be useful in a production environment.

I've written my own content delivery system that is malleable and can deliver content similar to many other one-to-many CDS, can emulate static sites, blogs, image hosts, etc. All that, and there isn't a single HTML file on the site! All content is stored in a database. I began development about 10 years ago, and in the middle adopted many SFM conventions such as the $context[] variable and putting my database access routines in a wrapper (allowing me to note the content of queries in an array). Page loads are few (maximum page load is 4 pages to get to final display of any page) so I just throw in a bit of before and after code when a script is included. Furthermore (bragging) a single copy of my script can host an unlimited number of sites. (Each site has an index that solely sets the database parameters and initializes a sentinel scheme that ensures script pages cannot be accessed directly. Then includes the common script root in another directory.)

Although it's a very odd idea, I discovered that browsers (at least Firefox) have absolutely no problem handling a HTML page with two bodies: <BODY>....</BODY><BODY....</BODY> My CDS has a common exit() routine that is the last line of every sub-script (after the page has been fully rendered) which checks for my debug feature == enabled and is_admin == true, and adds a second body: <BODY><!-- .... --></BODY> with all my debug data, files accessed, load times, queries and access times, total rendering time... Having two bodies in an HTML page is of course totally absurd and is an affront to HDML standards, but nobody but me ever gets the second body, and I can see the debug data by viewing HTML source. It works for me! :D

Advertisement: