Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Redirect Incase of mySQL problem Details »»
Redirect Incase of mySQL problem
Version: 1.00, by Harley77 Harley77 is offline
Developer Last Online: Jan 2011 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-17-2005 Last Update: Never Installs: 16
 
No support by the author.

If someone has posted something like this before, I couldn't find it.

What this does:
It will redirect visitors to a static webpage of your choosing incase a connection to the mySQL server could not be established.

Every so often, The SQL server of our host becomes unresponsive, usually only for a few minutes, but, it's still annoying to try and load the site and have it take forver then be finally be greeted with a lovely SQL error. So, now people can get a nice friendly error page instead.

Feel free to modify and mess with it however you choose.


UPDATED


Trigunflame has provided a more elegant, sitewide solution that effectivly does the same exact thing.


Installation:

1. open includes/db_mysql.php
2. find the code below in the connect() function

Code:
if (!$this->link_id)
		{
			$this->halt('Link-ID == false, connect failed');
			return false;
		}
3. Replace that with

Code:
// Redirect For SQL Server Down
		if (!$this->link_id)
		{
			$url = 'http://narutotalk.org/';
			header ("Location: $url");
		}

Just replace the url with where ever you want it to goto.

I'm leaving the original file availible to download as it might be useful for other administrative purposes.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-21-2005, 03:07 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Harley77
His, Just wasn't sure what all errors it covered. I know that the method I put up pretty much covered all the bases incase of any kind of issue, just wasn't sure if the same was true with Trigunflames.
Well.. your covered just the index.php page, as well as deaths; which would be pointless if someone was browsing a forum/thread/post.
Not only that.. its issuing a second connection attempt, effectively doubling your total mysql connections...

The small lil mod I posted however, deals with it at the connection source inside of db_mysql. Thus every page, regardless if a connection cannot be established you are re-directed to the target location.

Modify your main post btw with the snippet I posted for peoples future reference.
Reply With Quote
  #13  
Old 03-21-2005, 03:32 PM
Harley77 Harley77 is offline
 
Join Date: Jul 2002
Location: Minnesota
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Trigunflame
Well.. your covered just the index.php page, as well as deaths; which would be pointless if someone was browsing a forum/thread/post.
Not only that.. its issuing a second connection attempt, effectively doubling your total mysql connections...

The small lil mod I posted however, deals with it at the connection source inside of db_mysql. Thus every page, regardless if a connection cannot be established you are re-directed to the target location.

Modify your main post btw with the snippet I posted for peoples future reference.
I understand where yours and mine covered in terms of forum location, I was just asking inso far as the diffrent types of sql failures, would yours cover them all. You seemed to answer that question in your post. Thanks. I'll update this post. I have a new idea now for this little script of mine, If it turns into something useful I'll post it. Thanks again.
Reply With Quote
  #14  
Old 03-23-2005, 03:12 PM
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Posts: 893
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Trigunflame

/me udpates
Reply With Quote
  #15  
Old 03-29-2005, 07:44 PM
halgrunwell halgrunwell is offline
 
Join Date: Dec 2004
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone every seen a variation of this that send a text message or email to you if the db is not connectable?
Reply With Quote
  #16  
Old 03-29-2005, 08:33 PM
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Posts: 893
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by halgrunwell
Anyone every seen a variation of this that send a text message or email to you if the db is not connectable?
well I still get email messages telling me of the database error halgrunwell... I dont know if that relates to what you are talking about..
Reply With Quote
  #17  
Old 03-31-2005, 01:26 PM
SaN-DeeP's Avatar
SaN-DeeP SaN-DeeP is offline
 
Join Date: Jun 2002
Location: Mumbai, India
Posts: 1,195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice addon.. thanks
Reply With Quote
  #18  
Old 03-31-2005, 01:35 PM
venomx's Avatar
venomx venomx is offline
 
Join Date: Apr 2002
Location: Pennsylvania USA
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This looks good but how will members know theres a problem if they auto get forwarded to a new site?
Reply With Quote
  #19  
Old 04-03-2005, 10:47 PM
-=Sniper=- -=Sniper=- is offline
 
Join Date: May 2002
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can forward them to a page instead, saying the site will be back in a bit or something like that,
Reply With Quote
  #20  
Old 04-15-2005, 08:43 PM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by venomx
This looks good but how will members know theres a problem if they auto get forwarded to a new site?
Just make up a page for your site similar to this (I have a sister site (different host) that I redirect to in-case my forums' site goes down - either the sql database or the entire server):
Server Down Message
Reply With Quote
  #21  
Old 04-18-2005, 02:13 PM
Harley77 Harley77 is offline
 
Join Date: Jul 2002
Location: Minnesota
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like mine :-)

http://www.demopolislive.com/sqldown.html
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:30 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10481 seconds
  • Memory Usage 2,306KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete