Jump to content

PHP forums help - URGENT


ILYAS415

Recommended Posts

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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......... 

 

Link to comment
Share on other sites

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.