[SC] Restrict Content View

[SC] Restrict Content View 2.0.0 Fix 1

No permission to download
Hello, this add-on will be update by me and @CRUEL-MODZ at @XenSoluce now :

Regards, SyTry
 
Can this addon restrict view only on specific threads? I would like to only force users to register on selected articles ("premium content"), and not all regular content, as I feel that would be too restrictive as my site is fairly new.
 
Can this addon restrict view only on specific threads? I would like to only force users to register on selected articles ("premium content"), and not all regular content, as I feel that would be too restrictive as my site is fairly new.
/admin.php?options/groups/discourager/
 
Hello,
This plugin can now only hide content from the first post, not all other posts.
I hope an update comes.
If there is an update, I have a suggestion.
Except for the first post, only the option to hide comments can be added.
 
Hello,
This plugin can now only hide content from the first post, not all other posts.
I hope an update comes.
If there is an update, I have a suggestion.
Except for the first post, only the option to hide comments can be added.
Hello, yes of course we'll update this add-on. We'll see what we can do about your suggestion too ! ;)

Regards, SyTry
 
@XenSoluce @SyTry
I installed it in my Xenforo 2.2.15 under PHP 8.2.x
No error messages for now - fine. :)

But - the function to hidde also all other postings/answers after a hidded first post seems to be doesnt working with an actual Xenforo.
Also the page nav settings doesnt have any effect with the latest version.

Can you please make an update to fix that? Thanks. :-)
 
Ok, I have it found my self - but one of the coders should check my changes.
For me it works now with my changes.

TMS:
1710683728644.webp
All three marked doesnt work with a Xenforo 2.2.15 - so I have take a look at and think I have found a solution for:


Login To View Full Content - Pagenav 1
Edit search to:​
Code:
            <xf:contentcheck>
                <xf:pagenav
                    page="{$page}" perpage="{$perPage}" total="{$totalPosts}"
                    link="threads" data="{$thread}" params="{$pageNavFilters}" hash="{$pageNavHash}"
                    wrapperclass="block-outer-main" />
Edit replace to:​
Code:
            <xf:contentcheck>
                <xf:if is="in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) OR !in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'bottom' OR !in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'all'">
                    <xf:pagenav
                        page="{$page}" perpage="{$perPage}" total="{$totalPosts}"
                        link="threads" data="{$thread}" params="{$pageNavFilters}" hash="{$pageNavHash}"
                        wrapperclass="block-outer-main" />
                    </xf:if>
                <xf:if is="!in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'top' OR !in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'none'">
            </xf:if>

Login To View Full Content - Macro
Edit search to:​
Code:
                        <xf:macro name="{{ $templateOverrides.post_macro ?: 'post_macros::post' }}"
                            arg-post="{$post}"
                            arg-thread="{$thread}"
                            arg-highlightedPosts="{$highlightedPosts}"
                            args="{$templateOverrides.post_macro_args}" />
Edit replace to:​
Code:
                        <xf:if is="!in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_all_posts">
                            <xf:macro name="{{ $templateOverrides.post_macro ?: 'post_macros::post' }}"
                                arg-post="{$post}"
                                arg-thread="{$thread}"
                                arg-highlightedPosts="{$highlightedPosts}"
                                args="{$templateOverrides.post_macro_args}" />
                        <xf:else />
                            <xf:if is="!in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $post.isFirstPost() OR in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups)">
                            <xf:macro name="{{ $templateOverrides.post_macro ?: 'post_macros::post' }}"
                                arg-post="{$post}"
                                arg-thread="{$thread}"
                                arg-highlightedPosts="{$highlightedPosts}"
                                args="{$templateOverrides.post_macro_args}" />
                            </xf:if>
                        </xf:if>
login_view_full_content_pagenav
Edit search to:​
Code:
        <xf:pagenav
            page="{$page}" perpage="{$perPage}" total="{$totalPosts}"
            link="threads" data="{$thread}" params="{$pageNavFilters}" hash="{$pageNavHash}"
            wrapperclass="block-outer-main" />
Edit replace to:​
Code:
        <xf:if is="in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) OR !in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'top' OR !in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'all'">
        <xf:pagenav
            page="{$page}" perpage="{$perPage}" total="{$totalPosts}"
            link="threads" data="{$thread}" params="{$pageNavFilters}" hash="{$pageNavHash}"
            wrapperclass="block-outer-main" />
        </xf:if>
        <xf:if is="!in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'bottom' OR !in_array($xf.visitor.user_group_id, $xf.options.sc_rcv_excluded_usergroups) AND $xf.options.sc_rcv_show_pagenav == 'none'">
        
        </xf:if>
All at your own risc, just make a backup bevore, bla, bla, bla... - you know what I mean. ;)
 
Last edited:
My workaround fix all but not the forum condistionals.... so, I will wait for the official update. :-)
 
Back
Top Bottom