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

Chalky

#320
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?

Chalky

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__);

XHIBIT911

I uploaded this and got an error saying this package was empty

MetalMusicMan


"How'd you get to be so smart?"
"Trial and error."

-- Duncan MacLeod, Highlander (S1E20)

Admin of MetalMusicMan.com

Chalky

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!

matricrsult

hmmm i was looking for that thanks for sharing

llyon

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?

blevok

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

Deprecated

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.

Grammy

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

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

Mike Bobbitt

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.

Grammy

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?

Mike Bobbitt

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



Grammy

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

Grammy

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.

Grammy

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

johnlegend

This is exactly what I'm looking for. I have installed and play with it. Thanks!

efk

I can't find this mod on mod list?

d3vcho

"Greeting Death as an old friend, they departed this life as equals"

dougiefresh

@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!

Advertisement: