Current location: Hot Scripts Forums » Programming Languages » PHP » How to do new post/no new posts


How to do new post/no new posts

Reply
  #1 (permalink)  
Old 01-15-04, 11:24 PM
Archbob Archbob is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
How to do new post/no new posts

That New Posts/No New posts thing.

Is there a tutorial on how to do this? I don't get how phpbb,vB, or IPB figures out if a post has been made in each forum and thread since they last were on the board. How do they do it without a billion queries? I can't do it without a pop-up, is there a tutorial somewhere?
__________________
Master Chipmunk and programmer of cheap scripts.
Chipmunk Scripts -- Free GPL scripts
Reply With Quote
  #2 (permalink)  
Old 01-16-04, 12:23 AM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Its just an IF statement between the last post date and the last visit date.
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #3 (permalink)  
Old 01-16-04, 12:30 AM
Archbob Archbob is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Well, yeah, the concept is easy but its mudier than that I'm afraid. How do you keep track of the last visit date? Do you keep an sql table of which visitors have visited which threads, that would generated a huge amount of data, and I see nothing in IPB doing that. And how do you know when to update last visited? If you updated it on every page view a person has, then there would be almost no new or "visited".
__________________
Master Chipmunk and programmer of cheap scripts.
Chipmunk Scripts -- Free GPL scripts
Reply With Quote
  #4 (permalink)  
Old 01-16-04, 12:42 AM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Its just an IF statement. There really is no way to keep track of what threads have been visited and what ones haven't.

Usly a forum determines if the post is new by the last visit date, so to make it a not new post, the user has to close the window and come back so their cookie has been updated.

If there is an easier way, i would like to know it.

But storing the information in an SQL table is a very bad way of doing it.
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #5 (permalink)  
Old 01-16-04, 02:39 PM
Archbob Archbob is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MadDog
Usly a forum determines if the post is new by the last visit date, so to make it a not new post, the user has to close the window and come back so their cookie has been updated.
Waitm I still don't get how this is done. You have to keep track of every thread the visitor has visited, how do you do that?
__________________
Master Chipmunk and programmer of cheap scripts.
Chipmunk Scripts -- Free GPL scripts
Reply With Quote
  #6 (permalink)  
Old 01-16-04, 03:33 PM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
You have to keep track of every thread the visitor has visited, how do you do that?
You dont have to keep track of every thread they visited - only the last time they visited the forum. Right after they login (or you retrieve the info from their cookie/session), you note the 'last' time they logged in. Then, when you query the database for threads, the ones that are 'new' are the ones that appeared between the visitors last time and now.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ifelse insert queries mdhall PHP 1 11-26-03 04:14 AM
Enough Posts? Spartaman General HotScripts Site Discussion 4 11-18-03 10:34 PM
[RESOLVED]View New Posts Chris Boulton HotScripts Site Bug Reports 1 06-09-03 02:18 AM
Oldest posts first? DuEy Hot Scripts Forum Questions, Suggestions and Feedback 5 06-08-03 11:02 PM


All times are GMT -5. The time now is 08:31 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.