MyBB Community Forums

Full Version: Pop Under Ads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok so im looking to be adding some pop under ads to my site, i want them to only work for guests, the code i have is like a <head> code, how would i make it so its only working for guests?

i have tried the following code but does not seem to be working:

<if $mybb->user['uid'] <= '1' then>
my code goes here
</if>



Any help would be greatly appreciated.
You can always install a mod : https://community.mybb.com/mods.php?action=view&pid=39
and set the permissions , this mod is great to play around for your needs ..
(2019-03-07, 11:33 AM)avixansa Wrote: [ -> ]You can always install a mod : https://community.mybb.com/mods.php?action=view&pid=39
and set the permissions , this mod is great to play around for your needs ..

Yeah this is a good idea, im sure i tried it before or maybe not.. i have been using this for years now...
You have a lot more flexibility in the templates if you install the PHP in Templates plugin.

Please note: some users have expressed concerns with the security of allowing PHP to be used in the templates but I have personally never had an issue.
You can simply do this using CSS.

<div class="ads ads_{$mybb->user['uid']}">
    <!-- dynamic ads code here -->
</div>

<style type="text/css">
    .ads:not(.ads_0){
        display: none;
    }
</style>