Announcement

Collapse
No announcement yet.

How do I see how many people have been online in 2 hours?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I see how many people have been online in 2 hours?

    ...or any time really, without changing the setting in the options?

    I want to see how many people have been in our forums for the past 2 hours, but I don't want to change the option in the control panel because I don't want the Max Ever Users to change because of it.

    Any MYSQL query I can run to do this?

    Thanks!

  • #2
    Put this code into a php file, upload it to your forum directory, and run it from your web browser. It will tell you how many users were online in the last 2 hours and give you a list of usernames. This won't change anything, only list information:

    PHP Code:
    <?php

    include("global.php");

    $count 0;

    $array $DB_site->query("SELECT username
        FROM user
        WHERE lastactivity > (
    $ourtimenow - 7200)
        "
    );

    while (
    $userinfo $DB_site->fetch_array($array)) {
        
    $list .= $userinfo[username] . "<br>";
        
    $count++;
    }

    echo (
    "Total users online in the last 2 hours: " $count "<br><br>");
    echo (
    $list);

    ?>
    I tested it on my forums and it appeared to work correctly.

    Comment


    • #3
      Nice mod Jake.
      You're my Prince of Peace
      And I will live my life for You

      Comment


      • #4
        That works great, thanks!

        Would there be a simple way to see how many people were in a particular forum? Or is that a much more complicated process?

        Comment


        • #5
          Originally posted by Vigile
          Would there be a simple way to see how many people were in a particular forum? Or is that a much more complicated process?
          much more complicated. that would be a www.vbulletin.org request.

          Comment

          Loading...
          Working...
          X