Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Developer needed "Start a new discussion", approving before making it public

edited March 2007 in Vanilla 1.0 Help
Hello, I would like a extension that sends every new discussion to the Admin for approval before allowing it to show up. Is something like this available? Thank you!
«1

Comments

  • StashStash
    edited February 2007
    I don't know of one, but it would be good to have an extension that did this, perhaps even with the option of moderating comments as well. Then you can allow certain roles to not need moderating for starting discussions and another option fr the comments as well :)

    You'd also need an option in the roles to assign moderating options to a role.
  • Yes I agree. Good ideas - Do you know a hero that can make such a thing?
  • Any other idea how to make this?
  • Basically you just need to start all new discussions as closed or deleted, email a link to the mods, and have them open it if it's OK. It wouldnt be too difficult to make. I might do it if i get bored but considering I'm in France on a ski/board holiday at the moment hopefully I wont... :D
  • edited February 2007
    You could easily make the new discussions/comments deleted by default. On the PreSave delegate, for everybody but the admins set $Discussion->Active to zero and set your moderator accounts to have deleted comments and discussions visible. Then to 'approve' a discussion, you simply undelete it.

    You should probably also make a 'your comment has been saved and is pending administrative approval' message to keep users from aassuming it didin't post and re-posting ad infinitum.

    edit: Doh! beaten by five minutes. I sound like a broken record.
  • Thank you all for your great help! I will try it, but as an extension this would be perfect :-)
  • WallPhone, where to make "new discussions/comments deleted" by default? And where "for everybody but the admins set $Discussion->Active to zero" :) Thank you.
  • Afraid I don't have much time to put into this, but here is a basic framework of how to attach to a delegate and change some values for a comment:<?php /* Extension Name: Pre Approval Extension Url: http://lussumo.com/docs/ Description: Sets all discussions and comments as deleted by default. It is then up to the administrator to 'approve' comments before they are visible Version: .1 Author: Your Name Here Author Url: http://example.com/ */ if ( 'post.php' == $Context->SelfUrl ) { function PreApproval_NewComment(&$Comment) { if ( !$Comment->Context->Session->User->Permission('PERMISSION_VIEW_HIDDEN_COMMENTS') ) { $Comment->Deleted = 1; $Comment->DeleteUsername = 'Pending Approval'; } } $Context->AddToDelegate('CommentManager','PreSaveNewComment','PreApproval_NewComment'); } ?>

    Basically what is happening, first we check that we are on the post page (saving a comment/discussion) then we create a function that checks if the person logged in has permission to view hidden discussions. If they don't, the extension sets the comment to deleted and puts a message in the delete user name field (I am not sure if it would work to put that there.)

    We next attach to the delegate that happens right before Vanilla saves a new comment to the database. This code needs some debugging and possibly attaching to another delegate to mark new discussions as deleted ($Discussion->Active = 0)
  • Man, I thank you very much...! How to emped this? As an extension?
  • Yep, its not complete--only about half-written, and untested but should get development started on the extension for whoever wants to finish it.
  • Yeah. Paste that into a default.php file and put it in a new folder in your extensions directory. That code alone wont do the full job for you though.
  • I have installed the extension (fine) and made active for the admin "Deleted discussions visible" - disabled the same for the normal user that posts a new suggestion. logged in at the user and sent the discussion but it shows up even for that normal user... not deleted :-) thank you for all your great help!
  • Minisweeper, would you PLEASE look into this again? :) THANK YOU
  • Can you code php/mysql?
  • aboslutely not. :(
  • Well what would you rather do, approve each user, or approve each post?
  • edited February 2007
    approve each NEW DISCUSSION, new commets can go through without notice :) THANK YOU for trying to help!
  • I'm not trying to beat around the bush, I just want to find the best solution for you.

    Why exactly do you want to do this.
  • I will have a stock message board with predefined dicussions (100+), each with the name of the stock. If someone wants to add a new stock topic I want to review it first,
  • Hmm, I'll look at how the discussions are added and see if i can't come up with something.
This discussion has been closed.