|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
What I want to do is search the user agent string (contained in $Agent) for yahoo and then change the $Agent string to an image link. I think that the forward slashes in the $Agent string are causing stristr to fail, but I don't know how to remove them. A search and replce mabey? Here is my code: if (stristr($Agent, 'yahoo') !== false) {<br /> $Agent = "<img border=\"0\" align=\"middle\" src=\"{$config['imageurl']}/yahoo.gif\" alt=\"Yahoo bot eating all our bandwidth\" />;<br />//} I'll try a search and replace first and see if that makes a difference -but any ideas are welcome!
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
Nevermind: I made a typo. Can you find the missing " ?... I hate it when I do that! 
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
|
|
|
|
Joined: Mar 2000
Posts: 528
Junior Member
|
Junior Member
Joined: Mar 2000
Posts: 528 |
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
Thanks -maybe a future mod... 
|
|
|
|
Joined: Sep 2003
Posts: 803
Coder
|
Coder
Joined: Sep 2003
Posts: 803 |
Oh please, oh please  thats a nice touch
|
|
|
|
Joined: Jan 2005
Posts: 39
User
|
User
Joined: Jan 2005
Posts: 39 |
That would be an AWESOME enhancement HackMOD!!!
|
|
|
|
Joined: Jul 2002
Posts: 79
Power User
|
Power User
Joined: Jul 2002
Posts: 79 |
Ok
So what is a user agent????
(said shyly and feeling dumb)
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
[]StanCA said: Ok
So what is a user agent????
(said shyly and feeling dumb) [/]
When someone surfs to your web site the http get packet (the request that they send for a specific page) has information in it that can identify the browser that they are using, their operating system (XP, NT, OSX, etc.) and some other odds and ends. The standard whos online display just shows the user agent text -kinda boring. The mod that I've done replaces the text with a graphic if the user agent is known. If it's unknown the standard text is still displayed -for now. I may change that to some sort of generic image since it's impossible to check for every possible user agent and may prove to be too slow if I tried.
|
|
|
|
Joined: Jul 2002
Posts: 79
Power User
|
Power User
Joined: Jul 2002
Posts: 79 |
is the full code for that in the first post???
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
LOL! Nope -just a sample. I spent a lot of time hashing out the logic for that hack and to make it a little faster in determining what the user agent is. There are a couple of problems with the way I have it set up... - You'd have to have Josh's Who's Online User Info hack installed (I think that's what he called it).
- If he didn't update it to make it more "template friendly" then you'd have even more hacking to do since I remember, a long time ago, hacking Josh's hack
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Does look good Dal, would be a nice mod 
|
|
|
|
Joined: Feb 2001
Posts: 2,268
Junior Member
|
Junior Member
Joined: Feb 2001
Posts: 2,268 |
I'm almost finished with it. When I'm done I'll use Beyond Compare to compile the changes and package it as a mod.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
That's pretty sweet.  Especially the firefox logo.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 417
Joined: November 2001
|
|
Forums63
Topics37,575
Posts293,930
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|