Quote:
Originally Posted by RenatoMN
Yes. Sorry for not asking or better explaining this.
Leave as postbit_display_start if you're not going to use it elsewhere, or try another location, like global_start if you're going to use it widely in your boards.
|
Hi RenatoMN!
Oh! No need to apologize. Your code worked fine. Here is final version I used:
PHP Code:
// bots list ([] = add a new item in the end of an array)
$hide_content_agent_list[] = "GoogleBot";
$hide_content_agent_list[] = "Mediapartners-Google";
// get the user agent
$hide_content_useragent = $_SERVER['HTTP_USER_AGENT'];
// the default is true, false for bots (<else />)
$show_for_humans = TRUE;
foreach($hide_content_agent_list as $hcag) {
if (preg_match("/$hcag/i", "$hide_content_useragent")) {
$show_for_humans = FALSE;
break;
}
}
I may add some more bots later. Thanks again! This is very useful for everyone.