Hello, in my forum I want to make ads (Google Adsense) shown only to guests, I don't want members (or a certain usergroup) to see ads, how can I do that?
simple method is to use
template conditionals plugin & add required advt codes with related condition
<if $mybb->user['uid'] == 0 then>
// advt codes
</if>
or if you want your ads to show on your header you can add your ads at
ACP >>Templates & Style>>Templates>>Header Templates>>header_welcomeblock_guest
(2020-03-05, 07:27 AM).m. Wrote: [ -> ]simple method is to use template conditionals plugin & add required advt codes with related condition
<if $mybb->user['uid'] == 0 then>
// advt codes
</if>
Why is it 0? Isn't guest id is 1?
your right, change it to 1
guests user group is
1 ;
user id for
guest is
0
if you want to use
usergroup in the condition then code can be like below
<if $mybb->user['usergroup'] == 1 then>
// advt codes
</if>
@.m how can we use that code to add more than 1 group
^ can be like this (note:
x,
y,
z are usergroup numbers)
<if in_array($mybb->user['usergroup'], array('x', 'y', 'z')) then>
// advt codes
</if>