Version: , by Admin (Coder)
Developer Last Online: Nov 2024
Version: 2.2.x
Rating:
Released: 11-30-2001
Last Update: Never
Installs: 109
No support by the author.
This hack was requested on vBulletin.com.
It lets you add possible locations to Who's Online, directly from the Admin CP.
This is good if you are using external hacks, that use vBulletin's system. You probably know that users browsing these external files have Unknown Location (or Main Index for non-admin viewers) next to them.
With this hack, you can easily add a new custom location with ease!
It's also designed in a way that won't let you overwrite existing locations. ('dummy protection' as I like to call it )
The locations you add are not stored in their own table, because I really felt that would be waste of space and resource.
Instead, I store the locations in the template table, in one special template dedicated to this data.
It was a lot harder to do it this way, btw.
Please let me know if you find any bugs, or if this script doesn't work with files in child folders (this is my main concern).
This can be easily remove (just undo changes to online.php), so please don't fear to try it out!
A nice screen shot is in my next post.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I wonder if there's a way to hack it so it stores the complete path to the file instead of just the filename, then just mod the online.php to go with full paths.
I was able to get the Who's Online to track users across many of the main section pages of our site, but I had to hack the online.php myself to make it function the way I wanted. I couldn't find any pre-existing hack that would do it.
The who's online code has a variable called strpos($userinfo[location]), what I did was modify the existing case structure logic to both look for additional filenames and use the above variable, under a default case statement, within a large if - elseif structure to also parse for URL paths. Then you set up additional $userinfo[activity] value tags. In another case structure in the online.php code, it uses these activity labels/tags to determine what to output on the who's online listing.
View the attached code that I am currently running and you'll see what I did. Just duplicate what I am doing, but with your own filenames or URL paths on your site. Then you just include the following SSI tag at the end of each HTML file on your site. For this to work correctly without having to change all your file extensions to .shtml, just edit your Apache config or your IIS script/ISAPI configuration to make it parse all .html files for SSI commands in addition to .shtml files.
Code:
For Apache:
<!--#include virtual="/Tracker.php"-->
For IIS you might have to use:
<!--#exec cgi="/Tracker.php"-->
This file is in the root of my site and simply contains the following:
<?
require('X:/Absolute root Path to Vb/global.php');
?>
This was just a quicky hard coded hack to make it do this. I think a much better thing to do, and something that should be in Vb any ways, is added functionality to the admin interface that would let you build a list of URL's and filenames (stored in the database) of locations anywhere on your site (even on subdomains) and a corresponding URL to use as a link. Then if you just include some tracking code, or the global.php file, on all your pages it would have this functionality out of the box. The Who's Online code would just use what it pulls from that database table to compare/parse against its variables. This would make the Who's Online much more flexible and greatly expand it's functionality.