The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have an "advert" block that I want to hide from paid members. Is there a simple way to do this?
http://forum.rsclassics360.co.uk/forum.php Thanks Matt |
#2
|
|||
|
|||
![]()
anyone?!
![]() --------------- Added [DATE]1350419872[/DATE] at [TIME]1350419872[/TIME] --------------- i tried doing this within the block.... dont work... <if condition="$post['usergroupid'] != 24"> GOOGLE ADSENSE HERE </if> |
#3
|
|||
|
|||
![]()
I am not a pro in coding but did something similar. Not exactly the same what you are looking for but it might help to figure it out.
I didn't wanted to hide a block but display a message instead in that block to animate the unregistered/visitors (usergroupid 1) to register. my code: Code:
<vb:if condition="is_member_of($bbuserinfo, 1)"> Only Registered/Logged in users can view this section <vb:else /> **** add here the contents you want to display and remember to add "</vb:if>" at the end of the contens you display**** |
#4
|
|||
|
|||
![]()
hmm that dont seem to work, is this in HTML, or PHP?
Mine is in HTML and its a adwords script within... i dunno its quite frustrating. Thanks for the help |
#5
|
||||
|
||||
![]()
What *exactly* did you try and where, Skivey? We need the exact code and the template name.
|
#6
|
|||
|
|||
![]()
hi lynne
Im using my google adsense code and putting it in the HTML block I only want 'registered' members to see this block as my gold members have paid to remove adverts. Ive managed to do this for all of my forum except this. I used the above code and put the google code in between it If there isnt an easy way to do this, then ill just have to remove the block and put more adverts elsewhere... just would be good for the way the forum is laid out. http://forum.rsclassics360.co.uk - its the advert on the left hand side block 'Advert' Regards Matt --------------- Added [DATE]1350499765[/DATE] at [TIME]1350499765[/TIME] --------------- oh and template is darkvision ![]() Its quite editable I was hoping each block may have an 'id' so that i can put something in the blocks template? Thanks Matt |
#7
|
||||
|
||||
![]()
So is this an html block? Or a PHP block or what? You cannot use template code in a block - it is for templates only. If you want block code to not show to a usergroup, you would need to use a PHP block and use PHP code like:
PHP Code:
|
#8
|
|||
|
|||
![]()
So I have this in a PHP block but its showing not even a block for any membergroup. The idea is it only shows to normal registered members.
The code I put in was in a normal HTML block, but I understand it has to be in a php block now. Here is what I tried... but nothing yet PHP Code:
dunno why there are +'s there.. tey are spaces normally --------------- Added [DATE]1350510449[/DATE] at [TIME]1350510449[/TIME] --------------- its the speech brackets isnt it... think it messes it up.... |
#9
|
||||
|
||||
![]()
Use single quotes around the $my_output variable stuff (leave the double-quotes for the stuff inside).
|
#10
|
|||
|
|||
![]()
its bizarre, its still showing nothing.
Block is enabled, and the script is below. Im thinking im gonna put the adverts somewhere else. HTML Code:
if+(is_member_of(vB::$vbulletin->userinfo,+2))+{ $my_output+=+'<script type="text/javascript"><!-- google_ad_client = "ca-pub-2764312150803413"; /* sideblock */ google_ad_slot = "1598615235"; google_ad_width = 250; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>'; }+else+{ $my_output+=+'GOLD MEMBER'; } return+$my_output; |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|