News:

Wondering if this will always be free?  See why free is better.

Main Menu

Show Number of Errors at Top of Forum

Started by live627, January 27, 2007, 11:58:10 PM

Previous topic - Next topic

HR

OK, why doesnt this bite...

// ---- Begin modification - Errors at top of page ----
// How many errors do we have?
global $db_prefix, $context, $db_show_debug;
$result = $smcFunc['db_query']('', "
SELECT COUNT(*) AS count
FROM {$db_prefix}log_errors"
list ($context['error_log_count']) = $smcFunc['db_fetch_row']($result)
$smcFunc['db_free_result']($result));

// Are they an admin, and do they want debug mode?
// If so, turn $db_show_debug on for this page
if ($context['user']['is_admin'] && isset($_GET['show_debug']))
$db_show_debug = true;
// ---- End modification ----

I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

HR


I can explain this as simply as possible.. If I do it & implement I guarantee it.
If I do it and you implement it its a crap shoot.

Cal O'Shaw

#22
Hello,

Has this been updated for 1.1.11?  Would really like to use it.

A suggestion, if I may?  In the code added to index.php, it would be better to check to see if the user is an admin BEFORE making the db_query.  Otherwise every user is making the call, which wastes CPU.  We have to carefully watch our CPU usage, so while I would really like to have this, the unneeded queries by every member on every page is not going to sit well with TPTB.

Grazie,

Cal

live627

Thanks for the suggestion. Daniel15 gave me this mod and I have yet to update and give him credit. I will also implement your suggestion, yes most hosts limit your monthly CPU quota (sometimes tightly!)

vbgamer45

Somehow I missed this mod would have been very handy to have!!!
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

live627

I just now updated it to version 1.1... compatible with both branches of SMF

Sabre™

Awesome!
Have been using this for as long as I can remember, thanks for keeping it alive. :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Cal O'Shaw

Grazie!  Really appreciate you adding those checks!  Yes, our ISP has us on a really low load allowance and it took a lot of magic to get us under spec.

I noticed when I read the parsed code a comment about a future TODO to limit this to specific admins.  Was that something Daniel15 put in there or is that something you'd like to do?

Being able to restrict the display to a specific Admin would be nice (we have just a few, but I'm the only Tech Admin) but would you do that in the AdminCP by prompting for the idnumber(s) of the particular Admin(s)?  Don't want you going through a lot of work over something that, while nice, isn't really needed as all it does is show the error count and provide a link into the errorlog (nothing that could break the site by a newbie Admin hitting the wrong button).

Again, many thanks for picking this MOD up and making it even better!

Cal

live627

That is my note and I put it in...

Quote from: Cal O'Shaw on February 22, 2010, 10:33:09 PMwould you do that in the AdminCP by prompting for the idnumber(s) of the particular Admin(s)?

Exactly! (That feature won't be seen in the near future, though)

~DS~

#29
Useful. Simliar to Error Log Mod.
The error log link needed to be linked to the error log which it doesn't.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Sabre™

In smf2 change this line in your Modifications.english.php
$txt['error_log_inlog'] = 'in the <a href="?action=viewErrorLog;desc">error log</a>';

to
$txt['error_log_inlog'] = 'in the <a href="?action=admin;area=logs;sa=errorlog;desc">error log</a>';
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


~DS~

Sweet, now I know links can be done via Modifications.english.php. Thank you.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Sabre™

#32
My pleasure mate. :)
I also change the text style within that template also.
I like big red warnings ;)

{addition}
You may need to empty your forum cache for it to take effect.
?action=admin;area=maintain;sa=routine;activity=cleancache
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


live627

Quote from: Dismal Shadow on February 24, 2010, 12:21:39 AM
Sweet, now I know links can be done via Modifications.english.php. Thank you.

Any ol' markup can be made within the language strings, but it is not recommended :P

~DS~

Quote from: Sabre™ on February 24, 2010, 12:23:39 AM
My pleasure mate. :)
I also change the text style within that template also.
I like big red warnings ;)

$txt['error_log_inlog'] = 'in the <a href="?action=admin;area=logs;sa=errorlog;desc">error log</a>';

to this?

$txt['error_log_inlog'] = 'in the <a href="?action=admin;area=logs;sa=errorlog;desc"><FONT COLOR="F70000">error log</FONT></a>';
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

~DS~

Quote from: live627 on February 24, 2010, 12:32:35 AM
Quote from: Dismal Shadow on February 24, 2010, 12:21:39 AM
Sweet, now I know links can be done via Modifications.english.php. Thank you.

Any ol' markup can be made within the language strings, but it is not recommended :P
No? why is that?
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Sabre™

lol
Maybe you should explain why, as others new to this community and unfamiliar with the software, may think the reason is more than it is, and imagine it will bring about Total Destruction of their site. lol ;)

Warning - while you were typing 2 new replies have been posted. You may wish to review your post.

Quote from: Dismal Shadow on February 24, 2010, 12:40:19 AM
Quote from: live627 on February 24, 2010, 12:32:35 AM
Any ol' markup can be made within the language strings, but it is not recommended :P
No? why is that?

Curiosity has risen even before I could reply.. lol
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


live627

Quote from: Dismal Shadow on February 24, 2010, 12:40:19 AM
Quote from: live627 on February 24, 2010, 12:32:35 AM
Quote from: Dismal Shadow on February 24, 2010, 12:21:39 AM
Sweet, now I know links can be done via Modifications.english.php. Thank you.

Any ol' markup can be made within the language strings, but it is not recommended :P
No? why is that?

Certain tags can muss up the forum
s layout such as DIVs, some may  be security issues, such as SCRIPTs

So common sense is well worth using here :P

Sabre™

Quote from: Dismal Shadow on February 24, 2010, 12:39:56 AM
Quote from: Sabre™ on February 24, 2010, 12:23:39 AM
My pleasure mate. :)
I also change the text style within that template also.
I like big red warnings ;)

I actually

$txt['error_log_inlog'] = 'in the <a href="?action=admin;area=logs;sa=errorlog;desc">error log</a>';

to this?

$txt['error_log_inlog'] = 'in the <a href="?action=admin;area=logs;sa=errorlog;desc"><FONT COLOR="F70000">error log</FONT></a>';

Sorry mate, I actually just meant it as a broad statement.
For this mod I make the text red in the index.template.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


GohighVoltage

Does this mod change the database at all?    I installed this mod,  but then uninstalled.   I just want to know if it ads or changes anything in the database, so I can make sure it is all deleted.

Thanks!

Advertisement: