PHP Classes

Bootstrap PHP Comment System with MySQL: Comments system with replies and like buttons

Recommend this page to a friend!
  Info   View files Example   Demos   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (5)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 1,716 This week: 1All time: 2,291 This week: 59Up
Version License PHP version Categories
bootstrap-comment 1.0Freely Distributable5.0PHP 5, Databases, Content management


This package implements a comments system with replies and like buttons.

It can display forms and buttons using the Bootstrap framework to let the user enter comments, replies to comments and click to like or dislike a comment.

The comments are saved to a MySQL database table accessed using the MySQLi extension.

The comment text is filtered to remove bad words read from a bad words list file.

Innovation Award
PHP Programming Innovation award nominee
December 2015
Number 4

Prize: One year server license IP to country, region, city, latitude, longitude, ZIP code, time zone, area code database
Comment systems are very useful to provide means for user interaction in sites that publish content of the interest of communities.

This package implements a complete comments system that includes comments, replies, like and dislike buttons and bad word filtering.

Manuel Lemos
Picture of Vishv Sahdev
  Performance   Level  
Name: Vishv Sahdev <contact>
Classes: 13 packages by
Country: India India
Age: 52
All time rank: 51329 in India India
Week rank: 35 Up2 in India India Up
Innovation award
Innovation award
Nominee: 7x


Comment On Post
I Want user can comment on post

upvote/downvote or like dislike system in php and mysql
I need to make upvote downvote or like and dislike system

What is the best PHP blog comment system class?
Need a script or advice for a blog commenting system


 * PHP Comment Class
 * @author -
 * @version 1.0.0
 * @date November 17, 2015

include "config.php";

//----------edit if require-------------------------------

$co = new bootstrapcomment("localhost",$dbuser, $dbpass,$dbname);

//------------------Save Comment---------------
if(isset($_POST['uri']) && $_POST['uri'] == $_SERVER['REQUEST_URI']){



$totalRow > $perPageDisplay )
$tgroup=round($totalRow / $perPageDisplay );

$output['script'] = '<script>

        var id = $(this).attr("aria-value");
            } else {
            return false;
$(document).ready(function() {
var id = $(this).attr("aria-value");
$.post("/comment/like-dislike.php",{"type":"like","id":id}, function(data){


                    $("#UP"+id).text(" " +data);

var id = $(this).attr("aria-value");
    url : "/comment/like-dislike.php",
    type: "POST",
    data : {"type": "dislike","id":id},
    success: function(data)
       $("#DOWN"+id).text(" " +data);
$(this).text(d + "v");

$output['maincontent'] ='
<div class="form-group rreply" id="freply">
      <input type="text" class="form-control ">
<div class="form-group replyin">
 <form method="post" action="'
.$_SERVER['REQUEST_URI'].'" id="foo">
<input type="hidden" name="tm" value="'
<input type="hidden" name="uri" value="'
<input type="hidden" name="id" id="id" value="0"/>
 <div class="form-group">
      <input type="text" class="form-control" id="name" name="name" placeholder="Name...">
   <div class="form-group">
      <textarea class="form-control" id="comment" name="comment" row="5" placeholder="Add a public comment..."></textarea>
  <div class="form-group">
      <button type="submit" class="btn btn-info" id="submit">Comment</button>


$output['maincontent'] .='<ul>';

$res=$co->fetchCategoryTree(0,$_SERVER['REQUEST_URI'],3," LIMIT 20");
  foreach (
$res as $r) {
$output['maincontent'] .= $r;

$output['maincontent'] .= '</ul>';

$output['title']="Demo COMMENT";

.showmore{padding: 10px;width: 80%; border: 1px solid #777;}
.showmore:hover{background-color: #ddd;}
.bg-info{padding: 10px;border: 1px solid #6CA6CD;font-weight: 700;}
background-color: #e5f1ff;
border: 1px solid #b2d7ff;
padding-top: 10px;
margin-bottom: 10px;
.panel-body{padding: 10px; color: #777;}
margin-right: 12px;
cursor: pointer;

opacity: .2;



is_file( "comment-template.php"))
$co->render_temp( "comment-template.php",array("output"=>$output));


  boottstrapcommentExternal page  

Open in a separate window

  Files folder image Files  
File Role Description
Plain text file badwordslist.txt Data Badwords Filter file
Plain text file bootstrapcomment.php Class Class
Plain text file comment-template.php Aux. Template
Plain text file comment.php Example Example File
Plain text file comment.sql Data SQL Example
Plain text file config.php Conf. Config
Plain text file like-dislike.php Example Jquery Widget

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:2,291
This week:59Up