1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Placing an ad

Discussion in 'Styling and Customization Questions' started by gavpeds, Nov 27, 2013.

  1. gavpeds

    gavpeds Active Member

    Hi all so i have added an add unit to my forum. It displays how i want etc after i have had a play but what i would like to know is if i have done this the correct way or if i have just botched it!!

    So i am using the responsive adsense unit. I hunted the template for where i could put the code and found ad_above_content so put the code in there. Is that correct?

    I then found that because of my theme when the ad showed the full size it would overlap some of the forum content like the users online box on the right etc.
    So went into style properties and changed the page width controller under general from 980px to 1027px which fixed it.

    So my site http://windowcleaningforums.co.uk/ now seems to be showing the ad as i wish it to be displayed i guess i just want to know if i have done this the correct way or not. If not what is the correct way?
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. gavpeds

    gavpeds Active Member

    Great thanks so by reading that it seems i have implemented the ad correctly then.

    One question i would like to ensure is ok to do is i want to centre the ad above content so i have put it in a
    <div align="center">
    Is this ok? i mean will this break any adsense rules?

    The only problem i have noticed changing the width from 980px to 1028px to accommodate the ad is that in the conversation view it ads a few pixels to the grey of the conversation area which i would like to fix if anyone knows how?

    Attached Files:

    Last edited: Nov 27, 2013
  4. gavpeds

    gavpeds Active Member

    Hi so I have placed ads above content and bellow content. All seems fine on my personal 5in screen android phone but pick up my smaller work iphone5 and the ads are going off the right creating a horizontal scroll bar. It is only by a few pixels but annoying non the less. How can I fix this?
  5. Brogan

    Brogan XenForo Moderator Staff Member

    You will need to use smaller ad units.

    I don't know what the width of the iPhone is but the ad unit must be small enough to allow for any padding and margins.
  6. gavpeds

    gavpeds Active Member

    Hi ok so it seems adding this line
    @media(min-width: 320px) { .above-content-ad-wcf { width: 234px; height: 60px; } }
    to the google standard code works.

    So now i have this
    .above-content-ad-wcf { width: 320px; height: 50px; }
    @media(min-width: 320px) { .above-content-ad-wcf { width: 234px; height: 60px; } }
    @media(min-width: 500px) { .above-content-ad-wcf { width: 468px; height: 60px; } }
    @media(min-width: 800px) { .above-content-ad-wcf { width: 728px; height: 90px; } }
  7. gavpeds

    gavpeds Active Member

    One more question i promise!

    So i have used <xen:if is="!{xen:helper ismemberof, $visitor, 6,4}"> in these ads so that Moderators and premium members do not see the ads.

    Problem is adding the mod group id it means i also don't see them even though i am admin so presume something to do with permissions. I would like to see them just to keep an eye on them etc really.

    How can i fix this.

    Thanks again so much for your help. (y)
  8. Brogan

    Brogan XenForo Moderator Staff Member

    You have a few options: remove yourself from the moderating user group, create a new instance targeted at your user ID only, use another (logged out) browser session.
  9. gavpeds

    gavpeds Active Member

    If i remove myself from the mod user group i presume as i am admin i will not loose mod abilities?
  10. Brogan

    Brogan XenForo Moderator Staff Member

    User groups do no determine moderator status, that is done by explicitly setting a user to be a moderator.
    Regardless of whether you are an administrator or not.

    What you will lose are any permissions which are set in the moderating user group.

    You can assign those moderator permissions directly at the user level if necessary.
  11. gavpeds

    gavpeds Active Member

    Ok thanks

Share This Page