Advertisement:

Author Topic: Tracking User Activity  (Read 281391 times)

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Tracking User Activity
« Reply #320 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?
« Last Edit: March 03, 2012, 06:42:26 PM by Sabrinova »

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Tracking User Activity
« Reply #321 on: March 03, 2012, 06:41:38 PM »
My line 110 is this if that helps:

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

Offline XHIBIT911

  • Jr. Member
  • **
  • Posts: 264
    • PSHomeSource.com
Re: Tracking User Activity
« Reply #322 on: March 10, 2012, 09:37:45 AM »
I uploaded this and got an error saying this package was empty

Offline MetalMusicMan

  • Semi-Newbie
  • *
  • Posts: 35
  • www.MetalMusicMan.com
    • MetalMusicMan.com
Re: Tracking User Activity
« Reply #323 on: March 13, 2012, 10:38:24 AM »
Thanks :)

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

-- Duncan MacLeod, Highlander (S1E20)

Admin of MetalMusicMan.com

Offline Chalky

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,360
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Tracking User Activity
« Reply #324 on: March 18, 2012, 04:50:40 AM »
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!

Offline matricrsult

  • Newbie
  • *
  • Posts: 5
Re: Tracking User Activity
« Reply #325 on: April 24, 2012, 03:42:23 AM »
hmmm i was looking for that thanks for sharing

Offline llyon

  • Semi-Newbie
  • *
  • Posts: 25
Re: Tracking User Activity
« Reply #326 on: April 21, 2013, 04:18:23 AM »
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?

Offline blevok

  • Newbie
  • *
  • Posts: 9
Re: Tracking User Activity
« Reply #327 on: March 16, 2016, 02:42:00 PM »
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:
Code: [Select]
// 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:
Code: [Select]
// 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.";

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: Tracking User Activity
« Reply #328 on: March 16, 2016, 05:54:41 PM »
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.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Tracking User Activity
« Reply #329 on: July 25, 2016, 10:53:34 AM »
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).

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 597
    • Army.ca
Re: Tracking User Activity
« Reply #330 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.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Tracking User Activity
« Reply #331 on: July 25, 2016, 02:06:40 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?

Offline Mike Bobbitt

  • Full Member
  • ***
  • Posts: 597
    • Army.ca
Re: Tracking User Activity
« Reply #332 on: July 25, 2016, 02:37:34 PM »
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.:

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


Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Tracking User Activity
« Reply #333 on: July 25, 2016, 03:02:51 PM »
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.)

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Tracking User Activity
« Reply #334 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.

Offline Grammy

  • Full Member
  • ***
  • Posts: 423
  • Gender: Female
  • Tire Kicker
Re: Tracking User Activity
« Reply #335 on: July 26, 2016, 04:17:52 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.   :-\

Offline johnlegend

  • Newbie
  • *
  • Posts: 1
Re: Tracking User Activity
« Reply #336 on: October 19, 2017, 12:54:50 AM »
This is exactly what I'm looking for. I have installed and play with it. Thanks!

Offline efk

  • Semi-Newbie
  • *
  • Posts: 87
  • Gender: Male
Re: Tracking User Activity
« Reply #337 on: October 19, 2017, 12:42:53 PM »
I can't find this mod on mod list?

Offline d3vcho();

  • Localizer
  • SMF Hero
  • *
  • Posts: 2,188
  • Gender: Male
  • Be prepared for hell
    • d3vcho on GitHub
    • @SMF_ES on Twitter
Re: Tracking User Activity
« Reply #338 on: October 19, 2017, 01:05:21 PM »

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,366
    • XPtsp.com Community
Re: Tracking User Activity
« Reply #339 on: November 17, 2017, 03:42:41 PM »
@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!
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!