Annotations for articles in a Web Site? Pls advise

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dedachi
Forum Newbie
Posts: 1
Joined: Sat Jan 31, 2009 7:45 pm

Annotations for articles in a Web Site? Pls advise

Post by dedachi »

Hello,

I have a website which has around 100 articles listed. I want to implement annotations within them such that anyone could edit text present below each article. Once the text has been moderated by a moderator, other users visiting the website can then view the comments posted for each of those articles.

Eg:

Article 1:
Comment 1: // Moderated comments by any user about article 1. This can also be edited by anyone else.

Artcile 2:
Comment 2:

.
.
.
.
.

Article n:
Comment n:

Could anyone please suggest something which can be implemented?

Thank you!!
LonelyProgrammer
Forum Contributor
Posts: 108
Joined: Sun Oct 12, 2003 7:10 am

Re: Annotations for articles in a Web Site? Pls advise

Post by LonelyProgrammer »

Create a table called comments, with the article's primary key as the FK.

Create another table called comment_status, with the comment's primary key as the FK. You may want a couple of fields, like the userid of the moderator, the status of the comment, and an optional field called 'reason' in case it is not approved, and a time-stamp for status change.

If you want to, you may want comment_status_history to keep track of status changes, and comments_change_history to store revisions.
Post Reply