seventheyejosh Posted January 6, 2009 Share Posted January 6, 2009 I'm not sure if this is the right section, as i've never done anything this confusing before. What is the lightest way to hit a server to see if someone has viewed a forum post? The 3 things im thinking: 1. Pull everything from a forum views table when the user logs in and store it in a session variable, then check against that. however, im not sure the size limit on one. 2. use said table, but just run thru that on every page load. this would be easiest, but would fill up very quickly. 3. i was thinking maybe using a cookie, and would really like to go with this route, but im not sure where to start with this. Any suggestions for help or tutorials on cookies? Thanks in advance to all! Quote Link to comment Share on other sites More sharing options...
bluesoul Posted January 6, 2009 Share Posted January 6, 2009 There are a few ways of going about marking forums as read, vBulletin's docs may give you an idea or two. 1) Inactivity/Cookie Based - once a user has been inactive for a certain amount of time (the value of the cookie timeout option) all threads and forums are considered read. Individual threads are marked as read within a session via cookies. This option is how all versions of vBulletin before 3.5 functioned. 2) Database (no automatic forum marking) - this option uses the database to store thread and forum read times. This allows accurate read markers to be kept indefinitely. However, in order for a forum to be marked read when all threads are read, the user must view the list of threads for that forum. This option is more space and processor intensive than inactivity-based marking. 3) Database (automatic forum marking) - this option is the same as a previous option, but forums are automatically marked as read when the last new thread is read. This is the most usable option for end users, but most processor intensive. Quote Link to comment Share on other sites More sharing options...
seventheyejosh Posted January 6, 2009 Author Share Posted January 6, 2009 Well i was thinking more a cookie on a per user basis. however im new to the industry and am not quite sure how to go about doing that. Sorry if thats what you meant, im just new to cookies! Quote Link to comment Share on other sites More sharing options...
bluesoul Posted January 6, 2009 Share Posted January 6, 2009 Right, you can keep an array in a cookie of thread id's, then if the thread listed is in the array in the cookie, it's noted as read. Quote Link to comment Share on other sites More sharing options...
seventheyejosh Posted January 6, 2009 Author Share Posted January 6, 2009 so can you update cookies? like when a user views another post, it updates the cookie to have that id as well? will it overwrite the old cookie of the same name? like if $value is all of the posts the user has viewed, can you do $value.=$id setcookie $value etc ? Quote Link to comment Share on other sites More sharing options...
seventheyejosh Posted January 6, 2009 Author Share Posted January 6, 2009 maybe something like so? $which=$_COOKIE['posts_viewed']; $id=id; // post id $which.=$id setcookie("posts_viewed", "$which", time()+(60*60*24*365)); Quote Link to comment Share on other sites More sharing options...
seventheyejosh Posted January 6, 2009 Author Share Posted January 6, 2009 sorry *bump* 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.