Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Redirect Incase of mySQL problem Details »
Redirect Incase of mySQL problem
Mod Version: 1.00, by Harley77 (Member) Harley77 is offline
Developer Last Online: Jan 2011 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 16
Released: 18 Mar 2005 Last Update: Never Downloads: 4
Not Supported  

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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

3. Replace that with


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
PhotoPlog 1337 Thumbs (Just incase basic templates bore you.) SHANE-D-PAIN vBulletin 3.5 Add-ons 84 08 Jun 2009 04:24

Comments
  #2  
Old 19 Mar 2005, 03:16
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
I was looking for something like this... thanks for sharing
__________________
God180 <--------------------- My Modified vBulletin
Reply With Quote
  #3  
Old 19 Mar 2005, 07:06
Deaths Deaths is offline
 
Join Date: Oct 2004
Real name: Arnoud Kuipers
Very nice, this is very usefull.
Reply With Quote
  #4  
Old 19 Mar 2005, 07:09
Tekton Tekton is offline
 
Join Date: Jun 2004
Real name: Jason S
It doesn't take a good coder to make a great mod
__________________
Currently: (vb3~)
Stockmarket Minigame - Discussion Threads - Secure Login BETA (IP + bit mask)

Planned for personal use:
Helpful System, Favorites, Super Announcement, Subscriptions (different), HostingCP, Team Gather, psuedo-UserCP, and Member Transfer
Reply With Quote
  #5  
Old 19 Mar 2005, 15:13
Harley77 Harley77 is offline
 
Join Date: Jul 2002
Thank you very much.

One other note, if someone want's it, its not hard to modify the testcon.php file to take the database login settings from your vb config file. I just did it this way for flexibility and make it easier to test without causing site wide dissruption.
Reply With Quote
  #6  
Old 19 Mar 2005, 16:16
Deaths Deaths is offline
 
Join Date: Oct 2004
Real name: Arnoud Kuipers
Originally Posted by Harley77
Thank you very much.

One other note, if someone want's it, its not hard to modify the testcon.php file to take the database login settings from your vb config file. I just did it this way for flexibility and make it easier to test without causing site wide dissruption.
I'm 99% sure this should so it, haven't tested though.
Attached Files
File Type: txt testcon.txt (462 Bytes, 23 views)
Reply With Quote
  #7  
Old 20 Mar 2005, 04:54
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
A better solution that will work on any page.

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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

3. Replace that with

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This will redirect users on any page, if the the DB connection could not be established.

All of the methods in the above posts's are redundant as they are trying to establish a "second" db connection. All that is going to do is slow down your pages on every load, and increase your mysql load by increasing its connections.

Last edited by Trigunflame; 20 Mar 2005 at 05:00.
Reply With Quote
  #8  
Old 21 Mar 2005, 14:36
Harley77 Harley77 is offline
 
Join Date: Jul 2002
Ah ha! new there was a better way. Curious though, would this method redirect on any kind of SQL issue such as conneciton limit reached (server side, not though VB), or any other failure to connect to the server and not just on an outright connection failure?
Reply With Quote
  #9  
Old 21 Mar 2005, 16:22
Deaths Deaths is offline
 
Join Date: Oct 2004
Real name: Arnoud Kuipers
My method, or his?
Reply With Quote
  #10  
Old 21 Mar 2005, 16:38
Harley77 Harley77 is offline
 
Join Date: Jul 2002
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.
Reply With Quote
  #11  
Old 21 Mar 2005, 17:07
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Real name: Dusty Burns
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
  #12  
Old 21 Mar 2005, 17:32
Harley77 Harley77 is offline
 
Join Date: Jul 2002
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
  #13  
Old 23 Mar 2005, 17:12
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Thanks Trigunflame

/me udpates
__________________
God180 <--------------------- My Modified vBulletin
Reply With Quote
  #14  
Old 29 Mar 2005, 21:44
halgrunwell halgrunwell is offline
 
Join Date: Dec 2004
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
  #15  
Old 29 Mar 2005, 22:33
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
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..
__________________
God180 <--------------------- My Modified vBulletin
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 20:39.

Layout Options | Width: Wide Color: