/    Sign up×
Community /Pin to ProfileBookmark

Forum Statistics

Hello,

I am building a forum and I am a little confused as to how to set up my statistics code. In order to give a count of how many users are currently online do I need to create a separate table that is updated when a user logs on or just add another column to my users table? What would be the best/most efficient way in terms of the least amount of server processing required?

Any ideas will be very helpful.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NatdripJul 03.2012 — basically you'll need to create a table and use a cron to update it

Then you'll need to query the table for the required information
Copy linkTweet thisAlerts:
@mccoauthorJul 03.2012 — Thanks! that is a good idea. Never thought about cron jobs. What items does a typical forum stats table have in it? I have tables for users, forums, threads, and posts already made but for some reason I can think what would go in the stats table. I would like to include the last time a user logged in and I want to know how many users are currently online. Also, it would be nice to know who are my top posters, most popular topics, and the views of each topic. Any help would be great.
×

Success!

Help @mcco spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...