vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - HTTP Error Response Codes by BOP5 (Soft 404 Solution) (https://vborg.vbsupport.ru/showthread.php?t=309415)

DemOnstar 05-21-2014 11:15 AM

I tested the urls using the site that you provided and do still show status 200.

Quote:

Originally Posted by BirdOPrey5 (Post 2498766)
You should ignore those- the robots.txt is doing what it is supposed to do.

Cheers Joe, as you say...

BirdOPrey5 05-21-2014 12:32 PM

Quote:

Originally Posted by addamroy (Post 2498767)
damn, my host's server (urljet) is using a prior version of php :(

I was all excited to install this lol

See post 46 b& 48, I have URLjet and it is working with those changes.

BirdOPrey5 05-21-2014 12:33 PM

Quote:

Originally Posted by DemOnstar (Post 2498773)
I tested the urls using the site that you provided and do still show status 200.

What URL did you test?

CAG CheechDogg 05-21-2014 02:09 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2498765)
Wow- I tested this on 3 forums (1 VB 3.8, 2 VB 4.x) and it worked fine on all 3. :up:

You should copy the code to the top of both plugins however.

Do you mind if I add the code to the plugin?

What does this exactly do BOP5? I installed this on my forums using 5.4 "then" reverted my PHP back to 5.3 since my website not my forums wont work with 5.4 ...I have an old version of Joomla as my CMS which is nicely bridged with my VB forums so using 5.4 is not even an option so I have to stick with 5.3..

Boothby 05-21-2014 02:29 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2498765)
Do you mind if I add the code to the plugin?

Joe, feel free to use this code. I see no problems not to do so. Look at the small source-link. I think this code is too generic so that everyone can use it. :)

BirdOPrey5 05-21-2014 02:46 PM

Quote:

Originally Posted by Boothby (Post 2498793)
Joe, feel free to use this code. I see no problems not to do so. Look at the small source-link. I think this code is too generic so that everyone can use it. :)

Great, thanks! Mod has been updated to version 2.0 to include this code. No longer limited to PHP 5.4.0 or higher.

Quote:

Originally Posted by CAG CheechDogg (Post 2498791)
What does this exactly do BOP5? I installed this on my forums using 5.4 "then" reverted my PHP back to 5.3 since my website not my forums wont work with 5.4 ...I have an old version of Joomla as my CMS which is nicely bridged with my VB forums so using 5.4 is not even an option so I have to stick with 5.3..

Suggest you upgrade to version 2.0. If it can work, it will work. It should not cause any errors on your site even if the code doesn't work for some reason.

The new code attempts to change the response code if it can (which isn't guaranteed on old PHP versions) but it won't bug out if it can't it just won't do anything.

addamroy 05-21-2014 03:16 PM

Saweeet.

Installed.

CAG CheechDogg 05-21-2014 03:37 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2498794)
Great, thanks! Mod has been updated to version 2.0 to include this code. No longer limited to PHP 5.4.0 or higher.

Suggest you upgrade to version 2.0. If it can work, it will work. It should not cause any errors on your site even if the code doesn't work for some reason.

The new code attempts to change the response code if it can (which isn't guaranteed on old PHP versions) but it won't bug out if it can't it just won't do anything.

Good stuff BOP5 and thanks Boothby for the addition !

Boothby 05-21-2014 06:00 PM

I looked in the whole code and I think that this small piece can give false results, when working with the custom pre-5.4 http_response_code() function:

PHP Code:

... http_response_code() != $vbo['bop5he_noperm_err'] ... 

Then I have 2 suggestions:

First I found a way to look for outdated searchids. Second maybe we should send a 503 code for forum closed and server too busy?

PHP Code:

// hook: search_before_process, only for >vB4.0
// outdated searchids
if(is_object($this) AND $this->results === null)
{
    
define('ERR_RESPONSE_CODE'410);


PHP Code:


// ERR_RESPONSE_CODE somewhere defined in the whole wide world?
if(defined('ERR_RESPONSE_CODE'))
{
    
http_response_header(ERR_RESPONSE_CODE);
}
// server to busy
else if($vbulletin->loadcache['loadavg'] > $vbulletin->options['loadlimit'])
{
    
http_response_header(503);
    
header('Retry-After: 60'); // 60 seconds is ok, isn't it?
}
// forum closed
else if(
    !
$vbulletin->options['bbactive']
        AND
    !
in_array(THIS_SCRIPT, array('login''css''mobile'))
)
{
    
http_response_header(503);
    
header('Retry-After: 3600'); // 1 hour, put this in a new option?
}
// and your original code
else if (THIS_SCRIPT == 'search')
{
    
http_response_code($vbo['bop5he_ser_err']);
}
else
{
    
http_response_code($vbo['bop5he_gen_err']);


untested :D

BirdOPrey5 05-21-2014 09:12 PM

Boothby - These are some great ideas- thanks- I will incorporate most, if not all, into the next version. I will list you as a co-author. :)

What is the logic behind this line-
PHP Code:

!in_array(THIS_SCRIPT, array('login''css''mobile' 

Why should we check what script it is on if the board is turned off?


All times are GMT. The time now is 01:18 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.01484 seconds
  • Memory Usage 1,758KB
  • 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_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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