|
From: Jon O. <jon...@us...> - 2007-07-09 22:40:47
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6655/pafiledb/includes Modified Files: functions.php functions_pafiledb.php Log Message: Updated pak and tpl bug New OS icons and Orys fixes Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** functions.php 16 May 2007 19:41:22 -0000 1.35 --- functions.php 9 Jul 2007 22:40:05 -0000 1.36 *************** *** 782,786 **** * @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; --- 782,786 ---- * @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; *************** *** 809,815 **** --- 809,873 ---- // 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 { *************** *** 842,845 **** --- 900,1038 ---- 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'; *************** *** 851,855 **** // 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'; --- 1044,1048 ---- // 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'; *************** *** 869,875 **** --- 1062,1097 ---- 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'; Index: functions_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** functions_pafiledb.php 3 Jun 2007 20:42:21 -0000 1.46 --- functions_pafiledb.php 9 Jul 2007 22:40:09 -0000 1.47 *************** *** 1599,1604 **** if ( !$db->sql_numrows( $result ) ) { ! $sql = "INSERT INTO " . PA_VOTES_TABLE . " (user_id, votes_ip, votes_file, rate_point) ! VALUES('" . $userdata['user_id'] . "', '" . $ipaddy . "', '" . $file_id . "','" . $rating . "')"; if ( !( $db->sql_query( $sql ) ) ) --- 1599,1606 ---- if ( !$db->sql_numrows( $result ) ) { ! $user_info = new mx_user_info(); ! ! $sql = "INSERT INTO " . PA_VOTES_TABLE . " (user_id, votes_ip, votes_file, rate_point, voter_os, voter_browser, browser_version) ! VALUES('" . $userdata['user_id'] . "', '" . $ipaddy . "', '" . $file_id . "','" . $rating . "', '" . $user_info->platform . "', '" . $user_info->agent . "', '" . $user_info->ver . "')"; if ( !( $db->sql_query( $sql ) ) ) |