1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 "Thread Status: Not open for further replies." - Show this for members only

Discussion in 'XenForo Questions and Support' started by sinful, Nov 2, 2013.

  1. sinful

    sinful Member

    How do I go about adding a conditional such that for threads which are closed, the "Thread Status: Not open for further replies." notice at the top and bottom of the thread is only shown to registered members? And make it such that visitors do not see this notice.

  2. Brogan

    Brogan XenForo Moderator Staff Member

    You will need to edit the thread_view template and wrap the div in:
    <xen:if is="{$visitor.user_id}">
    Tracy Perry and sinful like this.
  3. sinful

    sinful Member

    Is there a way to add this in extra.css instead of editing the thread_view template? thanks!
  4. Andrej

    Andrej Well-Known Member

    Chris D likes this.
  5. sinful

    sinful Member

    Okay. Just to confirm, under thread_view template, the code to wrap the conditionals in is:

    <xen:set var="$threadStatusHtml">
        <xen:if hascontent="true">
            <dl class="threadAlerts secondaryContent">
                <dt>{xen:phrase thread_status}:</dt>
                    <xen:if is="{$thread.discussion_state} == 'deleted'">
                        <dd class="deletedAlert">
                            <span class="icon Tooltip" title="{xen:phrase deleted}" data-tipclass="iconTip"></span>
                                {xen:phrase removed_from_public_view}</dd>
                    <xen:elseif is="{$thread.discussion_state} == 'moderated'" />
                        <dd class="moderatedAlert">
                            <span class="icon Tooltip" title="{xen:phrase awaiting_moderation}" data-tipclass="iconTip"></span>
                                {xen:phrase awaiting_moderation_before_being_displayed_publicly}</dd>
                    <xen:if is="!{$thread.discussion_open}">
                        <dd class="lockedAlert">
                            <span class="icon Tooltip" title="{xen:phrase locked}" data-tipclass="iconTip"></span>
                                {xen:phrase not_open_for_further_replies}</dd>
    {xen:raw $threadStatusHtml}
    ? Thanks!

Share This Page