Help - Search - Members - Calendar
Full Version: Cms With User Comments
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
Zen
I'm wondering how one would get about programming a commenting system into a normal CMS. One's that normal news sites would contain. I've already setup a basic CMS using MySQL. The structure is as such:

Database:
-Table [news]:
--Entry: [id,title,content,date]

Now I can only think of making a new table for each post and adding in entries that way. This would require making a new database solely for Comments. Well not exactly but does anyone else have a different way?
swordz
You could make 1 new table, and then have a news id field to store which news item each post is related to.

swordz
Zen
So in order to process them to a page...I'd have to sort by the ids, clip those not needed, then sort by date.
Eh, cool.

Any other methods?
swordz
No, you can do it all in the SQL query.

SELECT * FROM `table` WHERE `id`='newsid' ORDER BY `date`

swordz
Trice
you'd have a table named something like comments.
with the fields um..

commentid
newsid
userid
comment
commentdate
commentip

maybe?
obviously those names are just used to show you what they are. you'd change them to something maybe smaller?
Jetteh22
Yeah, do what trice said.

Add a table named "comments" or somethin with the fields.

I'm actually working on my own custom CMS for a site I'm making. Simple. yet effective enough to work properly, all within the main site itself (that way It would be easier on me to add pages, and hopefully will make it worth more if I ever decide to sell it, for thsoe who are web design illterate) and that is the way I'm going to try to do it.
uncled1023
yea, for my old site, i wrote a comment script. Like they said, just make a new table, with all the info in it, and just retrieve it for each member.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.