Announcement

Collapse
No announcement yet.

Active members calculation.

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

  • Active members calculation.

    My cut-off for active members is 105 days. Running some external queries doesn't match the values shown under Forum Statistics in FORUMHOME.

    I added some debugging to the daily stats cron and came up with something interesting:

    This is the query that runs:
    Code:
    SELECT SUM(IF(lastvisit >= 1136340854, 1, 0)) AS active, COUNT(*) AS users, MAX(userid) AS maxid FROM vb3_user
    This is the result:
    Code:
    mysql> SELECT SUM(IF(lastvisit >= 1136340854, 1, 0)) AS active, COUNT(*) AS users, MAX(userid) AS maxid FROM vb3_user;
    +--------+-------+-------+
    | active | users | maxid |
    +--------+-------+-------+
    |   2988 |  3216 |  5086 |
    +--------+-------+-------+
    1 row in set (0.01 sec)
    However, if I run what should be a comparable query:
    Code:
    select count(userid) from vb3_user where lastvisit >= 1136340854;
    I get a different result:
    Code:
    mysql> select count(userid) from vb3_user where lastactivity >= 1136340854;
    +---------------+
    | count(userid) |
    +---------------+
    |          3138 |
    +---------------+
    1 row in set (0.01 sec)
    What am I missing?

  • #2
    Originally posted by erond
    My cut-off for active members is 105 days. Running some external queries doesn't match the values shown under Forum Statistics in FORUMHOME.

    I added some debugging to the daily stats cron and came up with something interesting:

    This is the query that runs:
    Code:
    SELECT SUM(IF(lastvisit >= 1136340854, 1, 0)) AS active, COUNT(*) AS users, MAX(userid) AS maxid FROM vb3_user
    This is the result:
    Code:
    mysql> SELECT SUM(IF(lastvisit >= 1136340854, 1, 0)) AS active, COUNT(*) AS users, MAX(userid) AS maxid FROM vb3_user;
    +--------+-------+-------+
    | active | users | maxid |
    +--------+-------+-------+
    |   2988 |  3216 |  5086 |
    +--------+-------+-------+
    1 row in set (0.01 sec)
    However, if I run what should be a comparable query:
    Code:
    select count(userid) from vb3_user where lastvisit >= 1136340854;
    I get a different result:
    Code:
    mysql> select count(userid) from vb3_user where lastactivity >= 1136340854;
    +---------------+
    | count(userid) |
    +---------------+
    |          3138 |
    +---------------+
    1 row in set (0.01 sec)
    What am I missing?
    OK... other than me missing my cut-n-paste for lastvisit/lastactivity... :blush:

    So, I guess the real question is why isn't lastactivity a valid (or even better) choice than lastvisit?

    Comment


    • #3
      BTW, the calculation/display for active-user birthdays uses lastactivity, not lastvisit. So, this is inconsistent within the same file (functions_databuild.php).

      Comment


      • #4
        I would have thought it should use lastactivity, not lastvisit.
        Baby, I was born this way

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...
        X