PHPee.com PHP development forum
Add Safari to recognised browsers

 
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger Support
View previous topic :: View next topic  
Author Message
Harold
Guest





PostPosted: Fri Jan 10, 2003 4:16 pm    Post subject: Add Safari to recognised browsers Reply with quote
To add the new Apple browser Safari to the recognised browsers list add the following to /pphlogger/libraries/yabd.lib.php:

In $arr_brows add the following line:
'Safari' => 'Safari',

I put it under the iCab listing.

In function extract_agent($AGT) add the following line:
else if(eregi("Safari/48",$AGT,$st_regs)) {$st_brows = "Safari"; $st_ver = '1';}

Again I added it under the iCab listing.

I have added my version of the file if you don't feel like editing it yourself.
Back to top
Harold
Guest





PostPosted: Sat Jan 11, 2003 3:15 pm    Post subject: Re: Add Safari to recognised browsers Reply with quote
It looks like Apple is already releasing modified versions, to pick these up I have modified the script a little.

Change the line:
else if(eregi("Safari/48",$AGT,$st_regs)) {$st_brows = "Safari"; $st_ver = '1';}

to:
else if(eregi("Safari/([0-9]{1,2})",$AGT,$st_regs)) {$st_brows = "Safari"; $st_ver = '1';}

Here's hoping Apple will stay consistent with their user-agent string and give us some way to identify what version people are running when the program is out of beta.
Back to top
AgentElrond



Joined: 23 Jan 2005
Posts: 2
Location: The Matrix of Rivendell

PostPosted: Sun Jan 23, 2005 7:25 pm    Post subject: Safari detection/logging Reply with quote
Here's what I'm using, which seems to work okay:
Code:
$arr_brows = Array (
   'Safari'   => 'Safari',
.
.
.
   else if(eregi("(Safari)/([0-9]{1,3}.[0-9]{1,2})",$agt,$st_regs))        {$st_brows = "Safari";  $fl_ver = $st_regs[2];}

_________________
"Welcome to Rivendell, Mr. Anderson."
Back to top
View user's profile Send private message
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger Support All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11
Theme design based on Team 101 Designs, modified by Philip Iezzi