Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How can I remove the Start a New Discussions for regular users

edited November 2011 in Vanilla 2.0 - 2.8
Hi,
I would like to remove the ' Start New Discussions " for the regular users, how can i do that .

I would like to also approve all new discussion post by non admin..Is that Posible

Please Help ,
Thanks

Best Answer

  • Options
    x00x00 MVP
    edited November 2011 Answer ✓
    first you set the role in dashboard so they can reply to comments, so in the Add column for the category permission uncheck discussions but leave comments. Double check all the permissions. Then save.

    Depending on your theme there is some theme based logic to remove the button for guest.

    copy /applications/vanilla/views/modules/newdiscussion.php to
    /themes/[your theme]/views/modules/

    creating the folder structure first.

    then open up the file and wrap everything bellow the first line in
    if(array_key_exists('Discussion', $Data)) {
    $CatID = $Data['Discussion']->PermissionCategoryID;
    }else if(array_key_exists('Category', $Data)) {
    $CatID =$Data['Category']->PermissionCategoryID)
    }else{
    $CatID = 'any';
    }
    if (Gdn::Session()->CheckPermission('Vanilla.Discussions.Add',TRUE, 'Category',$CatID){
    [button code]
    }
    where [button code] is everything before the first line.

    grep is your friend.

Answers

  • Options
    x00x00 MVP
    edited November 2011 Answer ✓
    first you set the role in dashboard so they can reply to comments, so in the Add column for the category permission uncheck discussions but leave comments. Double check all the permissions. Then save.

    Depending on your theme there is some theme based logic to remove the button for guest.

    copy /applications/vanilla/views/modules/newdiscussion.php to
    /themes/[your theme]/views/modules/

    creating the folder structure first.

    then open up the file and wrap everything bellow the first line in
    if(array_key_exists('Discussion', $Data)) {
    $CatID = $Data['Discussion']->PermissionCategoryID;
    }else if(array_key_exists('Category', $Data)) {
    $CatID =$Data['Category']->PermissionCategoryID)
    }else{
    $CatID = 'any';
    }
    if (Gdn::Session()->CheckPermission('Vanilla.Discussions.Add',TRUE, 'Category',$CatID){
    [button code]
    }
    where [button code] is everything before the first line.

    grep is your friend.

  • Options
    $CatID =$Data['Category']->PermissionCategoryID)
    should be
    $CatID =$Data['Category']->PermissionCategoryID;

    grep is your friend.

Sign In or Register to comment.