News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Spindrop.us:
Digg-style AJAX comment editing in PHP/symfony
August 14, 2006 @ 08:10:15

Users of the site Digg will know how the commenting works. It allows you, through a series of Ajax calls and other information, to edit the comments that you've made for a certain amount of time right on the page. It's a handy feature, and in this new posting over on Spindrop.us, they show you how to create it (with the help of symfony).

It's pretty straight forward. For all of your posted comments you check if the owner of them is viewing them within 3 minutes of posting the commen. 3 minutes is usually enough time to notice you made a typo, but if you disagree I'll leave it to you to figure out how to adjust the code.

For example, I make a comment, realize I spelled something wrong and then I can click on my comment to edit it. Of course using AJAX means this all happens without having to reload the web page. Therefore the edits are seemingly quick. So let's add it to any web site.

He steps you through the process, first creating the DIV for the each of the comments, then some Javascript to make it editable. He then creates a timer to monitor how long it's been since the comment to limit the editing to three minutes. Finally, the code bits to load the text from the database and to save the text back in once it's been edited.

6 comments voice your opinion now!
ajax symfony digg comment editing form timer tutorial ajax symfony digg comment editing form timer tutorial


blog comments powered by Disqus

Similar Posts

Ibuildings techPortal: DPC11: Distributed Systems Tutorial

DevShed: Auto Loading Classes in PHP 5

Builder.com: Match users to their geo-location with PHP and PEAR Net:Geo

ProDevTips.com: Ajax, ZF and Smarty feed reader - part 1

Fernando Bassani's Blog: Putting the PHP/Java Bridge to work - I


Community Events





Don't see your event here?
Let us know!


release install unittest configure wordpress community podcast refactor introduction framework opinion interview developer code series testing language list threedevsandamaybe laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework