The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||
I've made a little hack that will show custom HTTP error documents to any visitor to your site, if he or she creates the error condition. These are errors like 404 (file not found) or 500 (internal server error). I've included processing for about 23 various HTTP errors.
The error documents are templates within vBulletin, but these do not apply only to vBulletin. Any visitor to any part of your site would see the error document (if appropriate). Now obviously this means that this hack should not be used by those of you that do not allow guest/unlogged-in viewing of your board, because if a guest creates an error condition, he/she would only see the vBulletin "not logged in or no permission" message, which wouldn't be very useful. This hack also involves modifying your .htaccess file, and I believe only Apache-powered servers use that (correct me if I'm wrong). Because screwing up that file can make your site unusable, make sure you keep a backup copy of it, and if you can't find a .htaccess file in your root web directory, check with your webhost to see if they've hidden it, which is often the case. DO NOT just make a new, blank .htaccess file and upload it because you may overwrite a hidden one, potentially killing your site. As you can probably tell by now, this hack is perhaps not an appropriate choice for the complete newbie. I strongly suggest that you use this hack only if you read the directions and actually understand them; many times, people just blindly follow the instructions without a clue as to what they're doing, and usually, this is fine, but I'm warning you now, you can hurt your site if you screw this up, and if you don't know what you're doing, you won't know how to fix it if/when you do screw it up. (By now you may be asking why I'm releasing this. Well, I did it originally for my own site, and figured some others of you may like it as well. This is actually a very simple hack to install; it involves only one file mod, one new very small file, and importing one file into the db, and that's it. You may wish to modify/customize the templates as you desire. You will find them in with the regular vB templates in the section "HTTP Error Templates".) For a demo, please visit this non-existant page on my website, to show you a 404 (other errors look similar, with customized messages): http://www.jjr512.com/ddkd4iafgi8d.php Show Your Support
|
Comments |
#12
|
|||
|
|||
![]()
Tried it, ..
cpanel 4.9 lets you save as 400.shtml etc. So I just put in a meta refresh tag for 0s to redirect to the error.php and it works now very nice ![]() |
#13
|
||||
|
||||
![]() Quote:
![]() |
#14
|
||||
|
||||
![]() Quote:
|
#15
|
|||
|
|||
![]()
Run an SQL query
![]() phpMyAdmin = your best friend. |
#16
|
||||
|
||||
![]() Quote:
|
#17
|
|||
|
|||
![]()
I'd say .. read the manual.
But.. you could copy paste the content of the .sql file to the big input window and press go. it will run the query then. |
#18
|
||||
|
||||
![]()
Just a note, in the instructions it says
Quote:
|
#19
|
||||
|
||||
![]() Quote:
![]() ![]() Well, actually, when I first tested it, I wasn't getting the number to show up in the browser title bar. So I figured maybe for the variable to get parsed into the template it had to be explicitly declared, which is why I did that. But I think I just needed to refresh or something...anyway, it started working, I don't know why, but it did, and I forgot to take that part out. ![]() LouChipher: I can't release a German version myself, since I don't speak it well enough to translate it. But it should be easy, since all the language is in the templates. If anyone else wants to do it, by all means, feel free. Ian: If you can use phpMyAdmin, it's easy. You can do what xiphoid said, which is to open the file newtemplates.sql, copy the entire contents, go to phpMyAdmin, on the screen where you see the list of tables in the left pane and below that you have a text box labelled "Run SQL query/queries...", paste the contents of the file into that box, and hit the Go button. Or, an easier way is to go to that same spot in phpMyAdmin, but below that text box is a smaller field with a Browse...button, which you can use to point it to the file newtemplates.sql, then hit the Go button. That will upload the file into the server's memory and execute the instructions inside it. Takara: I'm not quite sure I understand what you're saying. Are you saying in the .htaccess file, on the ErrorDocument xxx lines, I can make the path to error.php be relative, not full? Just make it like ErrorDocument 400 forums/error.php?error=400? |
#20
|
||||
|
||||
![]()
Very nice hack, looks great. I also use the cpanel for custom error documents, so I'll have to look into xiphoid tip on integrating it
![]() |
#21
|
||||
|
||||
![]()
I believe the various cpanels that let you add custom error documents only help to automate the process. That does not (or shouldn't) exclude the ability to do it manually. If you create a custom 404 page, for example, it just saves that page for you somewhere and adds the appropriate line to .htaccess. If you can edit .htaccess manually, you can do this hack.
![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|