Free Software PHP Comment System

Looking for volunteers to join your project? Need help with a script but can't afford to pay? Want to offer your services as a volunteer to build up your portfolio? This is the place for you...

Moderator: General Moderators

Free Software PHP Comment System

Postby TildeHash » Fri Jul 16, 2010 7:39 am

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: )
User avatar
TildeHash
Forum Commoner
 
Posts: 43
Joined: Fri Jul 16, 2010 7:17 am
Location: Apple Valley, California

Re: Free Software PHP Comment System

Postby greyhoundcode » Sat Jul 17, 2010 12:39 pm

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?
User avatar
greyhoundcode
Forum Regular
 
Posts: 611
Joined: Mon Feb 11, 2008 5:22 am

Re: Free Software PHP Comment System

Postby TildeHash » Wed Jul 28, 2010 10:10 pm

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.
User avatar
TildeHash
Forum Commoner
 
Posts: 43
Joined: Fri Jul 16, 2010 7:17 am
Location: Apple Valley, California

Re: Free Software PHP Comment System

Postby boredboy5 » Wed Jul 28, 2010 10:35 pm

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.
boredboy5
Forum Newbie
 
Posts: 4
Joined: Wed Jul 28, 2010 9:32 pm

Re: Free Software PHP Comment System

Postby TildeHash » Fri Jul 30, 2010 5:18 am

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?
User avatar
TildeHash
Forum Commoner
 
Posts: 43
Joined: Fri Jul 16, 2010 7:17 am
Location: Apple Valley, California

Re: Free Software PHP Comment System

Postby greyhoundcode » Fri Jul 30, 2010 11:57 am

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.
User avatar
greyhoundcode
Forum Regular
 
Posts: 611
Joined: Mon Feb 11, 2008 5:22 am

Re: Free Software PHP Comment System

Postby pickle » Fri Jul 30, 2010 5:12 pm

Moved.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
pickle
Briney Mod
 
Posts: 6432
Joined: Mon Jan 19, 2004 7:11 pm
Location: 53.01N x 112.48W

Re: Free Software PHP Comment System

Postby prefer32bits » Sun Jan 02, 2011 1:37 am

This is similar to the forum system I've made :
http://bringtheweb.dyndns.org/~forum/
User avatar
prefer32bits
Forum Newbie
 
Posts: 10
Joined: Sun Jan 02, 2011 12:55 am
Location: San Jose, CA

Re: Free Software PHP Comment System

Postby wastedgod » Tue Feb 01, 2011 12:44 am

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/articles/hierarchical-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.
wastedgod
Forum Newbie
 
Posts: 3
Joined: Tue Feb 01, 2011 12:33 am

Re: Free Software PHP Comment System

Postby cpetercarter » Wed Feb 09, 2011 2:06 am

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
cpetercarter
Forum Contributor
 
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am


Return to Volunteer Work

Who is online

Users browsing this forum: No registered users and 0 guests