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
https://forums.phpfreaks.com/topic/78384-help-with-forum-markers/
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!

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.

Archived

This topic is now archived and is closed to further replies.

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