1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How Can I Get Stats

Discussion in 'Bookmarking Discussions and More' started by robin007, Jan 4, 2016.

  1. robin007

    robin007 Well-Known Member

    online users
    Newest Member
    Total Members count
    Total Stories count
    Popular Stories count
    Latest Stories count
    Total Comment

    how can i get this stats.
     
  2. valMETNG

    valMETNG Administrator Staff Member Admin

    If you go to the home admin panel, you'll see some of those stats. The other queries are:

    Popular stories count:
    Code:
    SELECT COUNT(post_id) FROM hotaru_posts WHERE `post_status` = 'top';
    Latest Stories count depends on how you define "latest." But if you defined it as the last 9 days, the query would look like this:
    Code:
    SELECT COUNT(post_id) FROM hotaru_posts WHERE `post_date` BETWEEN DATE_SUB(CURDATE(), INTERVAL 9 DAY) AND CURDATE();
    Total Comment:
    Code:
    SELECT COUNT(comment_id) FROM hotaru_comments;
    Edit (forgot one):
    The number of online users would require writing some Javascript that kept checking at certain intervals if the user still had a page up. However, you could get a rough calculation by defining online as someone who was logged in within the last 30 minutes like this:
    Code:
    SELECT COUNT(user_id) FROM hotaru_users WHERE `user_lastlogin` BETWEEN DATE_SUB(NOW() , INTERVAL 30 MINUTE) AND NOW()
     
    Last edited: Jan 4, 2016
    sereban, narc and robin007 like this.

Share This Page