Advertisement:

Author Topic: Tracking User Activity  (Read 211830 times)

Offline itsjustme

  • Semi-Newbie
  • *
  • Posts: 35
Re: Tracking User Activity
« Reply #60 on: November 05, 2005, 02:23:51 PM »
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

DogAddicts is a community for people who are passionate about their dogs.

WannaFindit.com

a Search place

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #61 on: November 05, 2005, 05:57:31 PM »
Try something like this:

Code: [Select]
$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

Offline blinddruid

  • Semi-Newbie
  • *
  • Posts: 88
Re: Tracking User Activity
« Reply #62 on: November 05, 2005, 08:57:53 PM »
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? 

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #63 on: November 05, 2005, 09:14:48 PM »
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.

Offline HoTmetal

  • Marketing Consultant
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,984
Re: Tracking User Activity
« Reply #64 on: November 06, 2005, 01:42:32 AM »
[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...

Offline jrstark

  • Jr. Member
  • **
  • Posts: 135
Re: Tracking User Activity
« Reply #65 on: December 19, 2005, 12:33:23 AM »
Right now it is showing my server time (GMT).  Can I change it to show my local time?

Offline zaandammer

  • Semi-Newbie
  • *
  • Posts: 38
  • Gender: Male
Re: Tracking User Activity
« Reply #66 on: December 19, 2005, 01:06:48 PM »
It's giving me this error.

Code: [Select]
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.

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #67 on: December 19, 2005, 02:28:53 PM »
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?

Offline zaandammer

  • Semi-Newbie
  • *
  • Posts: 38
  • Gender: Male
Re: Tracking User Activity
« Reply #68 on: December 19, 2005, 03:10:53 PM »
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.

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #69 on: December 19, 2005, 03:12:02 PM »
Do you have shell access? If so, try running "php -f tracker.php" to get the base output from it.

Offline zaandammer

  • Semi-Newbie
  • *
  • Posts: 38
  • Gender: Male
Re: Tracking User Activity
« Reply #70 on: December 19, 2005, 03:15:55 PM »
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.

Offline damacguy

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Male
    • Atlanta Macintosh Users Group
Re: Tracking User Activity
« Reply #71 on: December 29, 2005, 11:31:25 AM »
I got this error when I try and go to the tracker (http://myforum/path/tracker.php - same location as my SSI file)

Code: [Select]
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
Code: [Select]
// 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.
-DaMacGuy

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #72 on: December 29, 2005, 02:23:34 PM »
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?

Offline damacguy

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Male
    • Atlanta Macintosh Users Group
Re: Tracking User Activity
« Reply #73 on: December 29, 2005, 11:16:09 PM »
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.
-DaMacGuy

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #74 on: December 30, 2005, 08:24:49 AM »
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...

Offline damacguy

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Male
    • Atlanta Macintosh Users Group
Re: Tracking User Activity
« Reply #75 on: January 02, 2006, 01:02:11 PM »
I commented out that entire else statement (from } else { through... the closing } before if (!$u) {) and the error change to line 108.

Huh?   :-\
-DaMacGuy

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #76 on: January 02, 2006, 01:41:18 PM »
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...

Offline damacguy

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Male
    • Atlanta Macintosh Users Group
Re: Tracking User Activity
« Reply #77 on: January 02, 2006, 01:54:47 PM »
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.
-DaMacGuy

Offline Dean Williams

  • Jr. Member
  • **
  • Posts: 181
  • Gender: Male
  • Web Developer
    • resplace
Re: Tracking User Activity
« Reply #78 on: January 02, 2006, 04:48:18 PM »
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

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 566
    • Army.ca
Re: Tracking User Activity
« Reply #79 on: January 02, 2006, 05:19:44 PM »
It was designed to work on 1.1 RC1, so some of the links may not be properly formed for 1.0.5.