Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Custom HTTP Error Pages Details »»
Custom HTTP Error Pages
Version: 2.1.3, by JJR512 JJR512 is offline
Developer Last Online: Jun 2006 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 10-11-2005 Last Update: 10-27-2005 Installs: 60
Uses Plugins Template Edits
Additional Files  
No support by the author.

This is a re-write of a hack I made for vBulletin 2.x.

What this hack does is use vBulletin to generate HTTP error pages (such as the 404 - Not Found error). For those of you trying to get an all-vB-based-site, this addition will help complete your quest. Also for anyone who wants a nicer looking HTTP error message than the standard blah.

Note: Your website needs to be on a server that uses a .htaccess file, a file located in your root public directory. This may only be servers using the Apache HTTP server, I'm not sure if any other HTTP server, like Microsoft IIS, uses that or not. Some more notes on this are included in the instructions.txt file.

There are no vB files to modify. There is one file to upload, and one product to install, which will install several new templates and two plugins. The plugins are for Who's Online display. The templates contain the actual messages. No existing templates are modified.

Special thanks to KirbyDE for showing me how to group templates using a plugin rather than a code modification.

This hack has now been re-written to use phrases. If you have a previous version, here's what you can do to upgrade.
1. Upload the new httperror.php file.
2. Add the product-jjr512_httperr.xml, overwriting the existing. (All old non-used templates should be removed automatically. This version uses only two templates: HTTP_ERROR and http_error_bit.)

Supporters / CoAuthors

Show Your Support

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

Comments
  #22  
Old 10-14-2005, 12:28 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've gone to your board and saw one or two people apparently on an error page, just as you've said. But I have no way to know what they're really doing. Have you spoken to the people and confirmed that they definitely did not ever see an error page?

I've looked at my own board, and didn't see anyone on an error page. As far as I can tell, I'm using the exact same code in the two plugins to add a new online location as many other hacks use. It's still possible there's something wrong, but I don't know what it could be yet.

If you're absolutely, positively sure these people haven't really been seeing error pages, try disableing the two plugins (in the Plugin Manager in the AdminCP, uncheck the active status of the plugins "Cutom Error Page (Online Location Process)" and "Cutom Error Page (Online Location Unknown)", then watch for a while and see what happens.
Reply With Quote
  #23  
Old 10-14-2005, 01:14 PM
Avalon111 Avalon111 is offline
 
Join Date: Dec 2004
Location: Austria
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JJR512
I've gone to your board and saw one or two people apparently on an error page, just as you've said. But I have no way to know what they're really doing. Have you spoken to the people and confirmed that they definitely did not ever see an error page?
in my screenshot before you see a user called koschel. i have been talking with him when he was display with showing http error message in who is online. he told me that he has no http error on his screen he was watching the who is online page.

Today i have opened the who is online and my location was displayed as HTTP Error Page (see the screenshot my name is infinityloop). i have tried to refresh without any changes.

Quote:
Originally Posted by JJR512
If you're absolutely, positively sure these people haven't really been seeing error pages, try disableing the two plugins (in the Plugin Manager in the AdminCP, uncheck the active status of the plugins "Cutom Error Page (Online Location Process)" and "Cutom Error Page (Online Location Unknown)", then watch for a while and see what happens.
I will try that when i get home today. thank you very much for your help!
Reply With Quote
  #24  
Old 10-14-2005, 02:08 PM
Avalon111 Avalon111 is offline
 
Join Date: Dec 2004
Location: Austria
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have tried to deactivated the plugins. i have opened the Who is online and watched it for about 15 minutes. i have been using "reload this page" to update it. after such a reload i was suddenly displayed with location: unknown viewing forums/httperror.php?e=404

using reload had no effect!

i think the problem is caused by vbulletin or my host. not by this modification!

My Host is using a loadbalancer thats why i have to use
$_SERVER['HTTP_X_REMOTECLIENT_IP'] instead off $_SERVER['REMOTE_ADDR']
could that cause my problem?

anyone knows how vbulletin is determing the location of the users?
Reply With Quote
  #25  
Old 10-14-2005, 02:16 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Moved to Extensions
Reply With Quote
  #26  
Old 10-14-2005, 02:51 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Avalon111
i have tried to deactivated the plugins. i have opened the Who is online and watched it for about 15 minutes. i have been using "reload this page" to update it. after such a reload i was suddenly displayed with location: unknown viewing forums/httperror.php?e=404

using reload had no effect!

i think the problem is caused by vbulletin or my host. not by this modification!

My Host is using a loadbalancer thats why i have to use
$_SERVER['HTTP_X_REMOTECLIENT_IP'] instead off $_SERVER['REMOTE_ADDR']
could that cause my problem?

anyone knows how vbulletin is determing the location of the users?
Those settings, the $_SERVER..., I don't know anything about those, I don't even know where they are or what they're for. Sorry. I also don't know anything about loadbalancing.

Since you've deactivated the plugin, you can see that the user is actually looking at the error page. But you say the user says he hasn't seen the error page. So I don't know what the problem is. It could be that vBulletin is being tricked into thinking the user is on the error page when he isn't. But I don't know anything about how vBulletin determines where a user is, so I don't know how that could be, or how to prevent it.

Is anyone else experiencing a similar issue after installing this hack? Let us know.
Reply With Quote
  #27  
Old 10-14-2005, 04:41 PM
Avalon111 Avalon111 is offline
 
Join Date: Dec 2004
Location: Austria
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE=JJR512]Those settings, the $_SERVER..., I don't know anything about those, I don't even know where they are or what they're for. Sorry. I also don't know anything about loadbalancing.[QUOTE]
my host told me that i have to use $_SERVER['HTTP_X_REMOTECLIENT_IP'] in all php scripts to determin the ip adresses of the visitors. otherwise vbulletin shows the ip from the loadbalancing server as ip fron the users.

i had to edit the
includes\class_core.php

Quote:
Originally Posted by JJR512
It could be that vBulletin is being tricked into thinking the user is on the error page when he isn't.
Yes i believe thats my problem. i have visited the Who is online quite rarely befoe i installed you modification. i am sure this issue was allready there before.
Reply With Quote
  #28  
Old 10-14-2005, 05:12 PM
Avalon111 Avalon111 is offline
 
Join Date: Dec 2004
Location: Austria
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

update!

when i remove the changes in the .htaccess the problem is gone!
Reply With Quote
  #29  
Old 10-14-2005, 05:43 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kirby (or anyone else): Can you use a variable as part of a phrase name?

I have created a bunch of phrases called error_title_400, _401, _403, etc. Rather than creating a long if...else...else...else... statement to call each phrase by its full name, I'd like to just use one statement to call the phrase, using the value of $e as part of the name.

I have tried both
Code:
	$error['title'] = construct_phrase($vbphrase['error_title_' . $e]);
and
Code:
	$error['title'] = construct_phrase($vbphrase['error_title_$e']);
But neither worked.

I also tried both without the contruct_phrase function being used (when is it appropriate to use that function and when shouldn't it be used?).

Is there a way to do this?
Reply With Quote
  #30  
Old 10-14-2005, 08:16 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please disregard the previous question. The problem was that I hadn't told the script to use the new phrases.
Reply With Quote
  #31  
Old 10-14-2005, 08:38 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
$error['title'] = construct_phrase($vbphrase['error_title_' . $e]);
Is wrong. Try:

Code:
$error['title'] = construct_phrase($vbphrase["error_title_$e"]);
Or if that doesn't work,

Code:
$errorvar = 'error_title_' . $e;
$error['title'] = construct_phrase($vbphrase["$errorvar"]);
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 08:06 PM.


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.05306 seconds
  • Memory Usage 2,315KB
  • Queries Executed 26 (?)
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
  • (4)bbcode_code
  • (5)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
  • (4)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