vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Track 1 user (https://vborg.vbsupport.ru/showthread.php?t=37129)

Zzed 04-06-2002 10:00 PM

Track 1 user
 
This hack allows you to track a single user with frequent updates set at 5
second intervals. This hack was originally requested by Riddel.

The hack is based on online.php. The way to call it is by passing it the
userid of the member you wish to track.

Like this: online.php?userid=####

Where #### is the userid of the member to track:

Example: online.php?userid=1 (If you want to track the site admin) :)

In online.php:

Look for the following code:
PHP Code:

 $allusers$DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, sessi\
on.host, user.showemail, user.receivepm
                              FROM session
                              "
iif($WOLguests" LEFT JOIN user USING (userid) "",user") ."
                              WHERE session.lastactivity > 
$datecut
                              "
iif(!$WOLguests" AND session.userid = user.userid""") ."
                              ORDER BY user.username
                              "
);

 
$moderators $DB_site->query("SELECT DISTINCT userid FROM moderator");
 while (
$mods $DB_site->fetch_array($moderators)) {
        
$mod[$mods[userid]] = 1;
 } 

And replace it with the following:
PHP Code:

if($userid)
{
unset(
$WOLrefresh);
    
$metarefresh "<META HTTP-EQUIV=\"refresh\" CONTENT=\"5; URL=online.php?userid=$userid\"> ";

 
$allusers$DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, sessi\
on.host, user.showemail, user.receivepm
                              FROM session
                              "
iif($WOLguests" LEFT JOIN user USING (userid) "",user") ."
                              WHERE session.lastactivity > 
$datecut
                              "
iif(!$WOLguests" AND session.userid = user.userid""") ."
                              AND user.userid = 
$userid
                              ORDER BY user.username
                              "
);
}
else{
 
$allusers$DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, sessi\
on.host, user.showemail, user.receivepm
                              FROM session
                              "
iif($WOLguests" LEFT JOIN user USING (userid) "",user") ."
                              WHERE session.lastactivity > 
$datecut
                              "
iif(!$WOLguests" AND session.userid = user.userid""") ."
                              ORDER BY user.username
                              "
);

 
$moderators $DB_site->query("SELECT DISTINCT userid FROM moderator");
 while (
$mods $DB_site->fetch_array($moderators)) {
        
$mod[$mods[userid]] = 1;
 }



Velocd 04-07-2002 07:04 PM

Screenshots or anything if available? I can't see the purpose of this..why track a single user when Who's Online tracks all online users. :?

Zzed 04-07-2002 07:54 PM

I had a typo in my original post. I was pointing to the wrong URL in my META tag. Sorry. :(

Velocd, when you have too many users online, it becomes a little botersome to scroll down to a particular user and track them.

Here is a screenshot. I am tracking myself on my board.

JulianD 04-07-2002 08:40 PM

Thanks Zzed. Very nice... I will not install it on my boards, since we don't have too much members online, but I am subscribing to the thread, I will probably need this in a future day.

Thanks for the great job

wolfman 03-13-2003 02:10 AM

Well the code got slightly mangled when you posted


PHP Code:

if($userid)
{
unset(
$WOLrefresh);
    
$metarefresh "<META HTTP-EQUIV=\"refresh\" CONTENT=\"5; URL=online.php?userid=$userid\"> ";

 
$allusers$DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, sessi\
on.host, user.showemail, user.receivepm
                              FROM session
                              "
iif($WOLguests" LEFT JOIN user USING (userid) "",user") ."
                              WHERE session.lastactivity > 
$datecut
                              "
iif(!$WOLguests" AND session.userid = user.userid""") ."
                              AND user.userid = 
$userid
                              ORDER BY user.username
                              "
);
}
else{
 
$allusers$DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, sessi\
on.host, user.showemail, user.receivepm
                              FROM session
                              "
iif($WOLguests" LEFT JOIN user USING (userid) "",user") ."
                              WHERE session.lastactivity > 
$datecut
                              "
iif(!$WOLguests" AND session.userid = user.userid""") ."
                              ORDER BY user.username
                              "
);

 
$moderators $DB_site->query("SELECT DISTINCT userid FROM moderator");
 while (
$mods $DB_site->fetch_array($moderators)) {
        
$mod[$mods[userid]] = 1;
 }


It should have looked like this


PHP Code:

if($userid)
{
unset(
$WOLrefresh);
    
$metarefresh "<META HTTP-EQUIV=\"refresh\" CONTENT=\"5; URL=online.php?userid=$userid\"> ";

 
$allusers$DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, session.host, user.showemail, user.receivepm
                              FROM session
                              "
iif($WOLguests" LEFT JOIN user USING (userid) "",user") ."
                              WHERE session.lastactivity > 
$datecut
                              "
iif(!$WOLguests" AND session.userid = user.userid""") ."
                              AND user.userid = 
$userid
                              ORDER BY user.username
                              "
);
}
else{
 
$allusers$DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, session.host, user.showemail, user.receivepm
                              FROM session
                              "
iif($WOLguests" LEFT JOIN user USING (userid) "",user") ."
                              WHERE session.lastactivity > 
$datecut
                              "
iif(!$WOLguests" AND session.userid = user.userid""") ."
                              ORDER BY user.username
                              "
);

 
$moderators $DB_site->query("SELECT DISTINCT userid FROM moderator");
 while (
$mods $DB_site->fetch_array($moderators)) {
        
$mod[$mods[userid]] = 1;
 }


Hopefully this time it wont get mangled, but the hack works great I had no problems installing it on vb 2.3.0 rc1

Sho 03-16-2003 01:20 PM

A real tracking solution would be nice. So it preserves the old action after refreshing itself - and only updates when there's something new. So after a few minutes and two dozen auto-refreshs, you'd have a list like this :

14:56: Looking at forum X
14:57: Creating new thread in forum X
15:02: Looking at new thread Y
15:03: Main Index

etc.

Erwin 03-16-2003 09:22 PM

Please put the code for the hack in a TEXT file and attach it.

It allows people to download the code and store it. :)


All times are GMT. The time now is 12:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01198 seconds
  • Memory Usage 1,781KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete