MyBB Community Forums
[How To?] Pop Under Ads - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] Pop Under Ads (/thread-222240.html)



Pop Under Ads - CPAhero - 2019-03-07

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.


RE: Pop Under Ads - avixansa - 2019-03-07

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 ..


RE: Pop Under Ads - CPAhero - 2019-03-07

(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...


RE: Pop Under Ads - Ben - 2019-03-07

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.


RE: Pop Under Ads - effone - 2019-03-07

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>