ILYAS415 Posted December 22, 2007 Share Posted December 22, 2007 Hi, im totally confused on a forum script that im making. My boss has asked me to make it so, every time there is a new post the post is highlited. The easy thing is that i can put a row called ('read') im my table called ('topics') and set it to '1' everytime someone posts in a topic. The hard part is for when each specific user views it. E.g. when a user views it , 'read' will be set back to 0 and the post will no longer be new. This means that it will update it for each user. What im trying to do is so after one user has seen that there is a new post, they can view the post and 'read' will be set to '0' for him. From their other users will still be able to see there is a new post until they view the topics. P.S : I am also using MYSQL for my tables in my DB. Thanks for Any major help. ----------------------------------------- Azeem Quote Link to comment https://forums.phpfreaks.com/topic/82855-php-forums-help-urgent/ Share on other sites More sharing options...
papaface Posted December 22, 2007 Share Posted December 22, 2007 Just retrieve the posts and when it comes to the last result highlight it....?? Edit: Re-read your problem. You'd need ajax i think for this. Quote Link to comment https://forums.phpfreaks.com/topic/82855-php-forums-help-urgent/#findComment-421393 Share on other sites More sharing options...
Daukan Posted December 23, 2007 Share Posted December 23, 2007 I never really messed with message board or forum coding but this may work. You can use cookies to save what posts where read. To keep the cookie small you can assume all posts from last visit were read if last visit was x amount of time ago. hightlight new ones then save only the fresh posts that were read to the cookie to flagged them as read. Keep this cookie separate from the login/session cookie. give a time to live of 30 to 60 days and update the expiry date on every cookie update. Quote Link to comment https://forums.phpfreaks.com/topic/82855-php-forums-help-urgent/#findComment-421398 Share on other sites More sharing options...
dbillings Posted December 23, 2007 Share Posted December 23, 2007 You could download PHPBB and read their source code and see how they do it Quote Link to comment https://forums.phpfreaks.com/topic/82855-php-forums-help-urgent/#findComment-421509 Share on other sites More sharing options...
redarrow Posted December 23, 2007 Share Posted December 23, 2007 just add another database colum shown_posts. id user_id topic_id read when a user is looking at topics make sure you set a session of that users id and it not in the new show_post table, if the user goes and reads a topic update the new shown_post table with there user_id, topic_id and set read as 0 meaning read...... doing that will show all highlighted topic read or not read......... Quote Link to comment https://forums.phpfreaks.com/topic/82855-php-forums-help-urgent/#findComment-421518 Share on other sites More sharing options...
ILYAS415 Posted December 23, 2007 Author Share Posted December 23, 2007 Thanks Red arrow that sounds like a solution thanks. The rest were too complicated or would've been too hard/long. Quote Link to comment https://forums.phpfreaks.com/topic/82855-php-forums-help-urgent/#findComment-421920 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.