Of course every new template will have included this fix.
We have added some new code and you will have additional possibilities if you want. I want to describe two usefull tricks connected with web spiders detection.
Adding new web spiders
Our list of web spiders has ~400 web spiders, but of course it cannot be all. If you want to add new spiders please edit file GKTemplate.php (templates based on GK Framework) or gk.template.helper.php (templates based on T3 Framework) - list of spiders is located in function spider_detect:
- Code: Select all
function spider_detect()
{
// If you want more - please add selected spiders from that list:
// http://www.user-agents.org/index.shtml
$spider_list = array(
[LIST_TO_EDIT]
);
foreach ($spider_list as $spider)
{
if (eregi($spider, $_SERVER['HTTP_USER_AGENT'])) return TRUE;
}
return FALSE;
}
You have to edit elements of list in [LIST_TO_EDIT]
Hiding content before spiders
If you want to hide some parts of code before spiders you have to add that code:
- Code: Select all
<?php if(!$this->spider_detect()): ?>
[CODE TO HIDE]
<?php endif; ?>
of course if you want to show some code only for spiders you can try to use that code:
- Code: Select all
<?php if($this->spider_detect()): ?>
[CODE ONLY FOR SPIDERS]
<?php endif; ?>