AdySmith Posted November 22, 2007 Share Posted November 22, 2007 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 Quote Link to comment Share on other sites More sharing options...
Kurrel Posted November 22, 2007 Share Posted November 22, 2007 Before looking into alternatives, what exactly is going wrong with your cookies? Is nothing happening? Is it working sometimes or throwing an error? Quote Link to comment Share on other sites More sharing options...
AdySmith Posted November 22, 2007 Author Share Posted November 22, 2007 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! Quote Link to comment Share on other sites More sharing options...
revraz Posted November 22, 2007 Share Posted November 22, 2007 Going to be tough to use cookies for this, since you can only have 20 per domain. Quote Link to comment Share on other sites More sharing options...
AdySmith Posted November 22, 2007 Author Share Posted November 22, 2007 Going to be tough to use cookies for this, since you can only have 20 per domain. Oh right. That isn't very helpful then lol. Do you have any alternative methods? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 22, 2007 Share Posted November 22, 2007 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. Quote Link to comment Share on other sites More sharing options...
AdySmith Posted November 22, 2007 Author Share Posted November 22, 2007 Thanks! I didn't use your method, but your explanation helped me figure out a better way of accomplishing this. Quote Link to comment 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.