Problem with spiders SOLVED

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.6.00 out of 6 based on 1 vote(s)
GK User
Thu Mar 25, 2010 4:26 pm
We have solved problems with web spiders in our 4 last templates: Memovie, Hewahoo, The World News and Quay.

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; ?>
User avatar
Administrator

GK User
Thu Mar 25, 2010 4:34 pm
Thanks a lot, this is surely very usefull... :)
User avatar
Fresh Boarder

GK User
Fri Mar 26, 2010 6:24 pm
Thanks for the quick fix.

regards,
mark.
User avatar
Fresh Boarder

GK User
Wed Aug 31, 2011 10:16 pm
And how do we proceed in joomla 1.7. I have problem with spiders in app site templete.
URL: www.virecodesign.ro
User avatar
Platinum Boarder


cron