I've created a simple script to track recent user activity on SMF. It's nothing fancy, but if you want to find out what people have been up to (useful for keeping tabs on potential trouble) you may find this handy. You can download the files from here: http://army.ca/deleteme/tracker.zip
Installation is simple, just download the zip, unzip it, then drop it in to your SMF directory (same one that contains SSI.php), then browse to tracker.php.
You can enter the username, display name or user ID# for a user to track. Due to the nature of the info provided, currently only forum admins are allowed to run the script.
I've included a couple screen shots to show the general functionality.
Cheers
Mike
Update: Now shows moderator actions as well.
Update [10 July 2009]: A new version for SMF 2 is now available at the above link.
[edited the install instructions to include that it needs to be unzipped first: Shadav]
Nice MOD!
What is function=doesnothing? :D
Since you are including SSI.php anyways why not use
$scripturl instead of $forumurl
and
$db_prefix instead of $accounts_db_name
Mike, that's a great idea... can't believe I missed it! Script and instructions have been updated, thanks!
Owdy: I can't find a "doesnothing" reference in the code... did I miss something? :)
Look your attachment ;)
Oh, lol...
Well, that works as designed of course... and does nothing! ;)
[offtopic]
What an great function! ;D Are you going to release that mod also? ;) :D
edit: too late, its released in here allready: http://www.simplemachines.org/community/index.php?function=doesnothing
[/offtopic]
What a great function, and so easy to install. Tnx for sharing !!
This ought to be a standard tool in a future release of SMS.
It's not fancy, but I needed something to give me visibility into user actions. Glad you like it! :D
If I may say so, what a kick ass tool! This is just what I was looking for, and you already made this! Thanks!!! :D
I like this function, can it be easily linked into the current user/IP tracker?
So that you can just click on the user name to invoke it instead of using the tracker.php directly.
Of course this should be a admin/mod only function.
I am a newbie with this code set so am somewhat afraid to tinker much so far, but I would suspect this is a simple edit of one file.
Yeah, that would be pretty easy. You can invoke it for a specific user like this:
http://server.com/tracker.php?function=track;u=[uid]
So all it would take is just adding that URL with the user's ID in the URL, wherever you want to invoke it.
Thanks, I thought it would be simple.
Now I just need to figure out where I want it ;)
Unfortinately this function does not work anymore in SMF 1.1 Beta 3
It gives me an error and says "Hacking attempt...". :(
Can it be altered so that it wil work again in SMF 1.1 Beta 3 ??
No problem, give it a try now...
Cheers
Mike
Thank you very much, Mike.
It Works again :)
I have to reply to this thread again, and just tell you that it is one of the best features an Admin could possibly use for your own forums. I've used it in a number of occasions now, and I must say that it's great knowing what people are doing (lurkers and spies, oh my!). Thanks for making this script!
Thanks Chris, I'm glad you've found it useful. It seemed logical that admins might want to know this type of thing and since the info is already there it was pretty easy to thow together.
Cheers
Mike
It comes in handy in all occasions when the admin needs to know if a user has read a certain topic.
I'm very pleased with it!!
Forgive me ignorance, but does "just drop it in" means in the smf root directory? You didn't specify which dir.
You can put it anywhere, so long as the SSI.php path at the top of the file is correct.
Thanks, Mike. Will give it a try.
How do you make it so when in the admin center you add a link for admins to click on to track this activity? I think that would be a nice feature.
Quote from: Mike Bobbitt on May 24, 2005, 12:47:14 PM
Due to the nature of the info provided, currently only forum admins are allowed to run the script.
Yep. ;)
Edit to answer edited question... :)
I try not to modify any SMF code so there's no maintenance on updated versions, but I imagine it'd be a matter of modifying the right file in your template.
I edited the other post and i figured that out..lol
Yeah, and I blindly replied based on the contents of the notification e-mail, then when I looked, I noticed the question was different. ;)
Quote from: Mike Bobbitt on August 31, 2005, 04:55:39 PM
Quote from: Mike Bobbitt on May 24, 2005, 12:47:14 PM
Due to the nature of the info provided, currently only forum admins are allowed to run the script.
Yep. ;)
Edit to answer edited question... :)
I try not to modify any SMF code so there's no maintenance on updated versions, but I imagine it'd be a matter of modifying the right file in your template.
Well I know that it would consist of modifying the right files in the template.. But asfar as which to edit, And what part of code to edit, I'm clueless!
I have modified the permissions in tracker.php to allow more groups than just my admins to access the file. I've given access to a semi-admin member group, so to speak... but this member group does not have access to all boards.
I'd like to limit tracker.php to where it doesn't list the subject of threads in boards he doesn't have access to. They're of a private nature - by clicking on the link, he's not permitted to read the thread, of course... but I'd like the peace of mind in knowing that the 'semi-admins' can't read the subjects of these threads either.
Is there any way I can exclude certain boards (or just the threads within them) in my forum from being listed on tracker.php?
Find this bit:
Quotewhile ($res=mysql_fetch_array($result))
{
// Get the topic title
$result2=db_query("SELECT $db_message_table.`subject` FROM $db_message_table WHERE $db_message_table.`ID_TOPIC` = \"$res[ID_TOPIC]\"",__FILE__, __LINE__);
$res2=mysql_fetch_array($result2);
$subject=$res2[0];
mysql_free_result($result2);
echo "<tr><td><a href=\"$scripturl/topic,$res[ID_TOPIC].0.html\">$subject</a></td><td>";
echo date("Y/m/d H:i:s",$res[logTime]);
echo "</td></tr>\n";
}
to this:
Quotewhile ($res=mysql_fetch_array($result))
{
// Get the topic title
$result2=db_query("SELECT $db_message_table.`subject`, $db_message_table.`ID_BOARD` FROM $db_message_table WHERE $db_message_table.`ID_TOPIC` = \"$res[ID_TOPIC]\"",__FILE__, __LINE__);
$res2=mysql_fetch_array($result2);
$subject=$res2[0];
$board=$res2[1];
mysql_free_result($result2);
// Check to see if it's an allowed board
if ($isstaff || ($board != "10" && $board != "19"))
{
echo "<tr><td><a href=\"$scripturl/topic,$res[ID_TOPIC].0.html\">$subject</a></td><td>";
echo date("Y/m/d H:i:s",$res[logTime]);
echo "</td></tr>\n";
}
}
This example excludes boards 10 and 19, but you can easily extend it to more. Not tested, but it should work.
Cheers
Mike
Wow, thanks for the quick response. :)
The code you provided doesn't seem to work, though... nothing seems to have changed and the boards aren't excluded.
Try this then, change:
Quoteecho "<tr><td><a href=\"$scripturl/topic,$res[ID_TOPIC].0.html\">$subject</a></td><td>";
to
Quoteecho "<tr><td><a href=\"$scripturl/topic,$res[ID_TOPIC].0.html\">$subject ($board)</a></td><td>";
And see what's in brackets after each topic name. It should be the board ID.
Done and done...
I now see a '(2)' next to every topic name... i.e.
Petrol Prices set to Rise? (2)
When I view someone else's recent usage, I see a different board ID # while again they are all the same no matter the board they belong to. I have no problem identifying the board ID number, btw, not sure what that latest modification was for.
Found an error in the code... replace "$board=$res[1];" with "$board=$res2[1];" and you should have better results.
That fixed the board ID not displaying correctly, but the two boards I'm trying to exclude are still visible.
What's your if statement look like? E.G.:
if ($isstaff || ($board != "10" && $board != "19"))
What board IDs are you trying to hide?
Quote from: Mike Bobbitt on September 04, 2005, 10:29:48 PM
What's your if statement look like? E.G.:
if ($isstaff || ($board != "10" && $board != "19"))
What board IDs are you trying to hide?
if ($isstaff || ($board != "8" && $board != "12"))
Boards 8 and 12.
Ok, that all looks good... How is $isstaff set, you mentioned you made some changes there...
Good point. I just changed it back to default so we're on the same page while troubleshooting. No difference, though. Is the code working on your end?
I had it set to "$isstaff=$context['allow_admin'];" which allows both my admin and 'semi-admin' member groups to access it. It's now back to "$isstaff=$user_info['is_admin'];"
I haven't actually tried the code. :)
But if $board is now being set properly, it should work. Actually, given the way you've coded things you may want to get rid of the $isstaff check:
if ($board != "8" && $board != "12")
would this work on 1.1RC1 ??
Just installed it on my board. Works a treat!
Thnx mike!
Yep, tested and confirmed on 1.1 RC1. :)
just the first package, or with the listed alterations added??
thanks
It's cool, works fine on 1.1 RC1
Keep up the good work ;)
Egg, both the original script and the modifications will work on 1.1 RC1.
doesnt seem to like it
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /htdocs/200mph.org.uk/tracker.php on line 2
Parse error: parse error, unexpected T_STRING in /htdocs/200mph.org.uk/tracker.php on line 2
Line 2 eh... maybe one of the mods above broke it, or maybe it was FTP'd in as binary...?
I took the file from your first post. changed SSI path, and thats the output :(
tried reuploading in ASCII, no change. same error.
Ok, line 2 is the require('/var/www/html/forums/SSI.php'); statement, so can you double check the syntax is OK?
if the path to my SSI.php is
/htdocs/publicspace/90/200mph.net/smf
or
www.200mph.net/smf
what would the syntax be??
I think my lack of knowledge might be the cause ::) ???
replaced it with
<?php
require(dirname(__FILE__) . '/SSI.php');
?>
and it all works.
thank you!
Nice idea, then the files simply have to be in the same directory... no need to update the path. :)
This should be included in the SMF release its very handy!
Thanks... just updated it. In a nut shell:
* Simpler install (if it's in the same dir as SSI.php no edits required, otherwise you can set the path).
* Current activity is shown in a more readable format.
* Small code cleanups.
thanks work like a charm!
i have a question, it's possible to track the members who have download attachements files and how much time??
You could check your web logs for that, but as far as I know SMF doesn't track attachment downloads...
Quote from: Harelin on September 04, 2005, 10:39:06 PM
Good point. I just changed it back to default so we're on the same page while troubleshooting. No difference, though. Is the code working on your end?
I had it set to "$isstaff=$context['allow_admin'];" which allows both my admin and 'semi-admin' member groups to access it. It's now back to "$isstaff=$user_info['is_admin'];"
so this allow_admin actually works?
QuoteFatal error: Call to undefined function: determineactions() in /home/thefound/public_html/tracker.php on line 157
any ideas why I'm getting this when the user is logged in?
What version of SMF are you using? I've tested with 1.1 RC1, but it may not work with other versions... Basically, Who.php in your Source directory must have a determineactions function... If not, just comment out line 157 in the script.
1.0.5, and I'll do that, thanks :)
oh this is cool.
I recently had a user that caused a lot of trouble and could have used this.
can you tell me how to add global mods to the allowed...
Thanks
Dave
Try something like this:
$isadmin= 0;
$db_member_table = $db_prefix."members";
// List of all "staff" group IDs
$staffgroup_ids = "1,2";
// Reformat staff IDs into regex
$staffgroups = "(".join("|", split(",", $staffgroup_ids)).")";
$query = "SELECT $db_member_table.ID_GROUP, $db_member_table.additionalGroups FROM $db_member_table WHERE $db_member_table.ID_MEMBER = ".$context['user']['id']."";
$result = db_query($query, __FILE__, __LINE__);
while ($res = mysql_fetch_array($result)) {
$groups = $res['ID_GROUP'];
if ($res['additionalGroups']) {
$groups .= ",".$res['additionalGroups'];
}
$groups = ",$groups,";
// Staff
if (preg_match("/,$staffgroups,/", $groups)) {
$isadmin = 1;
} else {
$isadmin = 0;
}
}
mysql_free_result($result);
Just set $staffgroup_ids to all the group ID #'s that your staff belong to (E.G. 1 for admin, 2 for global mod, etc.)
Hope that hepls.
Cheers
Mike
Why would I get this error message on some users.
Fatal error: Call to undefined function: determineactions() in /home/sensne2/public_html/forum/tracker.php on line 157
while on other usersit works just fine?
Hmmm, that is weird... The function should always be defined, regardless of the user... You could comment out that line, but then you won't get the "translation" of the user's current action.
Quote from: Owdy on May 24, 2005, 01:27:44 PM
[offtopic]
What an great function! ;D Are you going to release that mod also? ;) :D
edit: too late, its released in here allready: http://www.simplemachines.org/community/index.php?function=doesnothing
[/offtopic]
wow, function=doesnothing that should be a mod within itself....j/k
kewl mod Mike Bobbitt
cant wait for rc1 to come out...
Right now it is showing my server time (GMT). Can I change it to show my local time?
It's giving me this error.
d a_#à wÿøÿ÷,,eôìhangelog-themes.txt te downloaden bij 0,00 kp/s, 4032 van 12844 bytes, 00:00:00 sec te gaanA@b,,te/rating_3.gif (337 bytes) DxBË ¸Îl}y{A‡‡('Ž‡–—"+˜–+!;ü»ü»Tè0è00ô7¬èDÀþœûaøU!t\DERROR: You are not Army.ca Staff.
Do you know what I'm doing wrong? I just downloaded tracker.php from your first post, uploaded it to smf dir and gave me this error.
Ronald.
I'm guessing FTP in binary mode instead of ASCII? But none of that text is even in tracker.php, so that's odd. Do your web server error logs show anything?
Uploaded it again in ASCII mode and still same prob.
Maybe this'll help. I just moved the forum from one domain to another (same host).
I figured out tracker.php wasn't working well anymore. So I guessed a clean install might help.. Guess not.
Ronald.
Do you have shell access? If so, try running "php -f tracker.php" to get the base output from it.
I guess I don't have shell access as I don't know what it is. By the way, there are no error messages in the server log.
Ronald.
I got this error when I try and go to the tracker (http://myforum/path/tracker.php - same location as my SSI file)
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /Library/WebServer/Documents/smf/tracker.php on line 107
I look at line 107 and the code that starts there is
// Generate query
$query = "SELECT $db_member_table.`ID_MEMBER` FROM $db_member_table WHERE $db_member_table.`memberName` = \"$user\" OR $db_member_table.`realName` = \"$user\"";
$result = mysql_query($query);
if (!$result) {
die("$query failed: ".mysql_error());
I'm running RC1.
That's odd... Line 107 is actually the comment, not real code. Is it possible that the file was modified or FTP'd in binary mode so the line breaks aren't correct?
No. I'm reading the file right off the server. It could simply be an issue of BBEdit's numbering the lines, or how php is reporting it.
Try commenting out lines in that area to see if you can make the error go away. That way you can isolate the actual line that's the problem...
I commented out that entire else statement (from } else { through... the closing } before if (!$u) {) and the error change to line 108.
Huh? :-\
Seems like maybe an erorr from a runaway { or quote elsewhere in the file maybe. If you can, try re-downloading it without editing anything to see if it runs. Could be that something was changed when you edited the file...
Rats... still no luck (I'm sure it's not an upload problem too). I upgraded to RC2, but had been using RC1 before. That doesn't seem to have made any difference (either way).
Am I missing something to configure? I'll re-read the thread again.
there are some bugs in this, for instance the links to the places a visitor has been is wrong.
I have SMF 1.0.5
It was designed to work on 1.1 RC1, so some of the links may not be properly formed for 1.0.5.
why are you making it compatible for a version that is in BETA stages? shouldnt everyone be making mods for the current released version which is 1.0.5?
I would use 1.1 but there is no package update yet :(
I'm making it for the version I use, and sharing it in case others find it useful. :)
Hi Mike,
Just updated from smf1.1rc1 to rc2 and tracker.php stopped working.
Error log:
Unknown column '******.smf_log_boards.logTime' in 'order clause'
File: /home/fivearts/public_html/tracker.php
Line: 169
I had a look through phpMyAdmin >> smf_log_boards and there is no "logTime" field. But in backup_smf_log_boards there is "logTime" field.
What should I do? Should I change something under tracker.php or something in phpMyAdmin? I have never tweak phpMyAdmin before.
:o
I noticed that myself recently... I've asked about it here (http://www.simplemachines.org/community/index.php?topic=63763.msg440686#msg440686) but no reply yet.
I've updated the script to work with RC2, but unfortunately that means no date/time indicators, which makes it pretty much useless. :( If that info is stored somewhere, I can add it back in.
Cheers
Mike
Hi Mike. We've just updated to RC2 and are also getting the 169 error.
I hope you will get the info to get tracker.php to work again. It's a very useful tool for us.
If you re-download the tracker.php script it should work with RC2 but unfortunately no time/date stamps. :(
I just can't get a break. :P
Still getting the following error...
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /Library/WebServer/Documents/smf/tracker.php on line 107
Yeah, you don't seem to be having much luck at all... I did test the script on a couple of servers and it works OK so I'm not sure why it's giving you grief... :(
Well, I'm running RC2, php 4.3.11, and the following mods...
- FAQ Tags 0.1
- Gmail Field 1.1
- Google Member Map 0.51
- Personal Message Auto Responder 0.2
- Skype Name Mod 1.0
- Spoiler Tag 0.2.3
- Users Online Today Mod 1.3.1
Could any of that have an affect? I could uninstall them, but some are 'tweaked'.
Hard to say which if any of those mods may be interacting.... the error indicates a problem with the script itself, but I can't seem to reproduce it. I hate to tell you to remove your mods since that's a lot of work... would it be easier to install a qiuck "test" SMF to see if the script runs for a clean install?
Quote from: Mike Bobbitt on January 07, 2006, 07:56:03 PM
If you re-download the tracker.php script it should work with RC2 but unfortunately no time/date stamps. :(
Thanks i did that. Better some tracks than none ;)
...but I stil hope you will soon be able to fix the time/date stamps of this tracker.
I'm getting all sorts of error with this now. I re-downloaded the tracker.php file, moved it to my SMF directory (running 1.1 RC2), and even though it works I'm getting tons of hacking errors at the bottom of the report. Funny thing is that these error messages are timestamped, where nothing else is. I sure hope this tool can be functional again, as I used it on a regular basis.
Are the errors listed under the "errors" section by chance? :D
Quote from: Mike Bobbitt on January 09, 2006, 08:22:45 PM
Are the errors listed under the "errors" section by chance? :D
Yes. Here's an example...
QuoteApply Filter: Only show the errors with the same message
Hacking attempt...
SELECT `sandtroopers_com_-_sandtroopers`.yabbse_members.`realName` FROM `sandtroopers_com_-_sandtroopers`.yabbse_members WHERE `sandtroopers_com_-_sandtroopers`.yabbse_members.`ID_MEMBER` = "529";
File: /DIRECTORY/smf/tracker.php
Pay no attention to the "yabbse" in the database name. I just haven't changed the name of our database yet.
If the script is showing the user info and showing errors under the errors section, there's a good chance that's normal. I.E. Maybe these are actual errors the user you're tracking generated.
i'd love to try this when it comes back in action... it sounds great...
does it have a limit as to say how many recent action it shows or how many days is classified as recent??
If it's in the database, it'll show it, so "recent" is everything that's logged.
Well, I finaly got around to installing a copy of SMF to test stuff on (should have done that a while back, but now that my site is live it's practically a requirement).
I've done NOTHING but install SMF, and copied the tracker over.
If I go to http://server.com/tracker.php or http://server.com/tracker.php?function=track;u=[uid] I get the same error regarding line 107.
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /Library/WebServer/Documents/smf_test/tracker.php on line 107
I'm running 1.1RC2 and MySQL 4.0.24 on a Mac OS X 10.3.9 Server.
I tried commenting out the {} section around line 107 (from else { on 106 to } on 112), but no go. If I comment out the whole if section (102-116) I get a similar error, but it references line 108.
What version of PHP are you using, maybe it doesn't like a command I've used...
php v4.3.11
I believe that should work... I'm coding against 5.0.4, but I don't believe I've done anything too exclusive... I'm honestly at a loss as to why you're having issues. :(
1.1 RC2, the script shows boards and topics visited by the users, but not the time of the action itself... what's wrong ???
Timestamps have been removed in RC2:
http://www.simplemachines.org/community/index.php?topic=36793.msg443219#msg443219
Sorry, Mike, haven't noticed that :(
No worries, the thread has kind of wandered through a few topics...
Very useful file! Thanks!!! :)
Thanks!
I saw that the edit-date of the first post in this topic had changed, so I hoped that there was now a "tracker.php" that shows also time and date. The old file did not do that. The new tracker-file shows exactly the same als the old file except the new one gives back two errors in my subs.php. I run a standard "SMF 1.1 RC2" forum. I have not made any changes in my subs.php
Here is the top of the page tracker.php that shows me:
User Tracker
This script tracks the recent actions of all users in The Watch List.
Warning: Missing argument 2 for db_query() in /home/pcnaviga/public_html/forum/Sources/Subs.php on line 237
Warning: Missing argument 3 for db_query() in /home/pcnaviga/public_html/forum/Sources/Subs.php on line 237
Tracking Han...
Jump to: Boards || Topics || Monitored Topics || Admin Actions || Errors
Sorry, no dates... they're just not in the DB to be had. :(
I believe I've fixed the 2 warnings you were seeing...
Cheers
Mike
Yep, the warnings are gone now. Tnx !!
Just curious....., what is the difference between the old tracker.php and the new one?
Just a change in code of also a change in functionality?
It now shows admin actions for moderators.
I have this error in 1.0.6
Fatal error: Call to undefined function: determineactions() in /home/draco/public_html/dracoforo/tracker.php on line 154
Yeah, that bit doesn't seem to work right for 1.0.6, just comment out line 154. You won't get to see the user's current actions, but it should work otherwise.
Actually, you'll probably need to comment out another occurrance of determineactions in the newly added admin section too...
I would apreciate it if someone fix this to work on 1.0.6
Thanks
Did you try commenting out the 2 lines with calls to determineactions() in them? That should do it...
Quote from: Mike Bobbitt on March 01, 2006, 07:48:36 AM
Did you try commenting out the 2 lines with calls to determineactions() in them? That should do it...
comment out? calls? ohhh i`m too dumie to understand that ::)
Quote from: mforum on March 02, 2006, 03:29:46 AM
Quote from: Mike Bobbitt on March 01, 2006, 07:48:36 AM
Did you try commenting out the 2 lines with calls to determineactions() in them? That should do it...
comment out? calls? ohhh i`m too dumie to understand that ::)
To comment out code, means to tell the PHP parser to ignore it... this can be done by putting two slashes in front of the line like this...
Quote
<?php
// this line is commented out because of the two "//" at the beginning of it.......
print "this line is live code ";
// this line is not......
?>
ok, i understand, did it and have no errors :)
is there a way to change char encoding of page to my lanquage? (ISO-8859-7), i am doing that manualy
Thanks a lot .. !!!
Nice Work
I've overwork a little bit the Tracker.php :X
Know it's 1.0.x Compatible ;), and it load some design so it automaticly select your chosen charset...
(Attached to this post the alternativ File :X).
Bye
DIN1031
WoW !!!! that rocks !!!!
tested localy on my test forum 1.0.5 and worked fine.
tested on my forum 1.0.6 worked allright exept of this error
Warning: Missing argument 2 for db_query() in /home/*******/public_html/forum/Sources/Subs.php on line 216
line 216 must be
// Do a query. Takes care of errors too.
function db_query($db_string, $file, $line)
{
global $db_cache, $db_count, $db_connection, $modSettings;
have no idea what it means...
Thanks a lot din1031 :)
Look like a Query without __FILE__ and __LINE__
This error should be also in the normal file because i don't alter the other code :)
Serach for:
$result = db_query($query);
Replace with :)
$result = db_query($query, __FILE__, __LINE__);
Bye
DIN1031
I did that,,, no errors now !!!!!!
Thanks :)
I downloaded the updated version of this script, and I think for the most part it's working pretty well. However, under the Recent Changes section I'm getting these three errors on a repetitive basis...
Quote8: Undefined index: uot_users_online_today_title
File: /home/virtual/site1/fst/var/www/html/smf/Themes/default/BoardIndex.template.php (eval?)
Line: 406 2006/03/23 12:32:58
8: Undefined index: uot_users_online_today_title
File: /home/virtual/site1/fst/var/www/html/smf/Themes/default/BoardIndex.template.php (eval?)
Line: 409 2006/03/23 12:32:58
8: Undefined index: uot_users_online_today
File: /home/virtual/site1/fst/var/www/html/smf/Themes/default/BoardIndex.template.php (eval?)
Line: 416
Any ideas as to what this might mean? Is this script working for me? I placed the tracker.php file under SMF and the SSI.php file is in the same location, so it should be working okay.
My BoardIndex.template.php doesn't have any references to uot_users_online_today_title, is it possible this comes from an installed mod?
can you clarify for me how i need to set this up? cause ive tried several times and i dont think its working like ive seen in you screen shots
The screenshots are a bit old... the new (1.1) SMF doesn't include timestamps in the database unfortunately. :(
This error comes from the online users today mod :x i think -> uot_users_online_today txt variable is missing.
To Load this i think you must add someting :)
Change this code
if(function_exists('loadTemplate') && $load_template) {
loadTemplate('index');
template_init();
template_main_above();
}
to
if(function_exists('loadTemplate') && $load_template) {
loadTemplate('index');
loadLanguage('Who');
loadLanguage('Modifications'); //If you need more Language Files to Load than copy the line and insert the name of the file.
template_init();
template_main_above();
}
I hope it work ;).
Bye
DIN1031
What file does that need to be edited in? I check a few different files and didn't find that at all.
Quote from: dustrho on March 24, 2006, 10:02:05 AM
What file does that need to be edited in? I check a few different files and didn't find that at all.
In the Tracker.php from me ;).
Bye
DIN1031
For the record, din1031 is talking about his modified Tracker.php (http://www.simplemachines.org/community/index.php?topic=36793.msg505284#msg505284)... you won't find those lines in the base model. :)
I made the suggested changes in the modified tracker.php file, and I'm still getting all those error messages at the bottom of the page. I do like how you incorporated this into the forum itself, instead of being on a plain jane white page. Nicely done!
Somehow adding back the timestamps would be so nice with this tool ;D
Related topic
http://www.simplemachines.org/community/index.php?topic=63763.html
Quote from: Mike Bobbitt on January 04, 2006, 11:57:36 AM
I noticed that myself recently... I've asked about it here (http://www.simplemachines.org/community/index.php?topic=63763.msg440686#msg440686) but no reply yet.
I've updated the script to work with RC2, but unfortunately that means no date/time indicators, which makes it pretty much useless. :( If that info is stored somewhere, I can add it back in.
Cheers
Mike
Yeah, the timestamps are still missing in RC3, I was hoping they'd be back. :(
Quote from: Mike Bobbitt on September 07, 2006, 11:47:15 AM
Yeah, the timestamps are still missing in RC3, I was hoping they'd be back. :(
Me too, good to see your still around Mike !
Maybe they will add them in the final version ;D :-X
Quote from: Han on February 20, 2006, 11:21:56 PM
User Tracker
This script tracks the recent actions of all users in The Watch List.
I'm brand new to SMF and in the process of converting a board. I've got a problem person and this mod is going to be extremely helpful to me! But I'm wondering...what is "The Watch List?"
The Watch List is optional, but can be a group you put users in and they will automatically appear on the picklist on the main screen.
So it's a group I make up myself, then?
Just wanted to make sure I hadn't missed something. This is going to be a helpful script. I tested it out, had a couple of errors, but those were cleared up by some code posted earlier and it rocks!
I have a problem idiot who hasn't given up in five+ years and continually finds ways to get in with fake names. (free trial ISPs, friends' computers, internet cafes, etc....the guy is really obsessed). A watch list will be perfect because if there's somebody I think is suspicious, I can put them in the watch list. This fool is nothing if predictable. He's easy to spot once he gets going.
Thanks so much for the script! Now if someone would do a miserable user/Coventry script so I can keep sending him to hell...
Yep, just create the group and identify the group ID# in the script.
If you've got a repeat user, you may also find this script (http://www.simplemachines.org/community/index.php?topic=33992.0) useful. I can also provide some additional info if you're interested in the Watch List concept, just PM me.
Cheers
Mike
Oh my, that looks positively delightful! Perhaps you share my experience with bad boys? ;D
Thanks for your help!
Juli
Quote from: juli on October 05, 2006, 05:25:10 PM
Oh my, that looks positively delightful! Perhaps you share my experience with bad boys? ;D
Er... I'll take that from a technical angle, and say yes. :)
sorry but how i can permit to another usergroup to use this tracker?
help me please
I just grabbed this script tonight, so I'm not too familiar with it. It appears that the "watchlist" is based on a specific group ID. Personally, I'm too nosey for something like that - I want all groups.
So, I just made a change to not use the "watchlist" anymore. Instead, I can pick whatever groups I like.
At the bottom of his script, you'll find a snippet that looks like (or, should look like)
// Get list of users in The Watch List
if ($armyca) {
$result = db_query("SELECT * FROM $db_member_table WHERE ...
echo "Select the user you want to track:<br /><br />\\n";
while ($res = mysql_fetch_array($result)) {
(SNIPPED)
include "$include_dir/footer.php";
}
Note that I omitted some stuff from the middle, to keep this post short.
Remove that chunk of code, and replace it with
$db_group_table = "membergroups";
$db_group_table = "$db_prefix$db_group_table";
if (isset($_REQUEST["gid"]))
$gid = $_REQUEST["gid"];
// Who's on
// Get the user's current action
$result = db_query("SELECT $db_member_table.realName, $db_member_table.ID_MEMBER FROM $db_log_online_table, $db_member_table WHERE $db_log_online_table.ID_MEMBER = $db_member_table.ID_MEMBER ORDER BY $db_log_online_table.`logTime` DESC", __FILE__, __LINE__);
echo "<br /><br /><a href=\\"tracker.php\\">Currently online:</a><br /><br />\\n";
while ($res = mysql_fetch_array($result))
echo "<a href=\\"$scripturl?action=profile;u=$res[ID_MEMBER]\\">Profile</a> or <a href=\\"?function=track;u=$res[ID_MEMBER]\\">Track</a>: $res[realName]<br />\\n";
mysql_free_result($result);
if (isset($gid))
{
// Get list of users in The Watch List
$result = db_query("SELECT * FROM $db_member_table WHERE $db_member_table.ID_Group = $gid or $db_member_table.`additionalGroups` LIKE \\"%$gid%\\"", __FILE__, __LINE__);
echo "<br /><br />Select the user you want to track:<br /><br />\\n";
while ($res = mysql_fetch_array($result))
echo "<a href=\\"$scripturl?action=profile;u=$res[ID_MEMBER]\\">Profile</a> or <a href=\\"?function=track;gid=$gid;u=$res[ID_MEMBER]\\">Track</a>: $res[realName]<br />\\n";
mysql_free_result($result);
echo "<br /><br /><a href=\\"tracker.php\\">Groups...</a>\\n";
}
else
{
// Get list of Groups
$result = db_query("SELECT * FROM $db_group_table", __FILE__, __LINE__);
echo "<br /><br />Select the group you want to view:<br /><br />\\n";
echo "<a href=\\"?gid=0\\">Default Group</a><br />\\n";
while ($res = mysql_fetch_array($result))
echo "<a href=\\"?gid=$res[ID_GROUP]\\">$res[groupName]</a><br />\\n";
mysql_free_result($result);
}
The above will always show, and allow you to pick from "Who's online".
Additionally, it will allow you to view a group.
Once you pick a group, it'll show the users in that group.
You can then pick them, or return to choose another group, or a specific user, etc.
This is a great little script... but without those timestamps he was talking about, it is somewhat expensive to run.
Quote from: edi67 on January 27, 2007, 06:07:16 PM
sorry but how i can permit to another usergroup to use this tracker?
help me please
Hmmm which tracker file did you use? ;)
Bye
DIN1031
Quote from: din1031 on January 28, 2007, 06:44:15 AM
Quote from: edi67 on January 27, 2007, 06:07:16 PM
sorry but how i can permit to another usergroup to use this tracker?
help me please
Hmmm which tracker file did you use? ;)
Bye
DIN1031
indifferent
i have all 2 both and your :)
Serach for
// Set this to restrict access. Currently only admins are allowed.
$isstaff = $user_info['is_admin'];
and replace it with:
// Set this to restrict access. Currently only admins are allowed.
$isstaff = $user_info['is_admin'] || in_array(2, $user_info['groups']);
This code || in_array(2, $user_info['groups']) is for global mods to be allowed to see this. To add more use this phrase and change the 2 to the id of the group who is allowed to use this and add it after the current phrase ;) For each allowed group you need to add this phrase.
Bye
DIN1031
excellent and perfect thx din ;)
Does anyone know if this scripts runs under smf 1.1.1? Cause I get this error when I try to run it:
"You are not Army.ca Staff".
I remember it working before with older SMFs, but now I'm not sure.
[edit]
Nevermind, I wasn't logged in to the forum.
[/edit]
Where can I download this mod please?
Hi babjusi,
The files are attached to the first post: http://www.simplemachines.org/community/index.php?topic=36793.msg269811#msg269811
Cheers
Mike
Quote from: Mike Bobbitt on February 08, 2007, 07:31:29 PM
Hi babjusi,
The files are attached to the first post: http://www.simplemachines.org/community/index.php?topic=36793.msg269811#msg269811
Cheers
Mike
Thanks for your answer, will this be coming as a mod? I mean zipped in a package that could be installed via the Package Manager? Thank u
Quote from: Mike Bobbitt on October 05, 2006, 04:40:24 PM
Yep, just create the group and identify the group ID# in the script.
Cheers
Mike
Does the group name "The Watch List" need to be just that or anything we create ?
I've changed the following bit to match "The Watch List" group yet nobody
shows and I have someone in there although they are banned ?
// Warning group IDs (primary)
$watchlist = "10";
babjusi: I'm not very good at packages, so I think for now I'd better not. It's completely standalone anyway, so no SMF files need to be modified. Just drop it in place and browse to it.
veldfire: The group name can be anything, so long as the group ID # is correct. I should have also mentioned... users need to have the specified group as an additional group, not a primary one. The idea is to "tag" a user in a way that is not visible.
You could change:
$result = db_query("SELECT * FROM $db_member_table WHERE $db_member_table.`additionalGroups` LIKE \"%$watchlist%\"", __FILE__, __LINE__);
to:
$result = db_query("SELECT * FROM $db_member_table WHERE $db_member_table.`ID_GROUP` LIKE \"%$watchlist%\"", __FILE__, __LINE__);
in order to use the primary group ID.
Thanks...Will give it a try.
Wha's about tracking pm activies? (e.g. number of pm send)
Any idea?
dr
That's something what is agains the smf condition. A PM is something privat and should be privat.
Bye
DIN1031
Quote from: DIN1031 on February 22, 2007, 12:56:59 PM
That's something what is agains the smf condition. A PM is something privat and should be privat.
Bye
DIN1031
I agree as well with DIN1031 about the privacy of the private messages
I'm using this, but for some users, I can't see the last topics accessed. I just have some info, not all info. I tried this with my account just to see and I see parts of the tracking information.
hi Smurfbutcher Bob,
I get errors on your echo lines of code, expecting a , or a ;
this line
echo "<br /><br /><a href=\\"tracker.php\\">Currently online:</a><br /><br />\\n";
for example,
anyoneknow why?
thanks,
nada
You need to remove those double-backslashes, Ladynada - they should be single. It's probably an effect of making the code into a forum post ::)
echo "<br /><br /><a href=\"tracker.php\">Currently online:</a><br /><br />\n";
You'll probably discover that the same thing has happened to a few other lines, as well - do a Find for \\ (double backslash) and make them all \ (single).
Quote from: Smurfbutcher Bob on April 01, 2007, 02:25:57 PM
You need to remove those double-backslashes, Ladynada - they should be single. It's probably an effect of making the code into a forum post ::)
echo "<br /><br /><a href=\"tracker.php\">Currently online:</a><br /><br />\n";
You'll probably discover that the same thing has happened to a few other lines, as well - do a Find for \\ (double backslash) and make them all \ (single).
thank you.
nada
Owners/moderators need to post something interesting every few days to keep a new forum 'ticking over'.
It would be great if something like this mod could send out an email when nothing has happened on a forum for eg 3 days.
Any word on the date/time stamp issue? I'd love to have that as part of the Tracker.
Rob
Is it also possible to modify Tracker to have it track user activity for a particular post?
Basically I'd like to see a list of who has read a specific post.
Rob
Is this still available? I'm on 1.1.2 and am looking for the ability to track user activity. I did not see any files attached to the original message, however.
This script tracks the recent actions of all users in The Watch List.
Could someone tell me what is causing these warnings?
Warning: Missing argument 2 for db_query() in /home/kelleyad/public_html/forums/Sources/Subs.php on line 238
Warning: Missing argument 3 for db_query() in /home/kelleyad/public_html/forums/Sources/Subs.php on line 238
Tracking mike...
Ι use SMF 1.1.3 ans the track user isnt working!
any ideas?
Quote from: KERA on June 28, 2007, 01:10:46 AM
Ι use SMF 1.1.3 ans the track user isnt working!
any ideas?
Same thing here. I keep getting some error message.
so still the same problem!
not working! ::) ::) ::) ::)
What error message you get KERA?
This is SUPER cool
Quote from: babjusi on June 28, 2007, 12:26:29 PM
What error message you get KERA?
I dont get any error but when I try to search an ip i dont get anything.
I dont know what I should do.
very strange some months ago worked perfectly now not more i have a lot of these errors trying to use it:
Errore del Database : No database selected
File: /home2/crazyzonews/www/Sources/Subs.php
Linea: 3362
Line 3362:
WHERE fc.userid IS NOT NULL
AND mem.ID_MEMBER != 0
ORDER BY mem.realName ASC", __FILE__, __LINE__);
some solution for fix it??
any ideas??????
I'm under the impression that this won't work with the new SMF 1.1 because the table smf_log_topics doesn't record the exact time someone last looked at the topic, only what the highest id_msg was at the time.
I believe kip is correct.
Have any of you considered PM'in Mike Bobbit and asking him if he can update the script? He has been active fairly recently.
it doesnt display the time and date for me
Yes, good script, but without date & time is completely useless... :(
Come on, I'm sure is not so hard to do this Time feature for an experienced php men.
like i said, has no-one tried PM'ing him to see if he can update it? IIRC this was written for 1.0... so naturally it probably wont work for 1.1...
Very nice!!!! Works perfectly and fulfills a need. Thanks!
--Ralph
http://urtvforums.org
Sweet... thanks for the tracker.
Very nice mod, and it appears to be working for me just fine.
SMF 1.1.4.
works great. even on 1.1.4
I wanted to say thanks to ButcherBob as well, his little snippet works perfectly. :]
Hello all!
I have the same error of Han...
Quote from: Han on February 20, 2006, 11:21:56 PM
User Tracker
This script tracks the recent actions of all users in The Watch List.
Warning: Missing argument 2 for db_query() in /home/pcnaviga/public_html/forum/Sources/Subs.php on line 237
Warning: Missing argument 3 for db_query() in /home/pcnaviga/public_html/forum/Sources/Subs.php on line 237
Tracking Han...
Jump to: Boards || Topics || Monitored Topics || Admin Actions || Errors
and I didn't understand how to solve. :(
Another question... How can I create a Watch List?
I need to track the actions done by an user... this user surf in the forum but never post (it isn't a bot, his IP address is from a big italian ISP and sometimes is logged on and sometimes surf as Visitor.
Isn't it possible to track the actions from an IP address in way to track also the actions when he isn't logged on?
Sorry for the confused questions, but by acknowledge in SMF are really at newbie level...
For your first issue, try this solution.
http://www.simplemachines.org/community/index.php?topic=36793.msg506933#msg506933
Quote from: rbdesign on March 20, 2007, 05:39:09 AM
I'm using this, but for some users, I can't see the last topics accessed. I just have some info, not all info. I tried this with my account just to see and I see parts of the tracking information.
this is happening to me too...
is there any pattern in the members it doesn't work for?
As I recall, argument 2 and 3 to db_query() are __FILE__ and __LINE__ respectively. I verified that every call has these 2 arguments, so it would seem that for some (inexplicably) they are not defined. I didn't think PHP could hide those, but maybe it's a global setting or something?
Is the 'no date/timstamp' issue just a fact of life for 1.1.4?
Thanks for the very cool mod. Not having it as an official downloadable package made it difficult to find though. I'm sure more would use it if it was 'main streamed' somehow, even though it doesn't need to be made into a package due to it's standalone nature. I had to search for 30 min before I finally hit upon the right words to dig up this thread. Anyway, how about those dates?
Using SMF 1.1.4, it shows me a blank page everytime I try to track an user :(
Do you see any errors in the error log for SMF or your web server/PHP?
Quote from: Mike Bobbitt on March 29, 2008, 12:35:57 PM
Do you see any errors in the error log for SMF or your web server/PHP?
Now is working fine!..strange.
Thanks!
Heh... glad to help! ;)
Love the tracker, tell me, its possible to track if someone viewed some profile? or if attempted to see it? thanks!
Unfortunately there is nothing logged in SMF when that happens. You could probably pick that info out of your web server logs though...
just installed this and it seems to be what i want ;)
but like cesarauz i am new to all this and also would
like to know how to create watch list
It's pretty easy actually... just create a new group, add it to the members you need to monitor (as a secondary group or else they'll see it!)
In tracker.php change this:
// Warning group IDs (primary)
$watchlist = "23";
to use the actual group ID# for the new group and you're all set!
Cheers
Mike
Quote(as a secondary group or else they'll see it!)
how do you add them as secondary group ?
sorry for being dumb
Sorry, the SMF term is actually Additional Group not secondary group. When you're editing a profile just click on "[ show additional groups ]" to show the full list.
right think i am with you now ;)
i will give it a go
yep got that ;D
will edit php now :o
cheers mike
that seems to have gone ok
just need to figure how what to do with it now ::)
awesome!
can this be done to track guest too? or ip?
Guests don't leave the same sort of trail in the SMF logs, so unfortunately not...
Guest do have activities isn't it? You confused me.
Nice tool! :) Thanks!
Is possible have this for SMF 2.0 ?
Yes that would be awesome to have it in 2.0
I have had it working on my boards since this tip was first posted.
Thanks
Bob
I also wonder if this is possible in SMF 2.
mike,
I want to allow my global mods to use this tool. Do you have any code snippet that i can add to your php so they can use it?
Never mind got it work.....thanks Mike
Quote from: Mike Bobbitt on May 24, 2005, 12:47:14 PM
I've created a simple script to track recent user activity on SMF. It's nothing fancy, but if you want to find out what people have been up to (useful for keeping tabs on potential trouble) you may find this handy.
Installation is simple, just drop it in to your SMF directory (same one that contains SSI.php), then browse to tracker.php.
You can enter the username, display name or user ID# for a user to track. Due to the nature of the info provided, currently only forum admins are allowed to run the script.
I've included a couple screen shots to show the general functionality.
Cheers
Mike
Update: Now shows moderator actions as well.
Did you put the tracker.php file in your forum directory?
if you did then in your browser type:
http://www.yourwebsiteaddress.com/forum/tracker.php
and that should do it :)
I hope this will be made to work with SMF 2.0
Yeah, really! And I just *LOVE* the installation: drag 'n drop! ;)
No worry that this will be the one that implodes your carefully set up forum. :)
may anybody post the complete installation working with 1.1.5 please ?
Jess,
I have my running on 1.1.5 and there were no probs making this work.
just follow these instructions and that's it.
Installation is simple, just drop it in to your SMF directory (same one that contains SSI.php), then browse to tracker.php.
You can enter the username, display name or user ID# for a user to track. Due to the nature of the info provided, currently only forum admins are allowed to run the script.
It cant be any easier :D
is it the same tracker.php like that at the first post in attachment ?
edit: okay, it works - but teh script shows all the boards in our Forum :( without timestamp
That's the one that i used. Just DL it and drop it in :)
Quote from: madman71 on August 19, 2008, 01:40:30 PM
That's the one that i used. Just DL it and drop it in :)
do you have timestamps in this script ?
If i recall correctly, no, i dont. I think SMF updated something that disabled this part of the mod. The reason is somewhere in this thread.
you might be interested in this mod http://custom.simplemachines.org/mods/index.php?mod=1300
It's a integrated into SMF unlike this one.
:o oh, i try to install this mod - thx ;)
CAn someone make this work on SMF 2.0?
Quote from: bros on September 30, 2008, 11:25:15 PM
CAn someone make this work on SMF 2.0?
Yeah..we'd like that too :)
Hah I tried this today... dropped it in my forum and when I browsed to it got the
following :
ERROR: You are not Army.ca Staff.
whatever that is!
Now.. if we could skin this and work it in then Id be in pure bliss
Great mod, thanks!
I changed it a bit to show my registered users what the admin user is doing.
I tried to upload my version and a patch file but was either too stupid to find a file upload button or simply don't have the rights to do it.
Nevertheless, if someone's interested, contact me and i'll mail you the files.
best regards,
Heiner
thank you so much this is a brilliant idea.
i recenlty had one user that registered three acounts and was setting up one particular thread for spamming links to his viagra site. using this i might have sussed him out earlier.
thanks again
All,
Sorry for the delay, I've finally built a version for SMF 2. It looks like attach permissions have been removed from this board, but I've put the new script up here for now:
http://army.ca/deleteme/tracker.zip
If this link stops working, contact me. :)
Thanks for your patience!
Mike
This is pretty cool thanks.
-JB
Thanks Mike 8)
Bob
I've made some changes to the tracker myself to include a few things i needed for what i'm using it for. But i'm a tard and didnt save the message i sent to Mike with the changes, so i'm just attaching my file. For smf 1.1.10
Additional code to display the primary groups of those added to the watch list, I've also added time stamps and edit the existing code to work with that, and html to skin it which will use the images from your forum template.
With this version though note i've limited the number of topics displayed to 50, with large communities we'd just end up with a mile long list but you can change this. And i'll include a small change you can make to the profile.php page to link the tracker through the track user link there.
Run these queries in phpmyadmin to add the logtime fields to the database tables we call the info from. Change the database prefix if yours differs.
ALTER TABLE `smf_log_boards` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `smf_log_topics` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
open the tracker.php file
On line 8 find
if (preg_match("/yoursite.com$/i", $_SERVER["HTTP_HOST"])) {
Replace yoursite.com with your domain
For the edit to link the tracker to the users profile
Open Sources/profile.php
find
$context['profile_areas']['info']['areas']['trackUser'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=trackUser">' . $txt['trackUser'] . '</a>';
Replace with
$context['profile_areas']['info']['areas']['trackUser'] = '<a href="./tracker.php?function=track;u=' . $memID . '">' . $txt['trackUser'] . '</a>';
I think i remembered everything.
download link to be updated
Fantastic, thanks for the great work Tones!
Tones, when I try and run those queries on my db, I get this error:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP'
I assume I can't use your version of the tracker without being able to alter my db unless I remove all references to the timestamps, correct?
Using 1.1.10 and MySQL Server version: 4.0.27-max-log
Blinker,
You'd have to be able to run the 2 ALTER TABLE commands near the top of Tones' post in order for his code changes to work.
Cheers
Mike
Run them individually
does this have the ability to see who moved what thread where?
Quote from: mandukar on September 16, 2009, 06:09:01 PM
does this have the ability to see who moved what thread where?
It appears to show what topic was moved by who on what i'm using, i didnt change anything drastic of what Mike had already done, so any of the versions on the thread will do. Ensure log moderation actions is checked under the features and options in the admin panel.
Quote from: Mike Bobbitt on September 16, 2009, 10:31:20 AMYou'd have to be able to run the 2 ALTER TABLE commands near the top of Tones' post in order for his code changes to work.
Yeah I figured that, it changes too much code from yours. I compared them beforehand to see what he changed. I've reverted back to yours until I can get this sorted.
Quote from: Tones on September 16, 2009, 06:00:18 PMRun them individually
I did.
I went into PMA, selected my db, clicked on SQL, pasted the first query only into the box and clicked go. Then I got that error.
Same thing happened with the second one.
Any ideas?
These commands may work better for you:
ALTER TABLE `smf_log_boards` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `smf_log_topics` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
Thanks Mike, i did send him a message and noted how to manually add them too. Hopefully it's helped, What i'll do too is edit my post with what you have
Quote from: Tones on September 12, 2009, 12:02:39 PM
I've made some changes to the tracker myself to include a few things i needed for what i'm using it for. But i'm a tard and didnt save the message i sent to Mike with the changes, so i'm just attaching my file. For smf 1.1.10
Additional code to display the primary groups of those added to the watch list, I've also added time stamps and edit the existing code to work with that, and html to skin it which will use the images from your forum template.
With this version though note i've limited the number of topics displayed to 50, with large communities we'd just end up with a mile long list but you can change this. And i'll include a small change you can make to the profile.php page to link the tracker through the track user link there.
Run these queries in phpmyadmin to add the logtime fields to the database tables we call the info from. Change the database prefix if yours differs.
ALTER TABLE `smf_log_boards` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `smf_log_topics` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
open the tracker.php file
On line 8 find
if (preg_match("/yoursite.com$/i", $_SERVER["HTTP_HOST"])) {
Replace yoursite.com with your domain
For the edit to link the tracker to the users profile
Open Sources/profile.php
find
$context['profile_areas']['info']['areas']['trackUser'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=trackUser">' . $txt['trackUser'] . '</a>';
Replace with
$context['profile_areas']['info']['areas']['trackUser'] = '<a href="./tracker.php?function=track;u=' . $memID . '">' . $txt['trackUser'] . '</a>';
I think i remembered everything.
www.habitat-zaby.com/tracker.zip
it appears to work so far. A couple issues I have though. Unless I've read it wrong you said you got the timestamps to work? but they just show zero's for me.
Also I get the following error when tracking some users
PHP Notice: Use of undefined constant logTime - assumed 'logTime' in C:\Forum\tracker.php on line 351
PHP Notice: Use of undefined constant logTime - assumed 'logTime' in C:\Forum\tracker.php on line 351
any ideas on that one?
Oh and it may be anal of me but your first edit in the tracker.php file is actually on line 14 not 8
okay the second issue was my fault, i missed something in the code but the files been edited now.
For anyone else seeing 0's where a time stamp should be, this is because there is no date/time logged (pre-tracker). As soon as people visit the boards after the changes etc have been made, then it will start to display the stamps.
Tones file works for me perfectly. I'm running 1.1.10
wow, i'm come back, this post is still popular
Quote from: Tones on September 12, 2009, 12:02:39 PM
I've made some changes to the tracker myself to include a few things i needed for what i'm using it for. But i'm a tard and didnt save the message i sent to Mike with the changes, so i'm just attaching my file. For smf 1.1.10
Additional code to display the primary groups of those added to the watch list, I've also added time stamps and edit the existing code to work with that, and html to skin it which will use the images from your forum template.
With this version though note i've limited the number of topics displayed to 50, with large communities we'd just end up with a mile long list but you can change this. And i'll include a small change you can make to the profile.php page to link the tracker through the track user link there.
Run these queries in phpmyadmin to add the logtime fields to the database tables we call the info from. Change the database prefix if yours differs.
ALTER TABLE `smf_log_boards` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `smf_log_topics` ADD `logTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
open the tracker.php file
On line 8 find
if (preg_match("/yoursite.com$/i", $_SERVER["HTTP_HOST"])) {
Replace yoursite.com with your domain
For the edit to link the tracker to the users profile
Open Sources/profile.php
find
$context['profile_areas']['info']['areas']['trackUser'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=trackUser">' . $txt['trackUser'] . '</a>';
Replace with
$context['profile_areas']['info']['areas']['trackUser'] = '<a href="./tracker.php?function=track;u=' . $memID . '">' . $txt['trackUser'] . '</a>';
I think i remembered everything.
www.habitat-zaby.com/tracker.zip
that trip work only for smf 1 ? because i have smf 2 and there isn't this line:
if (preg_match("/yoursite.com$/i", $_SERVER["HTTP_HOST"])) {
i have this:
if (preg_match("/(milnet|army|navy|air-force).ca$/i", $_SERVER["HTTP_HOST"])) {
That's right my file will only work for 1. I havent begun to look at 2 yet as rc2 is released for charter members and differences with the curve template which i gotta admit looks awesome.
Gosh, this is a great feature!
Does this work for 1.1.10?
The edits made by Tones work on 1.1.10 as stated.
Nice!
Where are the controls / buttons in the Admin Panel?
If it's mostly the same as the first post, it explains that there isn't an admin panel, it's a standalone page.
Thanks, I missed that.
This is a great tool! I'm going to have to try and tweak it a little for my own needs, but it is great!
Thank you for taking the time to create this.
Kratos
Edit: I made a very useful change that I want to share with everyone. (I had to make a new post because the edit wasn't displaying the code properly.)
Find:
echo "<br />Jump to: <a href=\"#boards\">Boards</a> || <a href=\"#topics\">Topics</a> || <a href=\"#monitor\">Monitored Topics</a> || <a href=\"#admin\">Admin Actions</a> || <a href=\"#errors\">Errors</a>";
Replace With:
echo "<br />Jump to: <a href=\"#boards\">Boards</a> || <a href=\"#topics\">Topics</a> || <a href=\"#monitor\">Monitored Topics</a> || <a href=\"#admin\">Admin Actions</a> || <a href=\"#errors\">Errors</a> || <a href=\"./tracker.php\">Tracker Home</a>";
All I added was "Tracker Home" to quickly get back the the front portion of the tracker page. NOTE: If you have changed the name of your tracker page (example: I changed the name of mine to "tracker_2_0.php), you need to reflect that change in the above "Replace With" code.
I hope this helps other as it has helped me. It is much easier when trying to track multiple users.
Kratos
This mod rocks!
Question...
Why am I not gettig IP addresses and times with my tracking info? All I get is a list of rooms visited. :(
Anyone have any advice?
Thanks!
Anyone?
Bueller? Bueller?
What do you see in the 'Current Action' section?
Any luck looking @ this?
Thanks!
Thanks Mike
Nothing is more important today is tracking our visitors, good job mate, thanks
James
:(
Its good ... well done great going.
comment deleted 1-09-10. problem solved.
Quote from: Han on July 25, 2005, 06:30:10 PM
It comes in handy in all occasions when the admin needs to know if a user has read a certain topic.
I'm very pleased with it!!
That's for sure..
This mod rocks!
Question...
Why am I not gettig IP addresses and times with my tracking info? All I get is a list of rooms visited. :(
Great mod
going to add it now. ;)
Quote from: Uhura! on January 12, 2010, 01:40:25 PM
This mod rocks!
Question...
Why am I not gettig IP addresses and times with my tracking info? All I get is a list of rooms visited. :(
Judging from the image you posted on the previous page, you're using the original file so havent made the adjustments to the database tables for logging times.
So, it isn't enough to install the mod - I have to write code and install additional items myself?
Is it possible to make this work for an IP- address?
This is interesting. I did something similar for my forum overall back when I was using 1.9 (http://www.simplemachines.org/community/index.php?topic=313896.msg2082815#msg2082815) I like this very much, Thanks.
http://leftlogic.com/lounge/articles/jquery_spy/
Yes that is the code I used.
But here you sound that you create the code.. http://www.simplemachines.org/community/index.php?topic=313896.msg2082815#msg2082815
To connect to the SMF database and grab the necessary information then format for the display yes. That's not built in functionality to the jQuery spy. In fact I made it quite clear where I got it from.
QuoteI got the idea by looking at the Digg Spy (http://labs.digg.com/bigspy/). I wanted to do something like this for my forum (1.1.9) some googling produced http://leftlogic.com/lounge/articles/jquery_spy/ which uses jquery to nab the contents of whatever you point it at at a specific interval.
It took a very little modifying to get it to work with the forums. I used the smf_log_online table to get an idea of what people were up too.
thought I made it clear, certainly didn't mean to make it sound like I had coded the entire thing just the part that formats the SMF information for display.
EDIT: Updated code to actually close the sql connection.
I am sorry you are right..
Great Mod
But I think if its have css
maybe its will more cool
I need some help. Mine doesn't show IP addresses :)
http://www.simplemachines.org/community/index.php?topic=36793.msg2386761#msg2386761
Quote from: Mike Bobbitt on May 24, 2005, 12:47:14 PM
I've created a simple script to track recent user activity on SMF. It's nothing fancy, but if you want to find out what people have been up to (useful for keeping tabs on potential trouble) you may find this handy.
This sounds nice Mike Bobbitt.
Can someone list exactly what activity is shown?
Thanks in advance.
is there a link for tones version floating around?
How do i add this to my forum ?
hello,
it can be really useful, it will definitely going to give an try. By this one can learn certain thing how it can target its user. Good work..!
Lorisplace,
It shows a list of users who belong to a usergroup you specify. When you click on a user, it shows:
Boards || Topics || Monitored Topics || Admin Actions || Errors
Basically anything it can find for that user.
Uhura!, sorry for the (very) late reply... IP addresses are only shown for Admin Actions... are you seeing them there? In SMF 2 you can use the "Track User" feature under their profile to see what IP addresses they have used.
Cheers
Mike
Nice! :D *bookmarked*
The Admin before me had this so that there was a link on every member's profile. In Sources>Profile.php I have the following code
// Groups with moderator permissions can also....
if (allowedTo('moderate_forum'))
{
$context['profile_areas']['info']['areas']['trackUserActivity'] = '<a href="http://www.myforum.com/tracker.php?function=track;u=' . $memID . '">' . $txt['trackUserActivity'] . '</a>';
(I have my real URL of course)
There were other instances of where it was added, but I think this could be where the main problem is
So on the Profile page, I just have a blank space under the Profile Info of where the link should be. :\ Any help would be greatly appreciated. Thanks!
do you have some echo in profile.template.php to print it on screen?
Also, do you have $txt['trackUserActivity'] defined somewhere? Could be that the URL has no text to link.
When you will modify this for SMF 2.0?
It should work with 2.0 RC4 already. Are you having problems with it on 2.0?
No, I just didn't saw this:
Quote from: Mike Bobbitt on May 24, 2005, 12:47:14 PM
Update [10 July 2009]: A new version for SMF 2 is now available, see http://www.simplemachines.org/community/index.php?topic=36793.msg2153231#msg2153231
Sorry. O:)
No worries, it was buried on page 12! I've updated the first post to have a link to the download.
My apologies, it appears I didn't have this set to notify me on new replies.
Quote from: flapjack on January 01, 2011, 02:58:33 PM
do you have some echo in profile.template.php to print it on screen?
No, it appears I do not. That is definitely the problem...however, I have no clue what to insert.
Quote from: Mike Bobbitt on January 03, 2011, 03:56:14 PM
Also, do you have $txt['trackUserActivity'] defined somewhere? Could be that the URL has no text to link.
Yes, I do.
I have 2 PHP files. One is simply Profile.php and the other is Profile.template.php. The Profile.php is where I have the code you have above, but it is missing from Profile.template.php.
Again, I'm not sure what code to put in Profile.template. Any help would be much appreciated! :)
if you can attach it here, I will have a look :)
Interesting...I do not have the ability to attach. ???
You are so sweet! Thank you:)
http://www.2shared.com/file/EWRcuy_e/Profiletemplate.html
try this (see lines 42-50):
http://pastebin.com/WVD7GWDr
Thanks, but no it did not work:(
any clues? it should appear as the last item on the profile menu, is it not there?
also, is there any error in the log?
No, it is not there. It looks like there is a place for it, but it is blank.
Regarding error logs - well that is a bit of a problem. My host updated Apache server a month ago, and it completely threw my forum out of whack. My custom themes tripped thousands of errors. I am creating a new theme from default and I'm still getting a lot of errors...so I am not seeing anything that is out of place, because technically everything is :s I've been living a bit of a nightmare for the past month that I'm trying to unravel!
Hi there,
I just installed this mod but it doesn't show any activity. All it shows is the following:
Track User Activity
This script tracks the recent actions of all users in The Watch List.
Is there a configuration page for this?
My smf is v.1.1.12 with the default theme.
Thank you.
Hi Eyesman,
No config page for it unfortunately, but you will want to change the group ID listed in the PHP file to match the group you want to monitor:
// Warning group IDs (primary)
$watchlist = "23";
Hi Mike,
If I understand correctly I have to change it every time I need to track a user?
Thanx!
No, you just change the watch list group to the group ID you want to use, then add users to that group (as a secondary membership) and they will appear on the list.
i got this error,
Fatal error: Call to undefined function db_query() in /home/mobtalk/public_html/tracker.php on line 110
Quote from: Jeet Chowdhury on January 28, 2011, 03:34:45 AM
i got this error,
Fatal error: Call to undefined function db_query() in /home/mobtalk/public_html/tracker.php on line 110
You're using 2.0. This does not work on 2.0 and will need to be rewritten to work on 2.0.
ok thank you arantor for the answer. :)
This is working with the SMF 2.0.
Then why is it calling 1.1.x functions?
Then he downloaded the wrong file.
Since when $smcFunc is SMF 1.1.x function?
It isn't, never has been. $func is the equivalent in SMF 1.1.x, for some things and db_query() for others.
I know that. I'm just sarcastic.
How do u get this to work in 2.0 Gold?
I get a "Fatal error: Call to undefined function db_query() in /home/theozcc1/public_html/tracker.php on line 294".
Thanks for looking.
Quote from: studiowi33 on July 02, 2011, 02:49:56 PM
How do u get this to work in 2.0 Gold?
I get a "Fatal error: Call to undefined function db_query() in /home/theozcc1/public_html/tracker.php on line 294".
Thanks for looking.
This should work:
<?php
/*
$Id: tracker.php,v 1.29 2006/02/21 14:11:48 bobbitt Exp $
Written by Mike Bobbitt for Army.ca
*/
// Place this script in the same directory as SSI.php, or set the path below
if (file_exists(dirname(__FILE__).'/SSI.php')) {
$ssifile = dirname(__FILE__).'/SSI.php';
} else {
$ssifile = "/var/www/html/forums/SSI.php";
}
// Are we running on Army.ca or standalone?
if (preg_match("/army.ca$/i", $_SERVER["HTTP_HOST"])) {
$armyca = 1;
} else {
$armyca = 0;
}
if ($armyca) {
include_once "/var/www/html/includes/header.php";
} else {
require ($ssifile);
// Set this to restrict access. Currently only admins are allowed.
$isstaff = $user_info['is_admin'];
}
// Make sure we have a DB prefix at least
if (!isset ($db_prefix)) {
$db_prefix = "`smf`.smf_";
}
// Database tables
// These are all default values, and should not need to be changed.
$db_member_table = "members";
$db_log_topics_table = "log_topics";
$db_message_table = "messages";
$db_topics_table = "topics";
$db_boards_table = "boards";
$db_log_boards_table = "log_boards";
$db_log_errors_table = "log_errors";
$db_log_notify_table = "log_notify";
$db_log_online_table = "log_online";
$db_log_actions_table = "log_actions";
// Make sure table name includes database name
$db_member_table = "$db_prefix$db_member_table";
$db_log_topics_table = "$db_prefix$db_log_topics_table";
$db_message_table = "$db_prefix$db_message_table";
$db_topics_table = "$db_prefix$db_topics_table";
$db_boards_table = "$db_prefix$db_boards_table";
$db_log_boards_table = "$db_prefix$db_log_boards_table";
$db_log_errors_table = "$db_prefix$db_log_errors_table";
$db_log_notify_table = "$db_prefix$db_log_notify_table";
$db_log_online_table = "$db_prefix$db_log_online_table";
$db_log_actions_table = "$db_prefix$db_log_actions_table";
if (!$isstaff) {
echo "ERROR: You are not Army.ca Staff.";
if ($armyca) {
include "$include_dir/footer.php";
}
exit (1);
}
// download variables
if (isset ($_REQUEST["function"])) {
$function = $_REQUEST["function"];
}
if (isset ($_REQUEST["u"])) {
$u = $_REQUEST["u"];
}
if (isset ($_REQUEST["user"])) {
$user = $_REQUEST["user"];
}
echo "<h1>User Tracker</h1>\n";
echo "This script tracks the recent actions of all users in The Watch List.<br /><br />\n";
// Warning group IDs (primary)
$watchlist = "23";
// Show "lookup user" form
if (!$function) {
echo<<<HTML
<div class="highlight">Track User</div><br /><br />
<form>
Username, Display Name or User ID #: <input type="text" name="user" />
<input type="hidden" name="function" value="trackuser" />
<br />
<input type="submit" value="Track User">
</form>
<br />
HTML;
}
if ($function == "trackuser") {
// it's a userid, not a username
if (preg_match("/^\d+$/", $user)) {
$u = $user;
} else {
// Generate query
$result = mysql_query("SELECT $db_member_table.`ID_MEMBER` FROM $db_member_table WHERE $db_member_table.`memberName` = \"$user\" OR $db_member_table.`realName` = \"$user\"", __FILE__, __LINE__);
$res = mysql_fetch_array($result);
$u = $res[0];
}
if (!$u) {
echo<<<HTML
<br />
<br />
WARNING: User $user not found. Please search again.
<br />
<br />
HTML;
} else {
$function = "track";
}
}
// Track a user
if ($function == "track") {
// Get username again
$result = mysql_query("SELECT $db_member_table.`realName` FROM $db_member_table WHERE $db_member_table.`ID_MEMBER` = \"$u\"", __FILE__, __LINE__);
$res = mysql_fetch_array($result);
$realName = $res[0];
mysql_free_result($result);
echo "Tracking <a href=\"$scripturl?action=profile;u=$u\">$realName</a>...<br />\n";
echo "<br />Jump to: <a href=\"#boards\">Boards</a> || <a href=\"#topics\">Topics</a> || <a href=\"#monitor\">Monitored Topics</a> || <a href=\"#admin\">Admin Actions</a> || <a href=\"#errors\">Errors</a>";
echo "<a name=\"boards\"><h2>Current Action</h2></a>";
// Get the user's current action
$result = mysql_query("SELECT * FROM $db_log_online_table WHERE $db_log_online_table.`ID_MEMBER` = \"$u\" ORDER BY $db_log_online_table.`logTime` DESC LIMIT 1", __FILE__, __LINE__);
echo "<table>";
while ($res = mysql_fetch_array($result)) {
echo "<tr><td>";
// Decode current action
global $sourcedir;
include_once ("$sourcedir/Who.php");
echo determineActions($res['url']);
echo "</td><td>";
if ($res['logTime']) {
echo $res['logTime'];
}
echo "</td></tr>\n";
}
echo "</table>";
mysql_free_result($result);
echo "<a name=\"boards\"><h2>Recent Boards</h2></a>";
// Get the user's board log
$result = mysql_query("SELECT * FROM $db_log_boards_table WHERE $db_log_boards_table.`ID_MEMBER` = \"$u\"", __FILE__, __LINE__);
echo "<table>";
while ($res = mysql_fetch_array($result)) {
// Get the board title
$result2 = mysql_query("SELECT $db_boards_table.`name` FROM $db_boards_table WHERE $db_boards_table.`ID_BOARD` = \"$res[ID_BOARD]\"", __FILE__, __LINE__);
$res2 = mysql_fetch_array($result2);
$name = $res2[0];
mysql_free_result($result2);
echo "<tr><td><a href=\"$scripturl/board,$res[ID_BOARD].0.html\">$name</a></td><td>";
if ($res['logTime']) {
echo date("Y/m/d H:i:s", $res['logTime']);
}
echo "</td></tr>\n";
}
echo "</table>";
mysql_free_result($result);
echo "<a name=\"topics\"><h2>Recent Topics</h2></a>";
// Get the user's topic log
$result = mysql_query("SELECT * FROM $db_log_topics_table WHERE $db_log_topics_table.`ID_MEMBER` = \"$u\" ORDER BY $db_log_topics_table.`ID_TOPIC` DESC", __FILE__, __LINE__);
echo "<table>";
while ($res = mysql_fetch_array($result)) {
// Get the topic title
$result2 = mysql_query("SELECT $db_message_table.`subject` FROM $db_message_table WHERE $db_message_table.`ID_TOPIC` = \"$res[ID_TOPIC]\"", __FILE__, __LINE__);
$res2 = mysql_fetch_array($result2);
$subject = $res2[0];
mysql_free_result($result2);
echo "<tr><td><a href=\"$scripturl/topic,$res[ID_TOPIC].0.html\">$subject</a></td><td>";
if ($res['logTime']) {
echo date("Y/m/d H:i:s", $res['logTime']);
}
echo "</td></tr>\n";
}
echo "</table>";
mysql_free_result($result);
echo "<a name=\"monitor\"><h2>Monitored Topics/Boards</h2></a>";
// Get the user's notifications list
$result = mysql_query("SELECT * FROM $db_log_notify_table WHERE $db_log_notify_table.`ID_MEMBER` = \"$u\"", __FILE__, __LINE__);
while ($res = mysql_fetch_array($result)) {
// Get the topic title
if ($res[ID_TOPIC]) {
$result2 = mysql_query("SELECT $db_message_table.`subject` FROM $db_message_table WHERE $db_message_table.`ID_TOPIC` = \"$res[ID_TOPIC]\"", __FILE__, __LINE__);
$res2 = mysql_fetch_array($result2);
$subject = $res2[0];
if (!$subject) {
$subject = "Not a valid topic.";
}
mysql_free_result($result2);
echo "<a href=\"$scripturl/topic,$res[ID_TOPIC].0.html\">$subject</a><br />\n";
}
if ($res[ID_BOARD]) {
// Get the board title
$result2 = mysql_query("SELECT $db_boards_table.`name` FROM $db_boards_table WHERE $db_boards_table.`ID_BOARD` = \"$res[ID_BOARD]\"", __FILE__, __LINE__);
$res2 = mysql_fetch_array($result2);
$subject = $res2[0];
mysql_free_result($result2);
echo "<a href=\"$scripturl/board,$res[ID_BOARD].0.html\">$subject</a><br />\n";
}
}
mysql_free_result($result);
echo "<a name=\"admin\"><h2>Admin Actions</h2></a>";
// Get the user's admin actions log
$result = mysql_query("SELECT * FROM $db_log_actions_table WHERE $db_log_actions_table.`ID_MEMBER` = \"$u\" ORDER BY $db_log_actions_table.`logTime` ASC", __FILE__, __LINE__);
echo<<<HTML
<table>
<tr>
<th>Datestamp</th><th>Action</th><th>Details</th><th>IP Address</th>
</tr>
HTML;
while ($res = mysql_fetch_array($result)) {
echo "<tr><td>";
echo date("Y/m/d H:i:s", $res['logTime'])."</td><td>";
echo $res['action']."</td><td>";
include_once ("$sourcedir/Who.php");
echo determineActions($res['extra'])."</td><td>";
echo $res['ip']."</td><td>";
echo "</tr>";
}
mysql_free_result($result);
echo "</table>";
echo "<a name=\"errors\"><h2>Recent Errors</h2></a>";
// Get the user's error log
$result = mysql_query("SELECT * FROM $db_log_errors_table WHERE $db_log_errors_table.`ID_MEMBER` = \"$u\" ORDER BY $db_log_errors_table.`logTime` DESC", __FILE__, __LINE__);
echo "<table>";
while ($res = mysql_fetch_array($result)) {
echo "<tr><td>$res[message]</td><td>";
echo date("Y/m/d H:i:s", $res[logTime]);
echo "</td></tr>\n";
}
echo "</table>";
mysql_free_result($result);
if ($armyca) {
include_once "$include_dir/footer.php";
}
exit (0);
}
// Get list of users in The Watch List
if ($armyca) {
$result = mysql_query("SELECT * FROM $db_member_table WHERE $db_member_table.`additionalGroups` LIKE \"%$watchlist%\"", __FILE__, __LINE__);
echo "Select the user you want to track:<br /><br />\n";
while ($res = mysql_fetch_array($result)) {
echo "<a href=\"$scripturl?action=profile;u=$res[ID_MEMBER]\"><img align=\"middle\" src=\"http://army.ca/forums/Themes/Armyca/images/icons/profile_sm.gif\" border=\"0\"></a> <a href=\"?function=track;u=$res[ID_MEMBER]\">$res[realName]</a><br />\n";
}
mysql_free_result($result);
include "$include_dir/footer.php";
}
?>
thanks Doc,
but(!)...
It doesn't show who's online (like it used to,) so i imputted my own user ID and got these:
User Tracker
This script tracks the recent actions of all users in The Watch List.
Warning: Wrong parameter count for mysql_query() in /home/theozcc1/public_html/Ztracker.php on line 131
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 132
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 134
Tracking ...
Jump to: Boards || Topics || Monitored Topics || Admin Actions || Errors
Current Action
Warning: Wrong parameter count for mysql_query() in /home/theozcc1/public_html/Ztracker.php on line 143
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 147
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 163
Recent Boards
Warning: Wrong parameter count for mysql_query() in /home/theozcc1/public_html/Ztracker.php on line 168
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 172
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 186
Recent Topics
Warning: Wrong parameter count for mysql_query() in /home/theozcc1/public_html/Ztracker.php on line 191
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 195
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 209
Monitored Topics/Boards
Warning: Wrong parameter count for mysql_query() in /home/theozcc1/public_html/Ztracker.php on line 214
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 216
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 239
Admin Actions
Warning: Wrong parameter count for mysql_query() in /home/theozcc1/public_html/Ztracker.php on line 244
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 253
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 262
Datestamp Action Details IP Address
Recent Errors
Warning: Wrong parameter count for mysql_query() in /home/theozcc1/public_html/Ztracker.php on line 268
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 272
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/theozcc1/public_html/Ztracker.php on line 278
I appreciate the effort Doc, just isn't working :(
EDIT: After reverting to the original tracker.php file, this is the contents of line 289...
$result = db_query("SELECT $db_member_table.realName, $db_member_table.ID_MEMBER FROM $db_log_online_table, $db_member_table WHERE $db_log_online_table.ID_MEMBER = $db_member_table.ID_MEMBER ORDER BY $db_log_online_table.`logTime` DESC", __FILE__, __LINE__);
I can't see any online users to track and before upgrading to 2.0, I was able to simply click on the name. It kinda works now, but I have to manually enter a User ID into the "Track User" form.
(Sorry if I'm dense about this, it's a great feature.)
(http://imageshack.us/photo/my-images/41/tua.png/)
Uploaded with ImageShack.us (http://imageshack.us)
Thanks for the script I installed it, will let you know how it works.
nice script.
i'll install it later to my website...
It works great. :)
works great, thx ::)
The mod is great! Thank you for your work!
I've tested it with 2.0.2 and it works like a charm!
I've only one question still...
Is it possible to log topic's views only it certain board?
I've looked on tvl_log function (in Sources/TopicViewLog.php), but I do not see the way to accomplish this task. I know the board ID, but how to use it...
i'm givingv a try on my forum, and it works great doing the job, but i have this error displayed
any idea ?
sorry for the link on imagebam, but i can't attach files
I just installed this on my SMF 2.0.2 but when I type in a username I get the error:
"Fatal error: Call to undefined function db_query() in /home/content/28/74****8/html/sabrinova/tracker.php on line 110"
How do I make it work?
My line 110 is this if that helps:
$result = db_query("SELECT $db_member_table.`ID_MEMBER` FROM $db_member_table WHERE $db_member_table.`memberName` = \"$user\" OR $db_member_table.`realName` = \"$user\"", __FILE__, __LINE__);
I uploaded this and got an error saying this package was empty
Thanks :)
Quote from: Sabrinova on February 29, 2012, 04:16:29 PM
I just installed this on my SMF 2.0.2 but when I type in a username I get the error:
"Fatal error: Call to undefined function db_query() in /home/content/28/74****8/html/sabrinova/tracker.php on line 110"
How do I make it work?
Ok just reealised my error - doh!! I had downloaded the original file rather than the v2 update on page 12. It's working now!
hmmm i was looking for that thanks for sharing
This is great but I get the following errors:
( ! ) Notice: Undefined variable: function in Z:\wamp\www\tracker.php on line 61
Call Stack
# Time Memory Function Location
1 0.0025 173856 {main}( ) ..\tracker.php:0
( ! ) Notice: Undefined variable: function in Z:\wamp\www\tracker.php on line 74
Call Stack
# Time Memory Function Location
1 0.0025 173856 {main}( ) ..\tracker.php:0
( ! ) Notice: Undefined variable: function in Z:\wamp\www\tracker.php on line 101
Call Stack
# Time Memory Function Location
1 0.0025 173856 {main}( ) ..\tracker.php:0
Any ideas?
I just found this, and it's very useful and working good on 2.0.11
I wanted to be the only one that can access it, despite there being other admins, so i changed this:
// Set this to restrict access. Currently only admins are allowed.
$isstaff = $context['user']['is_admin'];
}
if (!$isstaff)
{
echo "ERROR: You are not an admin - ACCESS DENIED. ($isstaff)";
to this:
// Set this to restrict access to one user only. Set $allowedid to the user you want to have access.
}
$allowedid = '3';
{
if ($context['user']['id'] != $allowedid) {
echo "ERROR: ACCESS DENIED.";
Another trick is to create another Admin group and make your other admins faux Admins, then set their permissions such as to give them everything except what you want them to keep their fingers off of.
Technically there is no real Admin group since a real Admin has ALL privileges. By creating a named Admin permission group you can give them what you want and only what you want.
Downloading the updated file for 2.0 and simply dropping the file (as is) into my forum's root, where the SSI.php lives, results in a blank page. I see that others with 2.0.11 have been successful:
http://www.simplemachines.org/community/index.php?topic=36793.msg3865821#msg3865821 (http://www.simplemachines.org/community/index.php?topic=36793.msg3865821#msg3865821)
Mike Bobbitt, we hardly knew ye! :D
Hope you stop by, or someone with some know-how can walk me through this. I've been looking for a way to track user activity for a long time and this is the only thing I've found (other than current activity, that goes away when the user logs off).
What does your web server error log say? Usually a blank page is HTTP 500 which means PHP threw an error. With any luck your host is configured to include some of that info in the logs.
Quote from: Mike Bobbitt on July 25, 2016, 01:09:58 PM
What does your web server error log say? Usually a blank page is HTTP 500 which means PHP threw an error. With any luck your host is configured to include some of that info in the logs.
Mike Bobbitt, you're real! (I thought you were one of those legendary posters who had ridden off into the sunset.) :D
Well, that's the odd thing; there are no errors at all in my server logs since July 23rd. I have nothing for today, at all. Odd.
I didn't edit the file at all; I just unzipped it and uploaded it into my forum's root. It's 2.0.11 default, but I saw where someone else with 2.0.11 has it working. I'll try it on another forum to see if it behaves the same.
Hmmm... I have three forums; one production and two test. They're all hosted on the same dedicated server (Codero). The tracker works on only one test forum. It happens to be the one with no portal and hardly any mods, so I'm guessing I've got mod interference?
I'm using it on 2.0.11 with no issues, I updated the zip with the file I was using (there were very minor changes):
http://army.ca/deleteme/tracker.zip
If it's in the same dir as SSI.php it "should" work. If you have console access, you can run it on the command line and see if it pops out any errors, E.G.:
[root@thunderdome 14] deleteme > php -f tracker.php
PHP Notice: Undefined index: HTTP_HOST in /path/to/deleteme/tracker.php on line 22
PHP Warning: require(/var/www/html/forums/SSI.php): failed to open stream: No such file or directory in /path/to/deleteme/tracker.php on line 31
PHP Fatal error: require(): Failed opening required '/var/www/html/forums/SSI.php' (include_path='.:/usr/share/pear:/usr/share/php') in /path/to/deleteme/tracker.php on line 31
Aha..... all I'm getting (but at least I'm getting something) is
Error 500 GET /bucket/tracker.php HTTP/1.1
I'm just sitting here blinking at it; I'm not sure what that means.... :-\
(That's with your latest zip.)
Wait..... I fired it up in Firefox and got this:
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
Quote from: Grammy on July 25, 2016, 03:09:41 PM
Wait..... I fired it up in Firefox and got this:
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
*little 24-hour bump*
So I was wondering... Am I meant to edit the Tracker file with some sort of charset? It doesn't have a head tag, so I'm uncertain of how to do that in a PHP file. :-\
This is exactly what I'm looking for. I have installed and play with it. Thanks!
I can't find this mod on mod list?
Quote from: Mike Bobbitt on May 24, 2005, 12:47:14 PM
You can download the files from here: http://army.ca/deleteme/tracker.zip
@Mike Bobbitt: Was wonderinf if I could get your permission to make this script into a proper mod, complete with permissions and a profile entry? Thanks for your consideration!
Wondering if this should still work on 2.0.15?
When i try to use it i get the following:
Track User Activity
This script tracks the recent actions of all users in The Watch List.
An Error Has Occurred!
The database value you're trying to insert does not exist: id_member
Back
Thanks
Works very well with update.
I have this tracker installed. It works well, except it doesn't show the timestamp of the visit.
I'm using tracker.php from page 12 for SMF 2.0
Does anyone know how to fix it?
Thanks
It's problem to install !! Fix error.
Quote from: Zeblan on April 27, 2021, 12:17:49 PM
It's problem to install !! Fix error.
um....and how is this going to help
what exactly do you expect to happen with this type of post? How do you expect to get any kind of support at all with "It's problem to install !! Fix error." what does this tell us? Nothing!
How about telling us what the error that you received was....
How about telling us what version of smf you are using?
How about telling us what other mods you have installed?
Just to begin with...there may be other things we might need to know after this to help you.
[edit] lmfao um how is it a problem to install, you just download the file, unzip the file, then upload to your smf root folder (the same place that setttings.php is).... couldn't be easier to install.
It looks great! I will try it right away to see, if I can get it to work in the same way!
Quote from: shadav on April 27, 2021, 01:17:45 PMQuote from: Zeblan on April 27, 2021, 12:17:49 PMIt's problem to install !! Fix error.
um....and how is this going to help
what exactly do you expect to happen with this type of post? How do you expect to get any kind of support at all with "It's problem to install !! Fix error." what does this tell us? Nothing!
How about telling us what the error that you received was....
How about telling us what version of smf you are using?
How about telling us what other mods you have installed?
Just to begin with...there may be other things we might need to know after this to help you.
[edit] lmfao um how is it a problem to install, you just download the file, unzip the file, then upload to your smf root folder (the same place that setttings.php is).... couldn't be easier to install.
Sorry to bump this topic, but the post quoted by
@shadav is actually one of posts that I had in mind when I started the mnetalo topic :D
I think that will solve this kind of problem for you in the future shadav. :D
https://www.simplemachines.org/community/index.php?topic=580449.msg4108862#msg4108862