Salis Posted August 2, 2007 Share Posted August 2, 2007 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: Indicates there has been activity in the board since you were last in. Indicates there has not been activity in the board since you were last in. How would I do this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/63085-solved-forum-board-problem/ Share on other sites More sharing options...
deadimp Posted August 2, 2007 Share Posted August 2, 2007 Look into PHP Date and Time, namely on how timestamps work. Quote Link to comment https://forums.phpfreaks.com/topic/63085-solved-forum-board-problem/#findComment-314271 Share on other sites More sharing options...
Salis Posted August 2, 2007 Author Share Posted August 2, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/63085-solved-forum-board-problem/#findComment-314278 Share on other sites More sharing options...
soycharliente Posted August 2, 2007 Share Posted August 2, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/63085-solved-forum-board-problem/#findComment-314283 Share on other sites More sharing options...
Salis Posted August 2, 2007 Author Share Posted August 2, 2007 Jeez, I think I need to hit myself! That does make sense. I kinda hate it when it's something so simple like that! Thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/63085-solved-forum-board-problem/#findComment-314287 Share on other sites More sharing options...
soycharliente Posted August 2, 2007 Share Posted August 2, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/63085-solved-forum-board-problem/#findComment-314296 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.