News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Tracking User Activity

Started by Mike Bobbitt, May 24, 2005, 12:47:14 PM

Previous topic - Next topic

itsjustme

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

Mike Bobbitt

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

blinddruid

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? 

Mike Bobbitt

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.

HoTmetal

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...

jrstark

Right now it is showing my server time (GMT).  Can I change it to show my local time?

zaandammer

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.

Mike Bobbitt

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?

zaandammer

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.

Mike Bobbitt

Do you have shell access? If so, try running "php -f tracker.php" to get the base output from it.

zaandammer

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.

damacguy

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.

Mike Bobbitt

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?

damacguy

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.

Mike Bobbitt

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...

damacguy

I commented out that entire else statement (from } else { through... the closing } before if (!$u) {) and the error change to line 108.

Huh?   :-\

Mike Bobbitt

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...

damacguy

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.

Dean Williams

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

Mike Bobbitt

It was designed to work on 1.1 RC1, so some of the links may not be properly formed for 1.0.5.

Advertisement: