Page 1 of 1

Free Software PHP Comment System

Posted: Fri Jul 16, 2010 7:39 am
by TildeHash
Hello,

I am currently developing a Free Software comment system (AGPL) in PHP. I'd love to have some help if anyone is willing or interested. It doesn't currently have replies, which is a feature I'd love to have working. And I am concerned about my methods, particularly because it relies on writing the comments to .txt files, which requires a directory be readable, writable, and executable by everyone.

You can view my comment system here: http://www.tildehash.com/comments.html
And the source code here: http://www.tildehash.com/comments.php?source

(I posted this on another PHP forum, but they don't like projects... they deleted my post :cry: )

Re: Free Software PHP Comment System

Posted: Sat Jul 17, 2010 12:39 pm
by greyhoundcode
Might be a good one to stick in the Volunteer Work section.

Is there a reason you are using .txt files rather than a database?

Re: Free Software PHP Comment System

Posted: Wed Jul 28, 2010 10:10 pm
by TildeHash
greyhoundcode wrote:Might be a good one to stick in the Volunteer Work section.
Quite true.
greyhoundcode wrote:Is there a reason you are using .txt files rather than a database?
Yes. TXT files are separate from each other, if I add or delete one I don't have to worry about messing up the structure of a database.

Re: Free Software PHP Comment System

Posted: Wed Jul 28, 2010 10:35 pm
by boredboy5
Why would you need to worry about ruining the structure of the database? You could just create separate tables; like, basically each table is just a text file.

Re: Free Software PHP Comment System

Posted: Fri Jul 30, 2010 5:18 am
by TildeHash
boredboy5 wrote:Why would you need to worry about ruining the structure of the database? You could just create separate tables; like, basically each table is just a text file.
Oh. Well, the last thing I remember about using a database is if you mess up and leave a newline, it won't phrase correctly. Would a database be easier / faster for PHP execution than individual files?

Re: Free Software PHP Comment System

Posted: Fri Jul 30, 2010 11:57 am
by greyhoundcode
Would it be easier/faster? Depends on a number of variables really.

My personal rule of thumb is to do what I feel most comfortable with. For me, a database "feels" like the best fit here. Plus, if you are tying responses to user accounts, then it affords some additional security benefits.

Also, as you say yourself:
TildeHash wrote:I am concerned about my methods, particularly because it relies on writing the comments to .txt files, which requires a directory be readable, writable, and executable by everyone.
Depending on how far you intend taking this project, might you consider implementing different drivers? That way you could have (perhaps) a flat/file (XML based?) driver as well as a database driver (which might itself utilise a SQLite driver, MySQL driver etc).

Just some thoughts.

But, basically, I for one would utilise a database.

Re: Free Software PHP Comment System

Posted: Fri Jul 30, 2010 5:12 pm
by pickle
Moved.

Re: Free Software PHP Comment System

Posted: Sun Jan 02, 2011 12:37 am
by prefer32bits
This is similar to the forum system I've made :
http://bringtheweb.dyndns.org/~forum/

Re: Free Software PHP Comment System

Posted: Mon Jan 31, 2011 11:44 pm
by wastedgod
Just a couple quick suggestions. If you switch to a relational db such as mysql I would suggest using a nested set model for the comments and replies. Mysql's site has a good artical at http://dev.mysql.com/tech-resources/art ... -data.html on how to implement one. This will allow you to place your comments and replies in a tree structure. Also can't recommend a template engine like Smarty enough. Takes only a few mins to get a "good enough" understanding and will save you hours when doing UI design and debugging.

Re: Free Software PHP Comment System

Posted: Wed Feb 09, 2011 1:06 am
by cpetercarter
Also can't recommend a template engine like Smarty enough. Takes only a few mins to get a "good enough" understanding and will save you hours when doing UI design and debugging.
+1