SyTry
Well-known member
Hello,
I want to update my add-on with 2 new options :
So, my problem is the condition.
For forum :
For usergroup :
Here is my full code :
But I have a problem, here is my options :
Results :
Regards, SyTry
I want to update my add-on with 2 new options :
- Excluded forums
- Excluded usergroups
[SC] Restrict Content View
Description : This add-on allow you to restrict the display of discussions by limiting the number of characters to your visitors. Feature summary : Options : Notice : Highlight Important Success Warning Error Characters Show All Posts Show...
xenforo.com
So, my problem is the condition.
For forum :
!in_array($thread.node_id, $xf.options.sc_ltvfc_excluded_forums)
For usergroup :
!in_array($xf.visitor.user_group_id, $xf.options.sc_ltvfc_excluded_usergroups)
Here is my full code :
Code:
<xf:if is="!in_array($thread.node_id, $xf.options.sc_ltvfc_excluded_forums) AND !in_array($xf.visitor.user_group_id, $xf.options.sc_ltvfc_excluded_usergroups) AND $post.isFirstPost()">
<xf:set var="$snippetPost" value="{{ snippet($post.message, {$xf.options.lgnCharacters}) }}" />
{{ bb_code($snippetPost, 'post', $post) }}
<xf:if is="$snippetPost != $post.message">
<div style="padding-top:1em;">
<div class="blockMessage {$xf.options.lgnNotice} blockMessage--iconic">
{{ phrase('sytry_Login_View_Content') }} <a href="{{ link('login') }}" data-xf-click="overlay">{{ phrase('log_in_or_register_now') }}</a>
</div>
</div>
</xf:if>
<xf:else/>
{{ bb_code($post.message, 'post', $post) }}
</xf:if>
But I have a problem, here is my options :
Results :
- Main forum + Registered : Can't view
- Second forum + Registered : Can't view
- Main forum + Registered : Can view
- Second forum + Registered : Can't view
- Forum : https://xenforo.com/community/threads/access-array-options-in-template.154548/post-1286482
- Group : https://xenforo.com/community/threads/getting-the-group-id-in-a-template.160300/
Regards, SyTry