forum

J

Jeff

I am in the process of writing my own forum. It is gone fairly well so far.
I been searching different forum scripts, both asp and php, and I can't find
this answer.

How is it scripted to only show a forum post that hasn't been read by the
current user?
I feel it has something to do with the last visit, and or the date of the
post.

But I am not sure how this is done. On my phpbb forum, I can go in and read
something, go back to index, refresh, and that post is now marked as read.
how is this done?

Any ideas or suggestions?

i have looked at webwiz forums, snitz forums, as well as phpbb.. and
couldn't find it.

thanks
jeff
 
A

Aaron Bertrand [SQL Server MVP]

How is it scripted to only show a forum post that hasn't been read by the
current user?

When you show a post to a user, you mark in a table somewhere the
combination of userid and postid (sorry, I don't know your schema, but
surely there is a piece of data that uniquely identifies the user, and one
that does the same for the post).

Now, I don't know what database you're using either, but in SQL Server you
could use a LEFT JOIN against this table and when the user exists on the
right, s/he's already read the article, otherwise s/he has not.

A
 
J

Jeff

but wouldn't that create a large DB eventuly??
I mean.. if 1000 members read 1000 posts, their name would have to appear on
every post made.
that would be a million lines in that table.... if i understand you
correctly.
 
A

Aaron Bertrand [SQL Server MVP]

but wouldn't that create a large DB eventuly??

Everything has the potential to create a large db. It's all in how you
manage it.
I mean.. if 1000 members read 1000 posts, their name would have to appear
on every post made.

Why would you use a name? If "Joe Buttafiko" reads post 1, then changes his
username to "Heidi Fleiss" and reads post 2, how are you going to know
they're the same user? Don't you have a surrogate (like UserID) that is a
much skinnier identifier for this kind of thing? Anyway, is that really
going to be more data than the post themselves? I highly doubt it.
that would be a million lines in that table...

Oh no! A million rows? Unless you're running Access or hosting SQL Express
on a laptop with a dying battery, this is not going to be a drop in the
bucket for an enterprise database system. I manage clustered servers on
SANs with TB of data, and I can't imagine that requiring more disk space for
high volumes of traffic is the worst problem you could have (unless you
don't serve ads, I guess).
 
J

Jeff

yes... i do have unique id's for the users, instead of the names. but what i
am getting at, is the forums i have used in the past, don't use that
approach. not sure how they do it, but it isn't don't that way. i have
looked in the tables and i don't see anything showing that a userid has
visited a post.

thanks for the input though... :)
 
A

Aaron Bertrand [SQL Server MVP]

yes... i do have unique id's for the users, instead of the names. but what
i am getting at, is the forums i have used in the past, don't use that
approach. not sure how they do it, but it isn't don't that way. i have
looked in the tables and i don't see anything showing that a userid has
visited a post.

Well, maybe they store it in a cookie on the client's machine. Personally,
I'd rather have the information (but maybe they were very cheap on disk
space).
 
A

Aaron Bertrand [SQL Server MVP]

yes... i do have unique id's for the users, instead of the names. but what
i am getting at, is the forums i have used in the past, don't use that
approach. not sure how they do it, but it isn't don't that way. i have
looked in the tables and i don't see anything showing that a userid has
visited a post.

Well, maybe they store it in a cookie on the client's machine. Personally,
I'd rather have the information (but maybe they were very cheap on disk
space).
 
J

Jeff

well, i have been searching for the past week, and i can't find the
solution. i know it has to be something simple i am missing.
 
J

Jeff

the number of rows isn't the issue, what i meant is, everytime someone comes
into the forum, it would have to go through each record to see if that user
has viewed each post or reply. i think a time issue would be created. my
server has a great speed, but we are still talking about checking a large
amount of data on each visit. then factor in if 20 people are on at the same
time, and checking through a table that contains 1,000,000 records.
am i wrong for thinking this way??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,260
Messages
2,571,038
Members
48,768
Latest member
first4landlord

Latest Threads

Top