Posted by rowan Thu 16th Jun 2005 15:34 - Syntax is PHP - 1274 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported the following syntax error in this post:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in post on line 65
Description:
sorr7y forgot to hightlight, would this be the correct way to add new bots or
RSS readers to the phpowebtrace. thx for any help.

  1. // set mime types for filetrace
  2. // add mime types here for any document type you wish to track
  3. $mimetype = array(
  4. // document types
  5. 'doc' => 'application/msword',
  6. 'jpg' => 'image/jpeg',
  7. 'pdf' => 'application/pdf',
  8. 'txt' => 'text/plain',
  9. 'xls' => 'application/vnd.ms-excel',
  10. // compressed file types
  11. 'exe' => 'application/octet-stream',
  12. 'tar' => 'application/x-tar',
  13. 'zip' => 'application/zip',
  14. 'gz' => 'application/x-gzip',
  15. 'torrent' => 'application/x-bittorrent',
  16. // multimedi files
  17. 'avi' => 'video/x-msvideo',
  18. 'mp3' => 'audio/mpeg',
  19. 'mpe' => 'video/mpeg',
  20. 'mpg' => 'video/mpeg',
  21. 'mpeg' => 'video/mpeg'
  22. );
  23.  
  24. // search engine referer urls
  25. $engines = array(
  26. 'www.alexa.com' => 'Alexa',
  27. 'www.alltheinternet.com' => 'All the Internet',
  28. 'alltheweb.com' => 'AlltheWeb.com',
  29. 'www.altavista.com' => 'AltaVista',
  30. 'aolsearch.aol.com' => 'AOL Web Search',
  31. 'search.aol.com' => 'AOL Web Search',
  32. 'web.ask.com' => 'Ask Jeeves',
  33. 'search.dmoz.org' => 'DMOZ',
  34. 'www.dogpile.com' => 'Dogpile',
  35. 'search.earthlink.net' => 'EarthLink',
  36. 'www.entireweb.com' => 'Entireweb',
  37. 'euroseek.com' => 'Euroseek.com',
  38. 'msxml.excite.com' => 'Excite',
  39. 'www.gigablast.com' => 'Gigablast',
  40. 'www.google.com' => 'Google',
  41. 'www.google.co.uk' => 'Google', // UK
  42. 'www.hotbot.com' => 'HotBot',
  43. 'search.info.com' => 'Info.uk',
  44. 'search.iwon.com' => 'iWon',
  45. 'search.looksmart.com' => 'LookSmart',
  46. 'search.lycos.co.uk' => 'Lycos',
  47. 'www.metacrawler.com' => 'MetaCrawler',
  48. 'search.msn.com' => 'MSN Search',
  49. 'search.msn.co.uk' => 'MSN Search', // UK
  50. 'sea.search.msn.co.uk' => 'MSN Search', // UK
  51. 'search.netscape.com' => 'Netscape Search',
  52. 'www.overture.com' => 'Overture',
  53. 'www.search.com' => 'Search.com',
  54. 's.teoma.com' => 'Teoma',
  55. 'search.thunderstone.com' => 'Thunderstone',
  56. 'search.viewpoint.com' => 'Viewpoint',
  57. 'msxml.webcrawler.com' => 'WebCrawler',
  58. 'www.wisenut.com' => 'WiseNut',
  59. 'yell.com' => 'Yell.com',
  60. 'search.yahoo.com' => 'Yahoo!',
  61. 'uk.search.yahoo.com' => 'Yahoo!', // UK
  62. 'br.busca.yahoo.com' => 'Yahoo!', // Brazil
  63. 'www.zeal.com' => 'Zeal.com'
  64. 'www.pubsub.com' => 'PubSub-RSS-Reader/1.1'
  65. 'www.syndic8.com' => 'Syndic8/1.0',
  66. );
  67.  
  68. // search engine "start of query" markers
  69. $keymark = array(
  70. 'Alexa' => 'q=',
  71. 'All the Internet' => 'q=',
  72. 'AlltheWeb.com' => 'q=',
  73. 'AltaVista' => 'q=',
  74. 'AOL Web Search' => 'query=',
  75. 'Ask Jeeves' => 'q=',
  76. 'DMOZ' => 'search=',
  77. 'Dogpile' => 'web/',
  78. 'EarthLink' => 'q=',
  79. 'Entireweb' => 'q=',
  80. 'Euroseek.com' => 'string=',
  81. 'Excite' => 'web/',
  82. 'Gigablast' => 'q=',
  83. 'Google' => 'q=',
  84. 'HotBot' => 'query=',
  85. 'iWon' => 'searchfor=',
  86. 'LookSmart' => 'qt=',
  87. 'MetaCrawler' => 'web/',
  88. 'Mirago' => 'qry=',
  89. 'MSN Search' => 'q=',
  90. 'Netscape Search' => 'query=',
  91. 'Overture' => 'Keywords=',
  92. 'Search.com' => 'q=',
  93. 'Teoma' => 'q=',
  94. 'Thunderstone' => 'q=',
  95. 'Viewpoint' => 'k=',
  96. 'WebCrawler' => 'web/',
  97. 'WiseNut' => 'q=',
  98. 'Yahoo!' => 'p=',
  99. 'Zeal.com' => 'keyword=',
  100. 'Lycos' => 'query=',
  101. 'Info.uk' => 'query=',
  102. );
  103.  
  104. // search bots and crawler client string markers
  105. $bots = array(
  106. 'AltaVista' => 'AltaVista',
  107. 'Ask Jeeves' => 'Ask Jeeves',
  108. 'Entireweb' => 'Speedy_Spider',
  109. 'Excite' => 'ArchitextSpider',
  110. 'FAST-WebCrawler' => 'AlltheWeb.com',
  111. 'Gigablast' => 'Gigabot',
  112. 'Google' => 'Googlebot',
  113. 'LookSmart' => 'Martini',
  114. 'LookSmart' => 'Zyborg', // Looksmart link check bot
  115. 'Mirago' => 'HenryTheMiragoRobot',
  116. 'MSN Search' => 'msnbot',
  117. 'Teoma' => 'teomaagent',
  118. 'Thunderstone' => 'T-H-U-N-D-E-R-S-T-O-N-E',
  119. //'WiseNut' => 'http://www.WISEnutbot.com',
  120. 'Yahoo!' => 'Yahoo!',
  121. 'Yell.com' => 'Yell Weblinks Checker',
  122. 'Zeal.com' => 'zealbot'
  123. 'pubsub.com' => 'PubSub-RSS-Reader/1.1' //RSS Readers//
  124. 'www.syndic8.com' => 'Syndic8/1.0', //RSS Readers//,
  125. );
  126.  
  127. // determine web browser *** DO NOT CHANGE ORDER OF Opera and MSIE ***
  128. function findbrowser($client) {
  129.     if(substr_count($client, 'Opera')) { $browser = 'Opera'; }
  130.     elseif(substr_count($client, 'Avant Browser')) { $browser = 'Avant Browser'; }
  131.     elseif(substr_count($client, 'MSIE')) { $browser = 'MSIE'; }
  132.     elseif(substr_count($client, 'Netscape')) { $browser = 'Netscape'; }
  133.     elseif(substr_count($client, 'Safari')) { $browser = 'Safari'; }
  134.     elseif(substr_count($client, 'Firefox')) { $browser = 'Firefox'; }
  135.     elseif(substr_count($client, 'Firebird')) { $browser = 'Firebird'; }
  136.     elseif(substr_count($client, 'AOL')) { $browser = 'AOL'; }
  137.     elseif(substr_count($client, 'Konqueror')) { $browser = 'Konqueror'; }
  138.     elseif(substr_count($client, 'Camino')) { $browser = 'Camino'; }
  139.     elseif(substr_count($client, 'Thunderbird')) { $browser = 'Thunderbird'; }
  140.     elseif(substr_count($client, 'Gecko')) { $browser = 'Mozilla'; }
  141.     elseif(substr_count($client, 'Macintosh')) { $browser = 'Mac'; }
  142.     elseif(substr_count($client, 'AvantGo')) { $browser = 'AvantGo'; }
  143.     elseif(substr_count($client, 'Nautilus')) { $browser = "Nautilus"; }
  144.     elseif(substr_count($client, 'Lynx')) { $browser = "Lynx"; }
  145.     elseif(substr_count($client, 'Galeon')) { $browser = "Galeon"; }
  146.     elseif(substr_count($client, 'Mozilla')) { $browser = 'Mozilla'; }
  147.    
  148.     else { $browser = 'Unknown'; }
  149.    
  150.     return $browser;
  151. }
  152.  
  153. // determine the operating system
  154. function findos($client) {
  155.     if(substr_count($client, 'Win')) {
  156.         if(substr_count($client, '95')) { $os = 'Windows 95'; }
  157.         elseif(substr_count($client, '98')) { $os = 'Windows 98'; }
  158.         elseif(substr_count($client, 'NT 4.0')) { $os = 'Windows NT'; }
  159.         elseif(substr_count($client, 'NT 5.0')) { $os = 'Windows 2000'; }
  160.         elseif(substr_count($client, 'Windows 2000')) { $os = 'Windows 2000'; }
  161.         elseif(substr_count($client, 'NT 5.1')) { $os = 'Windows XP'; }
  162.         elseif(substr_count($client, 'NT 5.2')) { $os = 'Windows Server 2003'; }
  163.         elseif(substr_count($client, 'NT 6.0')) { $os = 'Windows Longhorn'; }
  164.         elseif(substr_count($client, 'NT')) { $os = 'Windows NT'; }
  165.         elseif(substr_count($client, 'Windows ME')) { $os = 'Windows ME'; }
  166.     }
  167.     elseif(substr_count($client, 'Linux')) { $os = 'Linux'; }
  168.     elseif(substr_count($client, 'Unix')) { $os = 'Unix'; }
  169.     elseif(substr_count($client, 'OS X')) { $os = 'Mac OS X'; }
  170.     elseif(substr_count($client, 'Mac_PowerPC')) { $os = 'Macintosh'; }
  171.     elseif(substr_count($client, 'Macintosh')) { $os = 'Macintosh'; }
  172.     elseif(substr_count($client, 'FreeBSD')) { $os = 'FreeBSD'; }
  173.     else { $os = 'Unknown'; }
  174.    
  175.     return $os;
  176. }
  177. ?>

PermaLink to this entry https://pastebin.co.uk/23
Posted by rowan Thu 16th Jun 2005 15:34 - Syntax is PHP - 1274 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers