<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1044728" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1044728</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Hey all again,
I would just</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-forum-new-posts#comment-1244598</link>
    <description> &lt;p&gt;Hey all again,&lt;/p&gt;
&lt;p&gt;I would just like to update you on the method I have used, see what you think of it.&lt;/p&gt;
&lt;p&gt;Each thread has a last post time, so every time a new posts is made under that thread this time is updated.&lt;/p&gt;
&lt;p&gt;I also store when a user has read a thread and the time they read it, every time they read it, this time is also updated.&lt;/p&gt;
&lt;p&gt;So to work out if there are new posts I just do, if($newPostTime &amp;gt;= $readPostTime) then there are new, unread posts. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What do you think?&lt;/p&gt;
 </description>
     <pubDate>Sat, 29 Aug 2009 12:12:17 +0000</pubDate>
 <dc:creator>S33ker</dc:creator>
 <guid isPermaLink="false">comment 1244598 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Excellent information thank</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-forum-new-posts#comment-1244425</link>
    <description> &lt;p&gt;Excellent information thank you ever so much, lots to think about! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt; Will post once it has been finished or if I get stuck again &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;
&lt;p&gt;S33ker.&lt;/p&gt;
 </description>
     <pubDate>Sat, 22 Aug 2009 11:56:33 +0000</pubDate>
 <dc:creator>S33ker</dc:creator>
 <guid isPermaLink="false">comment 1244425 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>S33ker wrote:
But then you</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-forum-new-posts#comment-1244409</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;S33ker&lt;/em&gt; wrote:&lt;/div&gt;But then you would have to have a database that knew if everyone had read every thread in the database. That seems a bit insane to me.&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;To me too, but it seems the most reliable and accurate approach.&lt;/p&gt;
&lt;p&gt;The problem:&lt;br /&gt;
You need to somehow show when a user has read or not read a forum post/thread.&lt;br /&gt;
This is for all users.&lt;/p&gt;
&lt;p&gt;The Solution:&lt;br /&gt;
Store this information **somewhere** so the scripts can retrieve it and reflect &quot;read&quot; or &quot;unread&quot; per user per thread/post.&lt;/p&gt;
&lt;p&gt;So whatever you do, you need to store it. Cookies are fine, but forum software stopped using cookies as people clear this data too much these days. Many use Firefox and set it to do it when closing the browser. And there&#039;s a lot of software, some free, to &quot;clean up&quot; one&#039;s PC.&lt;/p&gt;
&lt;p&gt;So if you want it reliable and accurate, you are down to either storing it in a File, or a Database.&lt;br /&gt;
A file is a messy and complicated approach, and in this scenario I would guess a lot slower than a DB.&lt;/p&gt;
&lt;p&gt;Which leaves the DB as the best option. Just make sure you design the DB and table structure correctly.&lt;br /&gt;
There are regulars on the forum who have vast knowledge in this area, hopefully will advise for the table setup (and possibly confuse you in the process).&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;S33ker&lt;/em&gt; wrote:&lt;/div&gt;Another way I thought of doing it would be storing the last logout of a user then if a thread had been made after the user last logged out then it was obviously new.&lt;/div&gt;&lt;br /&gt;
I don&#039;t see this as an improvement on just storing what all users have read, as you&#039;d have to get last login and then search DB for all threads made after last login. And what happens to the post made while the user is logged in that they haven&#039;t read? You&#039;d still have to store that info somewhere.&lt;br /&gt;
Also, knowing if a user is logged out or not isn&#039;t always accurate, or even possible.&lt;br /&gt;
If they just close their browser, and depending on your forum setup, they haven&#039;t actually logged out. They will only be logged out by clicking logout or when (if) the session/cookies has an expire time.&lt;/p&gt;
&lt;p&gt;It&#039;s much more simple (for quick example) to just have a separate table that stores user ID and thread/post ID they have read.&lt;br /&gt;
Then show all as unread that is not stored in there and update it when they read a thread/post marked unread.&lt;br /&gt;
When they login you could keep the list of all unread at that point in a session or (better) a temp DB table so each page/thread view you are not going back into the DB and getting the entire list again, for all users for all post/thread views, as this would likely be a resource issue.&lt;/p&gt;
 </description>
     <pubDate>Fri, 21 Aug 2009 16:13:00 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1244409 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Thanks for the reply, thats</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-forum-new-posts#comment-1244408</link>
    <description> &lt;p&gt;Thanks for the reply, thats one way I thought of. But then you would have to have a database that knew if everyone had read every thread in the database. That seems a bit insane to me. Another way I thought of doing it would be storing the last logout of a user then if a thread had been made after the user last logged out then it was obviously new.&lt;/p&gt;
&lt;p&gt;Any more ideas?&lt;/p&gt;
&lt;p&gt;Thanks &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 21 Aug 2009 15:31:16 +0000</pubDate>
 <dc:creator>S33ker</dc:creator>
 <guid isPermaLink="false">comment 1244408 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>You can use a database or</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-forum-new-posts#comment-1244407</link>
    <description> &lt;p&gt;You can use a database or cookies for this.&lt;/p&gt;
&lt;p&gt;Cookies is probably less site resource usage, although people can clear their cookies, a lot using Firefox probably do.&lt;/p&gt;
&lt;p&gt;The database approach I guess everything would start as unread, then you&#039;d mark something as &quot;read&quot; when they&#039;ve seen it.&lt;/p&gt;
 </description>
     <pubDate>Fri, 21 Aug 2009 14:56:41 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1244407 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
