Jump to content

Making Forums


chriscloyd

Recommended Posts

I have coded my forums and they work well, but now I need some help.

I am trying to do the sorta thing that most forums do.  When you leave and come back to the forums

it shows you which forums or posts have been updated or added by a new color image.

Can someone lead me in the way to do it and I can code it out from there.  I just cant logically get how it works.

Link to comment
Share on other sites

views (thread_id, user_id, date_last_viewed)

 

To select all unread threads

 

SELECT field, field

FROM views

RIGHT JOIN threads ON views.thread_id = threads.id

WHERE threads.date_last_comment > views.date_last_viewed AND (views.user_id IS NULL OR views.user_id = $user_id)

 

When a user views a thread

 

INSERT INTO views (thread_id, user_id, date_last_viewed) VALUES ($thread_id, $user_id, now())

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.