Jump to content

Recommended Posts

I'm working on my own forum system for my clan. I don't want any thing fancy for feature filled. Their soldier name, clan tag, email, xfire, aim, yim, avatar, clan site, and signature. Maybe a PM system too IDK.

 

Well I've go the BBC code functions done and all that fun stuff but I'm having a problem.

 

Topic Activity... Ok so lets say you read a board. Once you've been in that board the Icon next to the board changes.

 

For an example:

on.gif Indicates there has been activity in the board since you were last in.

off.gif Indicates there has not been activity in the board since you were last in.

 

How would I do this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/63085-solved-forum-board-problem/
Share on other sites

Look into PHP Date and Time, namely on how timestamps work.

 

I was thinking about using it. But what I can't figure out is how. I mean would I have to create a new table for the timestamps?

 

This is what I know so far:

When a member makes a post it's added to the "comments" table in the database, then the board timestamp is updated. Not too hard. But then how would I compare it to the members? Would they need a table with their last active time stamp to match the boards?

 

This is what I can't figure out.

At first glance I would make a table for when the user last views a thread. It would contain their user_id, thread_id, and a timestamp. When the thread list loaded, it would check the timestamp of the most recent post against the timestamp of when they viewed the thread. It would compare the timestamps, most likely the seconds since the epoch since the integer math would work best IMO, and I think you get the rest.

 

That's what I would do.

I would just make one table to store all of them. BUT, depending on how many users you have and how many threads you have, it could get really big really fast. If all your users (say 100) viewed all the threads (say 100) then you would have 10000 rows. There might be a better way, but I was just the first person to answer.

 

You can probably make it faster by doing the date comparison (provided that you store the time as seconds or can retrieve it as such) in the query and narrowing which users it's looking for in the query also.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.