doubledee Posted June 24, 2012 Share Posted June 24, 2012 I have build a module which allows Users to add Comments to Articles on my website. (Similar to how a lot of online news papers do.) Based on the advice of others, I have also created a way for people to "Report" a Comment that they feel is inappropriate. As such, it probably makes sense to allow the Original Poster go back and modify his/her Original Comment since other people will be watching things. Can you guys give me a sense of how I should approach allowing Edits to User Comments?? I'm not really sure where to begin, and what kinds of things I need to consider and do... Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/264681-allowing-edits-on-user-comments/ Share on other sites More sharing options...
darkfreaks Posted June 24, 2012 Share Posted June 24, 2012 http://www.bestwebimage.com/archives/allow-users-to-edit-comments-with-wp-plugin/ this is a WP plugin that allows a user to edit there comments for a certain amount of time and a certain amount of permissions (what all they can do edit,blacklist etc).this should give you an idea what to do. Quote Link to comment https://forums.phpfreaks.com/topic/264681-allowing-edits-on-user-comments/#findComment-1356530 Share on other sites More sharing options...
doubledee Posted June 24, 2012 Author Share Posted June 24, 2012 http://www.bestwebimage.com/archives/allow-users-to-edit-comments-with-wp-plugin/ this is a WP plugin that allows a user to edit there comments for a certain amount of time and a certain amount of permissions (what all they can do edit,blacklist etc).this should give you an idea what to do. Thanks but... 1.) I don't use WordPress 2.) I don't use AJAX 3.) I would prefer discussing things here Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/264681-allowing-edits-on-user-comments/#findComment-1356531 Share on other sites More sharing options...
kicken Posted June 24, 2012 Share Posted June 24, 2012 Thanks but... The intent of that link was that you could see what they did and use it as a way to get the ideas for how to setup your own edit functionality. It doesn't matter if you use wordpress or ajax or not. That said, editing is not that much different than adding. Just pre-fill the textarea with the current comment text when they load the edit page, and on submit run an UPDATE query on the selected comment rather than an INSERT query. Quote Link to comment https://forums.phpfreaks.com/topic/264681-allowing-edits-on-user-comments/#findComment-1356535 Share on other sites More sharing options...
doubledee Posted June 24, 2012 Author Share Posted June 24, 2012 Thanks but... The intent of that link was that you could see what they did and use it as a way to get the ideas for how to setup your own edit functionality. It doesn't matter if you use wordpress or ajax or not. That said, editing is not that much different than adding. Just pre-fill the textarea with the current comment text when they load the edit page, and on submit run an UPDATE query on the selected comment rather than an INSERT query. My best guess would be... - Check how much time has transpired between Now and Orig Post Date - If difference is less than ____, then... - Load Original Comment - Sanitize Data - Update Record Since these are just linear Comments to an Article (i.e. no concept of linked Comments), I guess it should be much easier than in something like a Forum, right? Thanks, Debbie Quote Link to comment https://forums.phpfreaks.com/topic/264681-allowing-edits-on-user-comments/#findComment-1356539 Share on other sites More sharing options...
kicken Posted June 24, 2012 Share Posted June 24, 2012 - Check how much time has transpired between Now and Orig Post Date - If difference is less than ____, then... You only need those steps if you want to limit editing time, such as the forms here do. If you'd rather let anyone edit at any time you can skip that part. Since these are just linear Comments to an Article (i.e. no concept of linked Comments), I guess it should be much easier than in something like a Forum, right? Even if they were threaded comments with linked replies and such, the editing process is still the same. When the user edits, all your doing is updating the text of the comment, not any of the details for how it links with other comments so there is no need to worry about those parts. That is something you'd only deal with when adding a comment. Quote Link to comment https://forums.phpfreaks.com/topic/264681-allowing-edits-on-user-comments/#findComment-1356627 Share on other sites More sharing options...
doubledee Posted June 24, 2012 Author Share Posted June 24, 2012 - Check how much time has transpired between Now and Orig Post Date - If difference is less than ____, then... You only need those steps if you want to limit editing time, such as the forms here do. If you'd rather let anyone edit at any time you can skip that part. Don't you think I should have a time limit? The benefits to me would be... 1.) Prevent others from commenting on content that is no longer there 2.) Make it more difficult for someone to make a controversial, insulting, or otherwise unnecessary comment, and then going back and erasing it. (Even with community regulated comments, that could still be an issue.) 3.) Discourage SPAM Debbie Quote Link to comment https://forums.phpfreaks.com/topic/264681-allowing-edits-on-user-comments/#findComment-1356633 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.