ℹ️
Welcome to the archive of the old FlatPress support forum. Browse more than a decade of FlatPress wisdom! Login is disabled.

The current FlatPress support forum is available here: forum.flatpress.org
Comment delete confirmation
  • Piero has written an addon to add a new "comment delete confirmation" panel. @pierovdfn, sorry for being picky, but this panel looks a little 'out of place' from the graphic standpoint (see the editing panel) http://imgur.com/DK3n9 I had another idea, how about I just add a little "Delete" button to the editing panel? Do you think I should add another confirm panel, then? Another idea would be to replace your TPL with the one for editing, changing all the input fields to a "disabled" state (so they look the same). There is only one problem, now deleting more than one comment at once becomes quite a long boring task...
  • For the graphic I can agree. It'a a modification of edit panel. Adding a delete button is a great idea in all cases. Another solution has both your ideas: adding an if on every field of commedit so we can do it with an only panel but it's not so useful, better using two buttons. For deleting more than one comments you could add a checkbox in comments list and a button with delete signed.
  • Another solution has both your ideas: adding an if on every field of commedit so we can do it with an only panel

    yeech :D
    For deleting more than one comments you could add a checkbox in comments list and a button with delete signed.

    how would you design the confirmation in that case? note: since we are speaking about good practice, a confirmation dialog is always bad practice; allowing to undo is good interaction design. Of course that would be even more tedious to implement. Just saying.
  • Like comments on leggero maybe. Just an idea
  • what do you mean? what has leggero to do with the confirmation dialog?
  • I mean making a panel that has a the list of comments that you're going to delete. Or just making a smarty warning that says you're going to delete xxx comments. Are you sure?
  • nice, long to implement. the confirm dialog might accept a command delete=comment112233-445566,comment121212-343434 (comma delimited IDs)
  • It's not difficult. Think about calling the checkbox myfield[commid], you could use a count to say how much comments you're deleting, then with a foreach you do the work. Is it right?
  • it's not hard per se, it is a bit long to do, feel free to work on it, though :)
  • I had another idea. The warning with
    You're going to delete these xxx comments. Yes, I'm sure or No, take me back to the panel

    and list only comments that you're going to delete. This is the code that I'm trying to get working: function ondeletebl($data=null) { global $fpdb; $params=array('id'=>$_POST['entry'], 'fullparse'=>true); $qid=$fpdb->query($params); if(!isset($_POST['commdelete']) || @count($_POST['commdelete'])==0) { $this->smarty->assign('success', -2); return 0; } $query=&$fpdb->queries[$qid]; $query->prepare(); $query->localcache[$params['id']]=entry_parse($params['id']); $intersect=array_intersect(array_keys($_POST['commdelete']), $query->comments->list); $query->comments=new FPDB_CommentList($_POST['entry'], $intersect); $query->localcache[$params['id']]['comments']=$query->comments; $query->params->comments=false; $this->smarty->assign('warnings', 'You are going to delte xxx comments.'); return 0; } It works for now, but it's a bit hackish :-) EDIT: Here's the complete work for multiple comments: http://www.mediafire.com/?5n4b195hzopt9dn but it wants also my old work because of delete links and messages. The patch for single comments deleting is at http://www.mediafire.com/?2tnyu45bveqrejg but it seems that the link does not work now. However it has an error on lang.admin.entry.php, I've commented wrong, so it has to be so: $lang['admin']['entry']['commedit']['msgs'] = array( 1 => 'Comment has been edited', -1 => 'An error occurred while trying to edit the comment', ); Without the /* at the beginning and */ at the end.
  • This discussion has been closed.
    All Discussions
    Start a New Discussion

    Howdy, Stranger!

    It looks like you're new here. If you want to get involved, click one of these buttons!

    Categories

    In this Discussion