UBB.Dev
Posted By: Dalantech I need help with an online.php mod - 08/01/2005 6:16 PM
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:

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!
Posted By: Dalantech Re: I need help with an online.php mod - 08/01/2005 6:45 PM
Nevermind: I made a typo. Can you find the missing " ?...

I hate it when I do that!
Posted By: Dalantech Re: I need help with an online.php mod - 08/01/2005 7:10 PM
Take a look at my who's online display
Posted By: Medar Re: I need help with an online.php mod - 08/01/2005 8:34 PM
Nice!
Posted By: Dalantech Re: I need help with an online.php mod - 08/01/2005 8:43 PM
Thanks -maybe a future mod...
Posted By: DrChaos Re: I need help with an online.php mod - 08/03/2005 6:58 PM
Oh please, oh please

thats a nice touch
Posted By: ScriptZ Man Re: I need help with an online.php mod - 08/04/2005 2:13 PM
That would be an AWESOME enhancement HackMOD!!!
Posted By: StanCA Re: I need help with an online.php mod - 08/04/2005 5:16 PM
Ok

So what is a user agent????

(said shyly and feeling dumb)
Posted By: Dalantech Re: I need help with an online.php mod - 08/04/2005 8:07 PM
[]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.
Posted By: StanCA Re: I need help with an online.php mod - 08/07/2005 4:39 AM
is the full code for that in the first post???
Posted By: Dalantech Re: I need help with an online.php mod - 08/08/2005 2:24 PM
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
Posted By: AllenAyres Re: I need help with an online.php mod - 08/11/2005 6:18 PM
Does look good Dal, would be a nice mod
Posted By: Dalantech Re: I need help with an online.php mod - 08/12/2005 5:03 PM
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.
Posted By: JoshPet Re: I need help with an online.php mod - 08/14/2005 8:48 AM
That's pretty sweet. Especially the firefox logo.
© UBB.Developers