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!
Nevermind: I made a typo. Can you find the missing
" ?...
I hate it when I do that!
Thanks -maybe a future mod...
That would be an AWESOME enhancement HackMOD!!!
Ok
So what is a user agent????
(said shyly and feeling dumb)
[]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.
is the full code for that in the first post???
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
Does look good Dal, would be a nice mod
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.
That's pretty sweet.
Especially the firefox logo.