Jump to content

Help with forum markers


AdySmith

Recommended Posts

Hello!

I'm currently developing my own forum software and I am having some trouble with making the on / off forum markers turn on and off depending on if you've read the post or not. I used cookies but I think I've done it wrong. Does anyone have any alternative ways to do this, or could guide me through using cookies to do this?

Thanks, Ady

Link to comment
Share on other sites

Before looking into alternatives, what exactly is going wrong with your cookies?

 

Is nothing happening?

Is it working sometimes or throwing an error?

 

Well, it works sometimes. I made it so all the forum markers are on by default, but when you view a thread it creates a cookie that tells the site to change the marker for that thread to be off. I can't think of how I can remove the cookies if someone makes a new post though, so I'm wondering if using cookies is a good way to do this. Also there have been no PHP errors with it.

Thanks for the help!

Link to comment
Share on other sites

the easiest way to make read/not read forum threads is a single simple mysql table

 

ThreadID PostCount UserID

 

Basically each time the page is viewed by a "userid" it grabs all data present in the above table.  Then while you are splashing out the post you say if(!isset($row['ThreadID]')) {//New Post}

elseif($row['ThreadID']['PostCount'] != $realpost count){//Old Post with New Messages}

else{//Its been read and all post viewed}

 

Now this will become an ungodly large table eventually, but its not a big deal cause its storing about 10 bytes max per row.  You can probably get sql to do 90% of the work and simply return to you a integer between 0-2, however that would be an sql issue not sql.

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.