Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 03-06-2018, 06:53 PM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 03-06-2018, 07:28 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ...
Reply With Quote
  #3  
Old 03-06-2018, 08:41 PM
scottkoz20 scottkoz20 is offline
 
Join Date: Dec 2015
Location: Lewiston, NY
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 03-06-2018, 08:52 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check this thread out ..

https://vborg.vbsupport.ru/showthread.php?t=231525
Reply With Quote
  #5  
Old 03-07-2018, 04:26 PM
Pistils Pistils is offline
 
Join Date: Oct 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 03-08-2018, 06:18 AM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Pistils View Post
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
Reply With Quote
  #7  
Old 03-08-2018, 08:31 AM
scottkoz20 scottkoz20 is offline
 
Join Date: Dec 2015
Location: Lewiston, NY
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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@-->
Reply With Quote
Благодарность от:
CAG CheechDogg
  #8  
Old 03-08-2018, 05:14 PM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by scottkoz20 View Post
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
Reply With Quote
  #9  
Old 03-09-2018, 11:27 AM
scottkoz20 scottkoz20 is offline
 
Join Date: Dec 2015
Location: Lewiston, NY
Posts: 344
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 03-10-2018, 01:24 AM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by scottkoz20 View Post
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:51 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06664 seconds
  • Memory Usage 2,256KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete