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
  #12  
Old 10-13-2005, 01:53 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 KirbyDE
You are right, this edit is not necessary at all

Hook template_groups
PHP Code:
$only['http_error'] = 'HTTP Errors'
Another suggestion:
Use phrases for the Text, so users can easily use it with other Languages too.
Just create a new plugin with that code as the code to that hook?

Also, regarding the templates vs. phrases issue: I originally thought to use phrases. But then I discovered you can't use variables, such as $vboptions[hometitle] in phrases. Is there a way to use variables like that in phrases? If so, I can re-write the hack. But when I put in that variable in a phrase I was testing, it just came out on the page literally, dollar sign and everything.
Reply With Quote
  #13  
Old 10-13-2005, 02:09 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Phrase with Variable:
Code:
Hello {1}, how are you?
Template using this Phrase:
Code:
<phrase 1="$bbuserinfo[username]">$vbphrase[hello_x_how_are_you]</phrase>
Yes, just make a plugin with this Code and the Templates will be grouped.
Reply With Quote
  #14  
Old 10-13-2005, 03:24 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have updated the hack to include the new plugin provided by KirbyDE. The instructions have been updated. No vBulletin file modifications are necessary. (I copied that file mod from some other hacks that group templates the same way. Now I know it's not necessary to do it like that, and I'll probably create plugins like this for other hacks I've installed and return that file to its stock form.)

Due to the small change in method, the hack is now 2.0.1. This version does not include any phrases as KirbyDE has suggested. It will take me a short while to get all that done and tested, at which point we will probably have 2.1.0.

If you have already installed 2.0.0, and are going to upgrade to 2.0.1, simply do this: Removed the modification to your adminfunctions_template.php file, and add the product again, making sure to overwrite the existing version.
Reply With Quote
  #15  
Old 10-13-2005, 03:26 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 KirbyDE
Phrase with Variable:
Code:
Hello {1}, how are you?
Template using this Phrase:
Code:
<phrase 1="$bbuserinfo[username]">$vbphrase[hello_x_how_are_you]</phrase>
Yes, just make a plugin with this Code and the Templates will be grouped.
Can you use {1} more than once in a phrase; for example, have the phrase be:
Code:
Hello, {1}! How are you today, {1}?
And the template would still be exactly the same as in your current example?
Reply With Quote
  #16  
Old 10-13-2005, 03:31 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 Dark Visor
'e' should be a TYPE_UINT.
I think this is probably going just slightly beyond what I know about. How would I make this change, and why is it important? For my education and future reference.

I have another hack I may release soon that's also going to be using a variable through the URL in the same way that $e is used here. However, in this other hack, the value of the variable, $p, will be some text, like file.php?p=something. What should I define that as and how?
Reply With Quote
  #17  
Old 10-13-2005, 03:33 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wait, I think I answered my own question...

In the httperror.php file, the line
Code:
	'e'	=> TYPE_STR
should be
Code:
	'e'	=> TYPE_UINT
Is that correct?

(But in the other hack I mentioned, where $p is some text, leave it set to TYPE_STR, right?)
Reply With Quote
  #18  
Old 10-13-2005, 06:11 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, thanks for the hack.
Reply With Quote
  #19  
Old 10-13-2005, 06:21 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that is correct.
You might want to read my tutorial, it describes what are the clean variable types in vBulletin.

Basically, since you are passing an integer through the "e" variable, you should force the integer type on it, but it's just for security's sake
Reply With Quote
  #20  
Old 10-13-2005, 07:27 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated to 2.0.2 based on code change suggested by Dark Visor.

If you have 2.0.1, make the change as described in post# 16 above and upload the modified httperror.php file.

If you have 2.0.0, basically do what is in post# 13 above (undo the modification to adminfunctions_template.php, then re-add the product, overwriting the existing version), PLUS upload the new httperror.php file.
Reply With Quote
  #21  
Old 10-14-2005, 05:09 AM
Avalon111 Avalon111 is offline
 
Join Date: Dec 2004
Location: Austria
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have noticed that members who are not viewing a error page are listed as viewing error page in Who is online.
i have been talking with one member who has told me that.

could that be caused by this modification?
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:12 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.04537 seconds
  • Memory Usage 2,316KB
  • 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
  • (7)bbcode_code
  • (1)bbcode_php
  • (3)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
  • (3)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