vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Integration with vBulletin - Perfect 404 Error Page (https://vborg.vbsupport.ru/showthread.php?t=224936)

Arcade Fire 10-09-2009 10:00 PM

Perfect 404 Error Page
 
1 Attachment(s)
Hi!

This is my first mod.

The common 404 error page, makes visitors close our website since it has no navigation. In this way we lose many users as our url has been changed wen remove vBseo, tFseo or other causes.

The modification is simple, create an error page with the internal browser and offer a google search box.

Step 1 - Add New Template
Title: custom_404

Template:

PHP Code:

$stylevar[htmldoctype]
<
html dir="$stylevar[textdirection]lang="$stylevar[languagecode]">
<
head>
<
title>$vboptions[bbtitle]</title>
$headinclude
</head>
<
body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
<
tr>
    <
td class="tcat">The requested URL was not found on this server.</td>
</
tr>
<
tr>
    <
td class="alt1">
<
script type="text/javascript">
  var 
GOOG_FIXURL_LANG 'en';
  var 
GOOG_FIXURL_SITE 'http://YourSite.com';
</
script>
<
script type="text/javascript" 
    
src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>

<
dd><LI>Back to <A HREF="http://YourSite.com"><b>home page</b></A></dd>

<
br><br>   
  

<
dd><LI><script type="text/javascript"><!--
google_ad_client "pub-***********YOUR ID***********";
/* 728x15, creado 13/02/09 */
google_ad_slot "9714452317";
google_ad_width 728;
google_ad_height 15;
//-->
</script>
<
script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</
script></dd>

</
td>
</
tr>
</
table>

$footer
</body>
</
html

Edit:
  • http://YourSite.com - change for the url of your website two times
  • google_ad_client = "pub-***********YOUR ID***********"; Enter your PUB number or delete the following if you want to display advertising
PHP Code:

<br><br>   
  

<
dd><LI><script type="text/javascript"><!--
google_ad_client "pub-***********YOUR ID***********";
/* 728x15, creado 13/02/09 */
google_ad_slot "9714452317";
google_ad_width 728;
google_ad_height 15;
//-->
</script>
<
script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</
script></dd

Step 2 - Upload 404.php file

Up the attachment to the root of your forum.


Step 3 - Add or change your .htaccess

If you have the file, add the following:

PHP Code:

ErrorDocument 404 http://YourSite.com/404.php 

if you do not, you can upload the attachment or create it with this content.


.................................................. .........................

Try to work accessing a non existing url
Example: http://www.YourSite.com/tsdsd


DEMO: Sorry, Remove.

INFO: http://www.google.com/support/webmas...41&ctx=sibling



Greetings!

Sorry about my English and if this mod is too simple :p

History:

Update 1: #16

XHTML Valid [Whithout tables]

https://vborg.vbsupport.ru/external/2009/11/50.jpg

Michael1337 10-10-2009 09:46 AM

Looks nice, gratz on first Mod (:

Medtech 10-10-2009 04:23 PM

Thanks!!:)

PixelFx 10-10-2009 04:40 PM

thanks

segwayon 10-11-2009 04:05 AM

Very nice!

Black Tiger 10-12-2009 03:13 PM

Great, I'm going to install this one, thank you! *Marked installed *

Mike08 10-14-2009 11:34 PM

Reserved to install "Hamijo"

:elrisas:

CSS59 10-15-2009 12:09 AM

looks good, I needed this!

segwayon 10-15-2009 01:19 AM

Is there any way of getting a report on what URL might have been requested in order to be redirected to this 404 page? After installing the mod I notice that the WhosOnline page will show this 404.php on occasion, and the page being viewed mentions 'Unknown Location.'

UPDATE: I notice that the online.php page gets listed as this 'Unknown Location -- forum/404.php' within the Who'sOnline. It will list myself as viewing the 404.php page, while I'm actually viewing the online.php page. Any idea on how to fix this bug?

Update2: Could the reason that the online.php page is being erroneously marked as 'Unknown Location - 404.php' is because my online.php page contains some modifications to its template?

Update3: Uninstalled. Hope everyone else's 404 mod is working okay. It looked very nice and did its job, but would cause erroneous 404 markers in the Who's Online page. If it gets a fix I'll be happy to revisit it.

Arcade Fire 11-01-2009 11:30 AM

Who's Online Modification

If you want to show who is browsing this new page of yours, just open up includes/functions_online.php and find:
Code:

case 'bugs.php':
        $userinfo['activity'] = 'bugs';
        break;


Below, add:
Code:

case '404.php':
        $userinfo['activity'] = '404 page';
        break;




Then find:
Code:

case 'modcplogin':
            $userinfo['action'] = $vbphrase['moderator_control_panel_login'];
            break;


Below add:
Code:

case 'custom_404':
            $userinfo['action'] = 'Viewing Error Page';
            break;



All times are GMT. The time now is 02:41 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01166 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete