solved Locking Group discussions?

Strumelia
Strumelia
@strumelia
10 years ago
3,605 posts
As admin, I have the ability to 'lock' a forum discussion/thread so that members cannot add further responses.
There have already been multiple times when I've had the need to lock, but not delete, a Group discussion/thread...but am not able to.
I realize that Group Discussions are not constructed the same way as true forum discussions, but could we possibly get the ability to lock them as we can forum discussions?

While we're at it...it'd be great to also have the 'quote' feature available when responding to previous posts in a Group discussion, just as we have when responding in a Forum discussion. Should I create a new thread here for that though?

Thanks so much for any input!


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 10/21/15 05:54:10AM
paul
@paul
10 years ago
4,335 posts
Add a checkbox field called discuss_locked to the GroupDiscuss update form using the Form Designer, then in the jrComment comment_form.tpl template wrap the code that generates the comment form in some conditional code, something like -

{if jrUser_is_logged_in() && $_user.quota_jrComment_allowed == 'on'}
    {if $jrComment.module == 'jrGroupDiscuss' && $jrComment.discuss_locked != 'off'}
        Discussion Locked
    {else}
        Show comment form
    {/if}
{/if}



--
Paul Asher - JR Developer and System Import Specialist
Strumelia
Strumelia
@strumelia
10 years ago
3,605 posts
Ok, I tied to do all that, but now I see the (unclickable) words "discussion locked" at the bottom of EVERY group discussion. And no checkbox. And the discussions are NOT locked anyway.
Obviously I'm doing something wrong.
Here's my jrComment comment_)form template now after I guessed where to put it:
<a id="{$jrComment.unique_id}_cm_section"></a>
<a id="comment_section"></a>

<div id="{$jrComment.unique_id}_comments" class="comment_page_section">

    {* see if profile owners can delete *}
    {assign var="profile_owner_id" value=0}
    {if $_user.user_active_profile_id == $_item._profile_id && $_item.quota_jrComment_profile_delete == 'on'}
        {assign var="profile_owner_id" value=$_item._profile_id}
    {/if}

    {if $jrComment.pagebreak > 0}
        {jrCore_list module="jrComment" search1="comment_module = `$jrComment.module`" search2="comment_item_id = `$jrComment.item_id`" order_by="_item_id `$_conf.jrComment_direction`" profile_owner_id=$profile_owner_id pagebreak=$_conf.jrComment_pagebreak page=1 pager=true pager_template="comment_pager.tpl"}
    {else}
        {jrCore_list module="jrComment" search1="comment_module = `$jrComment.module`" search2="comment_item_id = `$jrComment.item_id`" order_by="_item_id `$_conf.jrComment_direction`" limit="500" profile_owner_id=$profile_owner_id}
    {/if}

</div>

{if jrUser_is_logged_in() && $_user.quota_jrComment_allowed == 'on'}

    <div id="comment_form_holder">
    <div id="comment_form_section">

        <div id="{$jrComment.unique_id}_cm_notice" class="item error" style="display:none;">
            {* any comment error loads here *}
        </div>

        {if $_conf.jrComment_threading == 'on' && $_conf.jrComment_editor == 'on'}
        <div id="comment_reply_to" class="item success" style="display:none;">
            {* small note about how you are replying to when editor is enabled *}
            {jrCore_lang module="jrComment" id=18 default="Your Reply To:"} <strong><span id="comment_reply_to_user"></span></strong>
        </div>
        {/if}

        <div class="item" style="display:table">
            <div style="display:table-row">
                <div class="p5" style="display:table-cell;width:5%;vertical-align:top;">
                    {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$_user._user_id size="small" alt=$item.user_name class="action_item_user_img iloutline" _v=$_user.user_image_time}
                </div>
                <div class="p5" style="display:table-cell;width:95%;padding:5px 12px;">

                    <a id="cform"></a>
                    <form id="{$jrComment.unique_id}_form" action="{$jamroom_url}/comment/comment_save" method="POST" onsubmit="jrPostComment('#{$jrComment.unique_id}', 'undefined', 5000, '{$_conf.jrComment_editor}');return false">

                        <input type="hidden" id="{$jrComment.unique_id}_cm_module" name="comment_module" value="{$jrComment.module}">
                        <input type="hidden" id="{$jrComment.unique_id}_cm_profile_id" name="comment_profile_id" value="{$jrComment.profile_id}">
                        <input type="hidden" id="{$jrComment.unique_id}_cm_item_id" name="comment_item_id" value="{$jrComment.item_id}">
                        <input type="hidden" id="{$jrComment.unique_id}_cm_order_by" name="comment_order_by" value="{$_conf.jrComment_direction}">
                        <input type="hidden" id="comment_parent_id" name="comment_parent_id" value="0">

                        {if isset($_conf.jrComment_editor) && $_conf.jrComment_editor == 'on'}
                            {jrCore_editor_field name="comment_text"}
                        {else}
                            <textarea id="comment_text" name="comment_text" cols="40" rows="5" class="form_textarea {$jrComment.class}" style="height:64px;width:98%;{$jrComment.style}"></textarea><br>
                        {/if}
                        <div style="vertical-align:middle">
                            {jrCore_lang module="jrCore" id="73" default="working..." assign="working"}
                            {jrCore_image image="form_spinner.gif" id="`$jrComment.unique_id`_fsi" width="24" height="24" alt=$working style="margin:8px 8px 0px 8px;display:none"}<input id="{$jrComment.unique_id}_cm_submit" type="submit" value="{jrCore_lang module="jrComment" id="2" default="Save Comment"}" class="form_button {$jrComment.class}" style="margin-top:8px;{$jrComment.style}">
                        </div>

                        {if $_user.quota_jrComment_attachments == 'on'}
                        <div class="jrcomment_upload_attachment">
                            {jrCore_upload_button module="jrComment" field="comment_file" allowed="`$_user.quota_jrComment_allowed_file_types`" multiple="true"}
                        </div>
                        {/if}

                    </form>

                </div>
            </div>
        </div>
    </div>
    </div>

    {if $jrComment.module == 'jrGroupDiscuss' && $jrComment.discuss_locked != 'off'}
        Discussion Locked
    {else}
        Show comment form
    {/if}

{elseif jrUser_is_logged_in() === false}

    {jrCore_module_url module="jrUser" assign="url"}
    <div class="item"><div class="p5"><a href="{$jamroom_url}/{$url}/login">{jrCore_lang module="jrComment" id="16" default="You must be logged in to post a comment"}</a></div></div>

{/if}

and attached is the form field I added first...did I do the settings correctly?


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 09/16/15 01:24:46PM
Strumelia
Strumelia
@strumelia
10 years ago
3,605 posts
I have this:
jrGroup_update.jpg
jrGroup_update.jpg  •  63KB




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
paul
@paul
10 years ago
4,335 posts
Looks like you added the checkbox to the group update form and not the group discuss update form. Also, the words in the code I gave you were advice on what code to insert - not to be used literally ;-)
Can I login and sort it for you? (I still have your admin login)


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
10 years ago
4,335 posts
Too late - am sorting it for you now :-)


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
10 years ago
4,335 posts
Sorted.
Admins need to update the GroupDiscussion to see and check the Lock checkbox.
hth


--
Paul Asher - JR Developer and System Import Specialist
Strumelia
Strumelia
@strumelia
10 years ago
3,605 posts
Awesome! I was working for a while on a bunch of patent drawings, and when I came back here, you had sorted out my little mess! :D Let me go check it out...


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
10 years ago
3,605 posts
Fabulous! Kinda funny the way I try but manage to goof things up half the time. Well, at least I try! Sometimes I succeed, which is always cool and amazing to me. lololol

Thank you so much Paul! Such 'little' things really make it easier for admins and moderators to run a site properly.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015