PDA

View Full Version : Tutorial for a comment system



ldb
12-15-2009, 10:16 PM
I used Haloscan for about 6 years until they recently converted to Echo. I had a few issues with Echo and after the inability to resolve them, I cancelled everything and went on the lookout for another comment system. I haven't found one as customizable as Haloscan.

With that said, can someone here please submit a step by step way of creating a simple, very basic comment system to put on a site. My domain supports PHP and mySQL and all just about everything necessary to do the job.

I should think it isn't incredible hard because all I need is, more or less, the script that for example, Bellabook has. It's just NAME, EMAIL, COMMENT, and that's it. Nothing crazy, no text editor or anything like that.

Unless there is a direct answer to this, please don't link me to other threads that might relate in some way to this, and please don't suggest I use a free site or paid site to get comments.

I'd really appreciate a straight, direct reply with the number of files I'm going to need, the codes that're going to go in each file...just, really whatever is necessary to do this. Thank you.

djr33
12-15-2009, 10:46 PM
I posted a basic comment script a long time ago. Here is a link to a post that has a version of the code.
http://www.dynamicdrive.com/forums/showpost.php?p=37599&postcount=15

It's not a tutorial but it should give you a starting point.

It's not very difficult (compared to other php projects):
1. Store comments somewhere and display them on a page.
2. Have a way to submit comments (basic form) and store them into the text files or database.

This website has some clear tutorials on use of mysql and php if you want to try it with a database:
http://www.php-mysql-tutorial.com/Default.aspx
(Search a bit; the navigation on the site is not good, but the information is).

ldb
12-15-2009, 11:18 PM
Thank you!

First off, I'm not entirely sure what "database" means. Try it with a database, meaning try it with mySQL? Is that what you mean?

Also, I gave a try to that simple tutorial you had. You can take a look here.

http://phantom-wolf.net/coding/index.php

For some reason, it posts the name and email, but not the message. You can try it. And I didn't alter the code at all.

Why is that?

Also, exactly how customizable is this simple script? Meaning, for example, can I incorporate something this easy into my website? Say, add a link to a pop-up window (this is the way I originally had it with Haloscan for years) that show up that exact page (http://phantom-wolf.net/coding/index.php), only in the window?

And is there a way so that for every new blog I post, I can have a new set of comments? How do I go about this?

Thanks again for the links.

Oh, I forgot to add. I found this link on that site you provided: http://www.php-mysql-tutorial.com/wikis/php-tutorial/creating-a-guestbook-using-php-and-mysql.aspx
Through reading and trying to understand something like that...I mean, can I somehow tweak that to work into a comment system? Or is that entirely different?

djr33
12-16-2009, 12:44 AM
MySQL is a database language. A database is a system for storing data that allows organization, searching, modification, etc. MySQL is one of many languages/"brands" of database.

To be honest, that code is quite old, but it did work at the time. I'm not exactly sure why it would not be working at the moment. It is certainly a good example or starting point, though I'm not sure it's a great working solution for everything you need.

As far as I can tell looking at the code, there is no reason it would not work with the comment but show the other data. Did you change any of the form? The name "comment" must be constant through all the script. Aside from that, I don't know.

As for customization, it's not customizable at all. It is quite simple. You could rewrite it if you'd like, but it doesn't have any "options" by default.

You can of course place the various sections into whatever you'd like. For example, a popup could be used to display the comments-- just place the viewing code in your source for the popup.

You asked for a simple script. This is one-- very simple. If you want more options, you'll need a much more complex script-- not just one for comments, but also one that has the options to administrate settings. For this you can find many available for free (and more for money) on google.

ldb
12-16-2009, 01:04 AM
As I said, no, I didn't alter the code. I did nothing but upload it as is. And I don't want a free script or a paid one (unless, as I also said, it's anywhere nearly as customizable as Haloscan).

Can we leave this thread open? Because what I hoped for was not someone to send me to another thread, but to write a code and break down for me what the lines mean so I better understand how to handle them.

djr33
12-16-2009, 05:25 AM
When you're looking for a script (regardless of language), generally it's best to post here:
http://dynamicdrive.com/forums/forumdisplay.php?f=23

For the moment, though, no reason not to leave it here.

Sure, you can see if someone else replies.

Writing a comment system is time consuming, especially for something with lots of options. If you really need something custom, consider paying someone to write it (the price will vary depending on what you want, exactly). There is an area here for paid request if you decide to go with that.

You can probably find something as good as (or maybe better than) Haloscan (though I have not heard of it) because there are lots of these things out there. They can be hard to find, but they are out there-- someone has needed this before.