vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Limit Database Error Mails (https://vborg.vbsupport.ru/showthread.php?t=97213)

Marco van Herwaarden 09-29-2005 10:00 PM

Limit Database Error Mails
 
Hack: Limit Database Error Mails
Version: v1.00
Author: MarcoH64 for vBulletin.org
vB Version: 3.5.0
File edits: 1 + 1 (config.php)

Disclaimer:
This hack may not be modified or distributed without the explicit permission of the author. The author don't take responsibility for
any problems caused by this modification.

Description:
With this hack installed you can limit the number of emails sent to your technical mail address in case of Database Errors.
You can specify an interval in seconds between sending mails. All errors generated after the first error, until interval is passed,
are not mailed.

Optionally you can specify a different interval for different types of errors.

Operating system files will be used to keep track of the last mail sent. These will be zero byte files, so won't take any space.

Donations?
If you like this work and want to make a donation, your gifts are always welcomed at Paypal: marcoh64@gmail.com

PS No screenshots!! :D

SAngove 09-30-2005 10:05 AM

I will have a look at this, as i get quite frustrated to see my inbox full of db error emails ;)

Thanks in Advance.

reteep 09-30-2005 10:39 AM

Oh YEA, this feature should be a default feature for vBulletin.. thanks!

Marco van Herwaarden 09-30-2005 11:10 AM

Then please click install ;)

Edit: Oops you just did :D

jugo 09-30-2005 02:46 PM

Thanks Marco...this rocks.

Does anyone have a plugin / solution for this: I want to not display the ugly database error when the DB is down on non-vb pages where global.php is included.

Marco van Herwaarden 09-30-2005 02:55 PM

Quote:

Originally Posted by jugo
Thanks Marco...this rocks.

Does anyone have a plugin / solution for this: I want to not display the ugly database error when the DB is down on non-vb pages where global.php is included.

In includes/class_core.php, find:
PHP Code:

   eval('$message = "' str_replace('"''\"'file_get_contents(DIR '/includes/database_error_page.html')) . '";');
   die(
$message); 

And replace by:
PHP Code:

   eval('$message = "' str_replace('"''\"'file_get_contents(DIR '/includes/database_error_page.html')) . '";');
   if (
VB_AREA != 'NonVB')
   {
    die(
$message);
   } 

Then in the top of your non vb page script:
PHP Code:

define('VB_AREA''NonVB'); 

PS This is not tested.

jugo 09-30-2005 06:20 PM

Thanks Marco...that gave me a whole bunch of other ideas.

They should put a hook there.

Marco van Herwaarden 09-30-2005 08:06 PM

Yes i agree, and i don't agree.

This is a crucial part of the code and will get executed in case of database errors.

No Database = No plugins to be executed = Hooks are useless.

Guest190829 10-01-2005 01:08 AM

Go Go Marco, this is really something I need. I'm sick of database error emails on my test board.

/me installs

Marco van Herwaarden 10-01-2005 05:08 AM

Well on your testboard, you can simply remove the tech email from the config.php. You won't get any mails at all.


All times are GMT. The time now is 06:05 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01237 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete