This time, we are making a Simple AJAX Commenting System. It will feature a gravatar integration and demonstrate how to achieve effective communication between jQuery and PHP/MySQL with the help of JSON.
2. Facebook Style Wall Posting and Comments System using jQuery PHP and Ajax.
Facebook style wall posting and commenting system. Try a new reloaded version of demo which is almost similar to facebook style. My previous facebook style posting system was not so much like original facebook posting style and also there is no commenting system So I created this tutorial again to complete the commenting system and I tried my best to give my dear users a complete posting script with comments system. Facebook is now a days top social networking site.
So I have created some tutorials similar to facebook. Youtube style rating is also very popular tutorial on this blog. Hope you like it.
In this tutorial we will create multi level comments. You must have seen comments on youtube and that they have levels depending on who replied to who. Thatís exactly what we will build.
Iíve seen that most of scripts online execute query to check if comment has child elements. Letís say you have 10 comments and each of them has 1 child element. You would execute 1 query to get all those 10 comment (first level) and then for each of them to check if it has child. And then for each child to check if that comment has childs to. That would be 1 + 10 + 10 = 21. Thatís 21 query for nothing. Itís easier to do it with just one query that will load all comments and then to structure them in an multidimensional array. For that purpose we will use walker class that you can download here and read tutorial how we made it here. So letís start working on it.
Continuing with a rather ĎAjaxí theme after the last few tutorials on here i thought Iíd go the full way and show you how to create a 140 character php and ajax comments tool. Weíre using jQuery to perform the ajax request and create the user experience. You can download all the files needed to get this working at the bottom of this post, it includes the MySQL file to create the database table.