02/08/05

Grots update

Permalink 03:24:04 pm, Categories: Programming, 321 words  

Grots (my custom CMS) has now been updated. The most obvious difference is the change from folder structure addresses to static-looking addresses. As with the previous incarnation, this is all done using Mod-Rewrite to make things easier on the end user, and hopefully make the URLs easier to remember. Other features using Mod-Rewrite (such as PermaLink style links where a download can be accessed at /Downloads/DownloadName.html) may be added later.

Most other changes are generally back-end and admin control panel related, but some of the smaller user-visible changes include decimal places on the file size of Downloads of 1-10KB or 1-10MB and more accurate counting (although still not perfect counting) of the words in the additional text of news reports. I can also now leave replies to people's comments on Downloads, which can be useful on occasion (especially when people use comments to ask questions!)

Finally, for some reason Google's Mediapartner spider keeps spidering my site recently - I don't have any ideas why, since it's supposed to spider for AdSense adverts and I don't use them. I've now updated my list of spiders to include it:

  //a simple attempt to identify if the 'user' is a real user or a spider
  function isSpider(){
    $haystack = strtolower($_SERVER['HTTP_USER_AGENT']);
    //the following needles cover Googlebot, MSNbot, Yahoo's Slurp Cat and more, using the common names, plus special catching for the Polish Szukacz and Google AdSense's Mediapartners bots
    $needles = array("bot", "slurp", "grub", "crawl", "scan", "szukacz", "mediapartners");
    foreach($needles as $n)
      {
        if (strpos($haystack, $n) !== FALSE )
	  {
	    return true;
	  }
      }
    //if we got this far then we didn't find any of the substrings so we think it isn't a spider
    return false;
  }

Please feel free to use it if you want in your PHP code (the original basis is taken from a php.net submission, I've just made it into a function and made it exit as soon as it has an answer).

Comments, Trackbacks:

No Comments/Trackbacks for this post.

Navigation