vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Hide something to spiders (https://vborg.vbsupport.ru/showthread.php?t=299512)

Scanu 06-26-2013 11:15 AM

Hide something to spiders
 
Hi everyone, vbulletin has a built-in feature that separate guests from spiders (correct me if 'm wrong). what i need is a condition to show something just to guests and not spiders, is this possible with an exsisting vb function? I know i can do this checking $_SERVER['HTTP_USER_AGENT'] but would be easier if there is something already integrated on vbulletin. Does anyone know something about this?

nhawk 06-26-2013 01:05 PM

Have a look at class_core.php. Search for 'enablespiders'. Spiders are decoded in there.

But any use of the built in vB spider system is only going to be as good as your spiders_vbulletin.xml file.

And there are so many spiders out there you'll never get them all. You're better off completely hiding things from unregistered users. Otherwise one spider will feed off of another spiders scan and the content will be picked up anyway.

Scanu 06-26-2013 01:19 PM

Thank you i'll look into it btw i know that there isn't a 100% working way but that's enough for me :)

--------------- Added [DATE]1372261362[/DATE] at [TIME]1372261362[/TIME] ---------------

I've done this simple code in parse_templates hook (this is where i need the condition)
PHP Code:

require_once(DIR '/includes/class_xml.php');
$xmlobj = new vB_XML_Parser(falseDIR '/includes/xml/spiders_vbulletin.xml');
$spiderdata $xmlobj->parse();
$spiders "";
if (
is_array($spiderdata['spider'])) {
foreach (
$spiderdata['spider'] AS $spiderling) {
$spiders .= ($spiders '|' '') . preg_quote($spiderling['ident'], '#');
}
}
unset(
$spiderdata$xmlobj);
if (
preg_match('#(' $spiders ')#si'$cleaned['useragent'])) {
                    
$cleaned['isbot'] = true;
                }
if (
$cleaned['isbot'])
echo 
'spider!';
else
echo 
'human :)'

But to be honest i'm not sure if it works.. How can i test it? :o I tried with some of web spiders simulator but i still see human..

Simon Lloyd 06-27-2013 02:51 PM

vBulletin already uses a condition <vb:if condition="!$show['search_engine']"> so anything that shows up in the spiders list gets covered by it :)

Scanu 06-28-2013 09:16 AM

Thank you very much this will be a lot easier :) i'll try it

Simon Lloyd 06-28-2013 12:14 PM

Naturally you know to remove or leave the ! depending on whether you want the condition to apply to them or not :)


All times are GMT. The time now is 09:18 AM.

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.01085 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete