• 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

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

Attachments


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{
width: 240px;
height: 118px;
}

#advert{
background: url(http://wwepower.com/forum/ads/advertisehere.png);
width: 115px;
height: 115px;
float: left;
}
#advert2{
background: url(http://wwepower.com/forum/ads/advertisehere.png);
width: 115px;
height: 115px;
float: left;
}
#link{
width: 150px;
margin-left: auto;
margin-right: auto;
}

and its completed:
advert.PNG


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

then on the advert template where you want it put advert3.
 
There really should be an add-on for this, so we don't have to do the template modification after every forum update.
 
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.
 
Top Bottom