Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2007, 11:22 PM
mclark2112's Avatar
mclark2112 mclark2112 is offline
 
Join Date: Sep 2002
Location: Eastern USA
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Hide something from specified Usergroups

I'm sure it is quick and easy, but I'm no programmer.

I am running Adsense ads in my templates with just the straight Google code. I want to just put a couple variables around the ad script so it does not show to certain usergroups, can someone help?
Reply With Quote
  #2  
Old 07-18-2007, 11:43 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To remove your Adsense from the view of certain usergroups, you can simply use a conditional in your templates. Just place this around your code you wish to remove from the view of your usergroups....
HTML Code:
<if condition="!is_member_of($vbulletin->userinfo, 1, 2, 3)"></if>
And replace "1, 2, 3" with the usergroups you do NOT want to show the ads to.
Reply With Quote
  #3  
Old 07-19-2007, 03:14 AM
brfrankl's Avatar
brfrankl brfrankl is offline
 
Join Date: Jul 2007
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Trying to use a slight modification of this for the code block template

I have:

Code:
<if condition="is_member_of($vbulletin->userinfo, 2, 5, 6, 7)">
is member
</if>

<if condition="!is_member_of($vbulletin->userinfo, 2, 5, 6, 7)">
is not member
</if>

Also tried this

Code:
<if condition="is_member_of($vbulletin->userinfo, 2, 5, 6, 7)">
is member
<else />
is not member
</if>
and finally this

Code:
<if condition="is_member_of($bbuserinfo, 2, 5, 6, 7)">
is member
<else />
is not member
</if>


Problem is that guests still see "is member". or registered users see is_not_member (depends on which one)

guests are not logged in and should be group 1 and thus should hit the second if clause.

registered and logged in should be group 2 and hit first one.


any ideas?
Reply With Quote
  #4  
Old 07-19-2007, 11:11 AM
TheMilkCarton TheMilkCarton is offline
 
Join Date: Jan 2007
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try
Code:
<if condition="$show['member']">
is member
<else />
is not member
</if>
or
Code:
<if condition="$show['guest']">
is not member
<else />
is member
</if>
I'm not sure if you can use those variables in all templates, though.

Not sure why your code isn't working. I'm tired though.

You could also try this:
Code:
<if condition="is_member_of($bbuserinfo, 2, 5, 6, 7)">
is member
<else />
<if condition="is_member_of($bbuserinfo, 1)">
is not member
</if>
</if>
It's redundant, but if the "is not member" code is still showing to members then something is wrong.
Reply With Quote
  #5  
Old 07-19-2007, 11:30 AM
mclark2112's Avatar
mclark2112 mclark2112 is offline
 
Join Date: Sep 2002
Location: Eastern USA
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool, I will try tonight.

Thank You all for the help.

Matt
Reply With Quote
Reply


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 03:07 PM.


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.05167 seconds
  • Memory Usage 2,200KB
  • 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
  • (6)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete