MyBB Community Forums

Full Version: Hide ads for premium members.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
To use that code that was posted above in the templates you must have the PHP in Templates and Template Conditionals plug in installed:

http://community.mybboard.net/thread-31860.html
I have the Template Conditionals Installed.

This code is right?
<if $mybb->usergroup['cancp'] != 9>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tbody>
<tr>
<td class="trow2" align="center">
To remove the ads <a href="http://mysite.com/forum/subscribe.php" target="_blank">click here</a>.
<br />
<img src="http://mysite.com/forum/images/MyAds/vf3.png" />
</td>
</tr>
</tbody>
</table>
</if>
Try this:

Only one group:

<if $GLOBALS['mybb']->user['usergroup'] == x then>
Ads code here
</if>

The code above will display the ads only for members in usergroup x.

More than one usergroup:

<if in_array($GLOBALS['mybb']->user['usergroup'], array(a,b,c,d,e,f)) then>
Ads code here
</if>

The code above will display the ads only for members in usergroup a,b,c,d and f.
Do I need to put it like this:
<?php 
<if in_array($GLOBALS['mybb']->user['usergroup'], array(a,b,c,d,e,f)) then>
Ads code here
</if>
?>

With the <?php and ?>??
http://community.mybboard.net/thread-31860.html
No, you don't need to put the php tag (<?php ?>).
(2010-01-12, 05:27 PM)RateU Wrote: [ -> ]No, you don't need to put the php tag (<?php ?>).
Thank you. I used the second one.
Pages: 1 2