1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Sidebar Advertisements

Discussion in 'Template Modifications [Archive]' started by FredC, Feb 15, 2011.

  1. FredC

    FredC Well-Known Member

    Im sure there is a easier way to do this, but im no coder and just made this on the fly.. therefore support will be limited to my basic understanding..
    This hack is simply html and tables. You will have to edit the image name for your advertisers.

    • upload contents of the upload folder to your xenforo root
    • Appearance / Templates / Create New Template..
    • Template Name: advertisements
    -------------------------------------------------------------------
    add:

    <div class="section">
    <div class="secondaryContent">
    <h3>Advertisements</h3>
    <table border="1" cellpadding="1" cellspacing="1" style="height: 230px; width: 230px;">
    <tbody>
    <tr>
    <td style="text-align: center;">
    <a href="http://your_advertisers_url.com" target="_blank"><img alt="" src="http://your-site.com/styles/default/xenforo/advertisements/advertise.jpg" /></a></td>
    <td style="text-align: center;">
    <a href="http://your_advertisers_url.com" target="_blank"><img alt="" src="http://your-site.com/styles/default/xenforo/advertisements/advertise.jpg" /></a></td>
    </tr>
    <tr>
    <td style="text-align: center;">
    <a href="http://your_advertisers_url.com" target="_blank"><img alt="" src="http://your-site.com/styles/default/xenforo/advertisements/advertise.jpg" /></a></td>
    <td style="text-align: center;">
    <a href="http://your_advertisers_url.com" target="_blank"><img alt="" src="http://your-site.com/styles/default/xenforo/advertisements/advertise.jpg" /></a></td>
    </tr>
    </tbody>
    </table>
    <br /> </div>
    </div>

    ------------------------------------------------------------------
    • Open forum_list template and add..
    HTML:
            <xen:include template="advertisements" />

    Screen Shot
    Capture_02132011_134727.jpg
    The images are 115 x 115px and will need to be added as you ad actual advertisements, as well as the names of the new images in the file path.

    Hopefully i haven't forgot anything. ;)

    Change Log:
    V1.00 released 2-15-2011
     

    Attached Files:

  2. Floris

    Floris Guest

    Very nice, just a shame it's using tables :/ Could those perhaps become <div>
     
    Michael Dance and fattony69 like this.
  3. gmaister22

    gmaister22 Active Member

    Great!!!!
     
  4. Crazyfruitbat

    Crazyfruitbat Well-Known Member

    Thanks for this - all set up on my homepage to put my amazon links in
     
    FredC likes this.
  5. Michael Dance

    Michael Dance Active Member


    If you would like to use DIVS, i have customed this to DIVS, so its easier for myself to use and edit however its not fully suited for everyone so you may have to edit the CSS.

    Do the same as the above which VonDoom did with the files uploaded etc.

    In the Advertisement template paste in:
    HTML:
    <div class="section">
    <div class="secondaryContent">
    <h3>Advertisements</h3>
    <div id="advertbox">
    <a href="http://your_advertisers_url.com" target="_blank"><div id="advert"></div></a>
    <a href="http://your_advertisers_url.com" target="_blank"><div id="advert2"></div></a>
    </div>
    
    <div id="advertbox">
    <a href="http://your_advertisers_url.com" target="_blank"><div id="advert"></div></a>
    <a href="http://your_advertisers_url.com" target="_blank"><div id="advert2"></div></a>
    </div>
    <br />
    <div id="link">Click <a href="http://wwepower.com/forum/pages/advertise/">here</a> to advertise.</div>
    </div></div>
    Then open Extra.css paste in the following:
    PHP:
    #advertbox{
    width240px;
    height118px;
    }

    #advert{
    backgroundurl(http://wwepower.com/forum/ads/advertisehere.png);
    width115px;
    height115px;
    floatleft;
    }
    #advert2{
    backgroundurl(http://wwepower.com/forum/ads/advertisehere.png);
    width115px;
    height115px;
    floatleft;
    }
    #link{
    width150px;
    margin-leftauto;
    margin-rightauto;
    }
    and its completed:
    [​IMG]

    To add more adverts copy a advert div and say call it advert3

    then on the advert template where you want it put advert3.
     
    clawsonr and FredC like this.
  6. clawsonr

    clawsonr Member

    Thanks Michael, yours worked for me! Novice friendly I guess :)
     
    Michael Dance likes this.
  7. Michael Dance

    Michael Dance Active Member

    glad to help mate, i love helping the community who help me :D
     
  8. Garamond

    Garamond Well-Known Member

    There really should be an add-on for this, so we don't have to do the template modification after every forum update.
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    Use the ad_sidebar templates.

    No reverting required after an upgrade then.
     
    Garamond likes this.
  10. Garamond

    Garamond Well-Known Member

    What does it mean when I get the message "Templates in this style can not be modified. Please try another." ? This when trying to use the ad_sidebar templates.
     

Share This Page