IIS ASP - forum

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > June 2006 > forum





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author forum
Jeff

2006-06-07, 7:22 pm

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


Aaron Bertrand [SQL Server MVP]

2006-06-07, 7:22 pm

> 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


Jeff

2006-06-08, 1:28 am

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.


"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:Oe0Oj$oiGHA.2220@TK2MSFTNGP05.phx.gbl...
>
> 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
>



Aaron Bertrand [SQL Server MVP]

2006-06-08, 1:28 am

> 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).


Jeff

2006-06-08, 1:28 am

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...


"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:%23Cj4uWpiGHA.3408@TK2MSFTNGP05.phx.gbl...
>
> Everything has the potential to create a large db. It's all in how you
> manage it.
>
>
> 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.
>
>
> 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).
>



Aaron Bertrand [SQL Server MVP]

2006-06-08, 1:28 am

> 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).


Aaron Bertrand [SQL Server MVP]

2006-06-08, 1:28 am

> 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).


Jeff

2006-06-14, 7:21 pm

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.


"Jeff" <gig_bam@adelphia.net> wrote in message
news:mISdnbd3i8ljsxrZnZ2dnUVZ_rydnZ2d@ad
elphia.com...
>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
>



Jeff

2006-06-17, 7:20 pm

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??


"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:ueUBwfqiGHA.3588@TK2MSFTNGP02.phx.gbl...
>
> 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).
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com