vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   how can i restrict sideblocks by usergroup? (https://vborg.vbsupport.ru/showthread.php?t=326182)

IggyP 03-06-2018 06:53 PM

how can i restrict sideblocks by usergroup?
 
just noticed there is no options for this...a bit amazed, but does anyone know an easy way or if there is a plug in to support it?

wishing to make a sideblock only to show for users not logged in....also curious about how it would be done manually, with an obvious "if condition" solution....like where i would place it, how to hook it or what?

could be some interesting learning tests, but im open to an easy solution lol ;P

thanks

CAG CheechDogg 03-06-2018 07:28 PM

Make a new template call it

block_html_nonmembers

In that template add the following

Code:

<vb:if condition="is_member_of($bbuserinfo, 1)">
<li>
        <div class="block smaller" id="members_not_logged_in">
                <div class="blocksubhead">
                        <a class="collapse" id="collapse_block_html_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" width="16" height="16" id="collapseimg_html_{vb:raw blockinfo.blockid}"/></a>
                        <span class="blocktitle">{vb:raw blockinfo.title}</span>
                </div>
                <div class="widget_content blockbody floatcontainer">
                <div id="block_html_{vb:raw blockinfo.blockid}" class="blockrow">
                        {vb:raw content}
                </div>
                </div>
        </div>
        <div class="underblock"></div>
</li>
</vb:if>

Now you can add a block using the template "block_html_nonmembers" instead of "block_html" and it will only display to those who are logged in ...

scottkoz20 03-06-2018 08:41 PM

and I assume if you want to make it something that does not show for a certain usergroup (like a banner ad) - can you use this

Code:

<vb:if condition="!is_member_of($bbuserinfo, XX)">
for the conditional?

CAG CheechDogg 03-06-2018 08:52 PM

Check this thread out ..

https://vborg.vbsupport.ru/showthread.php?t=231525

Pistils 03-07-2018 04:26 PM

Hi,

is there a way to get the ad manager to recognise the sideblocks so we can use all those conditionals already selectable?

is this a simple template edit?

appreciate any guidance you can offer, if you will help that ugly IggyP, can you help me also please, i am much better looking that him.. lol

regards

P

IggyP 03-08-2018 06:18 AM

Quote:

Originally Posted by Pistils (Post 2593364)
Hi,

is there a way to get the ad manager to recognise the sideblocks so we can use all those conditionals already selectable?

is this a simple template edit?

appreciate any guidance you can offer, if you will help that ugly IggyP, can you help me also please, i am much better looking that him.. lol

regards

P

haha, hes lying ;P

that is a better idea tho, i have to admit......it is surprising those sideblock do not have permissions like the ad manager...or forums even...but there is alot of nice options in there if they could be applied without a major brain surgury...

thank you cheechdogg for sharing that, it may still come in useful but now im wondering about this other approach idea...wouldnt that make a prime addon? maybe it is buried somewhere hmm

scottkoz20 03-08-2018 08:31 AM

you really don't need to you worry about the ad manager in the AdminCP, you can create the ad block as CAG mentioned and build the block and reference the Ad code directly on the sidebar (or if you are using this - then use the <!--@vbbanners:XX@-->

IggyP 03-08-2018 05:14 PM

Quote:

Originally Posted by scottkoz20 (Post 2593383)
you really don't need to you worry about the ad manager in the AdminCP, you can create the ad block as CAG mentioned and build the block and reference the Ad code directly on the sidebar (or if you are using this - then use the <!--@vbbanners:XX@-->

not sure what u mean?

using the modified block CAG provided does not give any of the options the ad manager has...only the one....if you follow my meaning....

its not a worry to HAVE to use ad manager, its that it would be a huge benefit if we were able to...adding a rotator wont do anything toward adding those permission options will it?

i know alot can be manually added with if conditions but that is a powerful logic pistils made, i cant ignore it...hmm

scottkoz20 03-09-2018 11:27 AM

what I mean is if you are using the modification referenced in my previous post, you don't need to use the ad manager in AdminCP (you can still leverage the Ad Location templates in the Style manager). If you add in the conditional VB if statement, you will be able to either include or exclude usergroups, depending on what you are looking to do.

IggyP 03-10-2018 01:24 AM

Quote:

Originally Posted by scottkoz20 (Post 2593402)
what I mean is if you are using the modification referenced in my previous post, you don't need to use the ad manager in AdminCP (you can still leverage the Ad Location templates in the Style manager). If you add in the conditional VB if statement, you will be able to either include or exclude usergroups, depending on what you are looking to do.

still feel like something is confused in this....if the sideblocks were given "ad manager" support the way pistils suggested....there would not be any need to "add in the conditional statement" manually....as the options would already be there....

which is what seems like the thing to try and do here should be, for simplicity sake....or to put it another way....why would you want to individually and manually add if conditions when there is a panel full of them already in gui form in the ad manager?

have you looked at the ad manager? perhaps you dont get what we are saying.....the options are already there....this isnt about ad manager placement or rotations, it is in attempt to apply "ad manager permissions" to a side block module(ad)....

that help at all? or confuse more lol


All times are GMT. The time now is 02:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01058 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete