Jump to content
xisto Community
Digitalidad

How Can I Have Comments On My Site Like In The Site Shown?

Recommended Posts

Hi, guys! I'd like to include in my website a space for readers to give their opinion to each of the comics published. I've seen many sites using this kind of "blog" lately. Here's an example: Example

At the bottom of the news, you'll see a section called "Comenta esta nota" (comment this news) where you can post your opinion.

How does that work? Do I need to hire the service from another company or can I implement it in my site which is hosted with the basic plan at Xisto? Is it difficult to do it? Can I get the code from a php programmers website or somewhere else?

Thanks in advance for your kind help!

Share this post


Link to post
Share on other sites

How does that work?

Explaining how it works goes a bit deeper than perhaps what you would expect in the answer. First you would need a content management system (CMS). A CMS of this kind would require a database that isn't flat-file based. The database is used for storing the articles and comments and user account information, etc. The CMS allows you to create, edit or delete articles. Through modules or built-in features, the CMS displays the comment management system at the end of each article, of which users who have logged into your website can post comments on the relative articles, unless perhaps you allow for guest or anonymous posts.

Do I need to hire the service from another company or can I implement it in my site which is hosted with the basic plan at Xisto?

You can do both, but obviously Xisto would be the cheaper, equal-quality way of doing it.

Is it difficult to do it?

Only if you're new to the languages that are capable of producing such a thing, assuming you mean to code it youself. Otherwise it is merely time consuming.

Can I get the code from a php programmers website or somewhere else?

Yes, you can. There are many free CMS scripts out there that support a comment system, which can be installed on your Xisto account, provided you meet the requirements, which you should with the Logic Plan or greater. Of course, the other alternative is to code it yourself, but i'm sure that is out of the question. :D

Share this post


Link to post
Share on other sites

Well I made one for my site in php, here's how it works:you have a simple form in the bottom of your article, then you make it to post to a processing file (don't forget to secure your files so that no spammer/hacker/S_M/random idiot has access to them, otherwise your site might be DOOMED :D).In the processing file, you command it to write the content of the form sent in a xml file, then...... go back to your original article page where the form was and go down a little bit and and include the file your processing script has written with the include () function. Vola! you've got yourself a comment page, don't forget to command the php file to redirect to the original article after it's done with the script.I can't give you the code because it's on my laptops HDD and it's being repaired...Hope I helped, in case I said something wrong, tf or some other expert could correct me.EDIT: If you want a registration system, you'll have to use some mysql or other db. I recommend xml databases for SMALL PROJECTS or if you're just testing out your skills and it's your first website. XML-databases are easy to make and you don't have to hassle around alot after you've made them.

Edited by baniboy (see edit history)

Share this post


Link to post
Share on other sites

If you want a little php code for that, I can give it to you (simple, though):

//comments.php page//<p><form name='createcomment' method='post' action='chkcreatecomment.php'><center>Input your name</center><br><input type='text' name='name'><br><br>Comment:<br><center><textarea cols=4 rows=20 name='comment'></textarea></center></form></p>//chkcreatecomment.php//<?*INCLUDE FILE THAT HAS CONNECTION TO MYSQL SERVER*function will_strip_tags($str) {	do {		$count = 0;		$str = preg_replace('/(<)([^>]*?<)/' , '<$2' , $str , -1 , $count);	} while ($count > 0);	$str = strip_tags($str);	$str = str_replace('>' , '>' , $str);	return $str;}if (!$_POST['name'] OR !$_POST['comment']){print"<script>location.href='comments.php';</script>";die;}$_POST['name'] = will_strip_tags(mysql_real_escape_string($_POST['name']));$_POST['comment'] = will_strip_tags(mysql_real_escape_string($_POST['comment']));if ($_POST['name'] != "" AND $_POST['comment'] != ""){mysql_query("INSERT INTO commentstable (name, comment) VALUES ('{$_POST['name']}', '{$_POST['comment']}')");}print"Comment created.<script>location.href='comments.php';</script>";?></script>

The first page is the HTML only page, where you're going to put the box to fill up the comments, and the name of the guy who is sending the comment. The second one is the PHP page, where the data is processed to check the data and, if correct, insert into the database. I'm pretty fast doing codes so I think that would do pretty well. You will need the file to connect to the mysql server and a table called "commentstable" with vars ID, name, comment, and if you want, time. Feel free to ask if you have any other question about it.
Edited by Pankyy (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.