|
From: Jon O. <jon...@us...> - 2007-07-09 22:38:45
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5071/linkdb/includes Modified Files: functions.php Log Message: Updated pak and tpl bug Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** functions.php 16 May 2007 19:38:06 -0000 1.17 --- functions.php 9 Jul 2007 22:38:40 -0000 1.18 *************** *** 373,377 **** * @param unknown_type $user_agent allows override of user agent string for testing. */ ! function user_info( $user_agent = '' ) { global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS; --- 373,377 ---- * @param unknown_type $user_agent allows override of user agent string for testing. */ ! function mx_user_info( $user_agent = '' ) { global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS; *************** *** 400,406 **** --- 400,464 ---- // Intentionally ignore Konquerer. It should show up as Mozilla. // post-Netscape Mozilla versions using Gecko show up as Mozilla 5.0 + // known browsers, list will be updated routinely, check back now and then if ( preg_match( '/(opera |opera\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; elseif ( preg_match( '/(msie )([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; elseif ( preg_match( '/(mozilla\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(phoenix\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(firebird\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(omniweb |omni\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(konqueror |konq\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(safari |saf\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + // covers Netscape 6-7, K-Meleon, Most linux versions, uses moz array below + elseif ( preg_match( '/(gecko |moz\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(netpositive |netp\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(lynx |lynx\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(elinks |elinks\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(links |links\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(w3m |w3m\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(webtv |webtv\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(amaya |amaya\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(dillo |dillo\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(ibrowsevibrowse |ibrowsevibrowse\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(icab |icab\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(crazy browser |ie\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(sonyericssonp800 |sonyericssonp800\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(aol )([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(camino )([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + // search engine spider bots: + elseif ( preg_match( '/(googlebot |google\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(mediapartners-google |adsense\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(yahoo-verticalcrawler |yahoo\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(yahoo! slurp |yahoo\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(yahoo-mm |yahoomm\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(inktomi |inktomi\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(slurp |inktomi\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(fast-webcrawler |fast\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(msnbot |msn\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(ask jeeves |ask\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(teoma |ask\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(scooter |scooter\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(openbot |openbot\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(ia_archiver |ia_archiver\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(zyborg |looksmart\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(almaden |ibm\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(baiduspider |baidu\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(psbot |psbot\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(gigabot |gigabot\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(naverbot |naverbot\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(surveybot |surveybot\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(boitho.com-dc |boitho\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(objectssearch |objectsearch\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(answerbus |answerbus\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(sohu-search |sohu\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(iltrovatore-setaccio |il-set\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + // various http utility libaries + elseif ( preg_match( '/(w3c_validator |w3c\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(wdg_validator |wdg\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(libwww-perl |libwww-perl\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(jakarta commons-httpclient |jakarta\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(python-urllib |python-urllib\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + // download apps + elseif ( preg_match( '/(getright |getright\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; + elseif ( preg_match( '/(wget |wget\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; else { *************** *** 433,436 **** --- 491,629 ---- break; + case 'phoenix ': + case 'firebird ': + $this->agent = 'MOZILLA'; + break; + + case 'konqueror ': + case 'konq ': + $this->agent = 'KONQUEROR'; + break; + + case 'lynx/': + case 'lynx ': + $this->agent = 'LYNX'; + break; + + case 'safari ': + case 'saf ': + $this->agent = 'SAFARI'; + break; + + case 'aol/': + case 'aol ': + $this->agent = 'AOL'; + break; + + case 'omniweb': + case 'omni ': + $this->agent = 'OTHER'; + break; + + case 'gecko ': + case 'moz ': + $this->agent = 'OTHER'; + break; + + case 'netpositive ': + case 'netp ': + $this->agent = 'OTHER'; + break; + + case 'elinks/': + case 'elinks ': + $this->agent = 'OTHER'; + break; + + case 'links/': + case 'links ': + $this->agent = 'OTHER'; + break; + + case 'w3m/': + case 'w3m ': + $this->agent = 'OTHER'; + break; + + case 'webtv/': + case 'webtv ': + $this->agent = 'OTHER'; + break; + + case 'amaya/': + case 'amaya ': + $this->agent = 'OTHER'; + break; + + case 'dillo/': + case 'dillo ': + $this->agent = 'OTHER'; + break; + + case 'ibrowsevibrowse/': + case 'ibrowsevibrowse ': + $this->agent = 'OTHER'; + break; + + case 'icab/': + case 'icab ': + $this->agent = 'OTHER'; + break; + + case 'crazy browser ': + case 'ie ': + $this->agent = 'OTHER'; + break; + + case 'camino/ ': + case 'camino ': + $this->agent = 'OTHER'; + break; + + case 'sonyericssonp800/': + case 'sonyericssonp800 ': + $this->agent = 'OTHER'; + break; + + case 'googlebot ': + case 'google ': + case 'mediapartners-google ': + case 'adsense ': + case 'yahoo-verticalcrawler ': + case 'yahoo ': + case 'yahoo! slurp ': + case 'yahoo-mm ': + case 'yahoomm ': + case 'inktomi ': + case 'slurp ': + case 'fast-webcrawler ': + case 'msnbot ': + case 'msn ': + case 'ask jeeves ': + case 'ask ': + case 'teoma ': + case 'scooter ': + case 'openbot ': + case 'ia_archiver ': + case 'zyborg ': + case 'looksmart ': + case 'almaden ': + case 'baiduspider ': + case 'baidu ': + case 'psbot ': + case 'gigabot ': + case 'naverbot ': + case 'surveybot ': + case 'boitho.com-dc ': + case 'boitho ': + case 'objectssearch ': + case 'answerbus ': + case 'sohu-search ': + case 'sohu ': + case 'iltrovatore-setaccio ': + case 'il-set ': + $this->agent = 'BOT'; + break; + case 'unknown': $this->agent = 'OTHER'; *************** *** 442,446 **** // Determine platform // This is very incomplete for platforms other than Win/Mac ! if ( preg_match( '/(win|mac|linux|unix)/', $user_agent, $matches ) ); else $matches[1] = 'unknown'; --- 635,639 ---- // Determine platform // This is very incomplete for platforms other than Win/Mac ! if ( preg_match( '/(win|mac|linux|unix|x11|freebsd|beos|os2|irix|sunos|aix)/', $user_agent, $matches ) ); else $matches[1] = 'unknown'; *************** *** 460,466 **** --- 653,688 ---- case 'unix': + case 'x11': $this->platform = 'Unix'; break; + case 'freebsd': + $this->platform = 'FreeBSD'; + break; + + case 'beos': + $this->platform = 'BeOS'; + break; + + case 'os2': + $this->platform = 'OS2'; + break; + + case 'irix': + $this->platform = 'IRIX'; + break; + + case 'sunos': + $this->platform = 'SunOS'; + break; + + case 'aix': + $this->platform = 'Aix'; + break; + + case 'palm': + $this->platform = 'PalmOS'; + break; + case 'unknown': $this->platform = 'Other'; |