Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Advertising banner in single category??

Quote Reply
Advertising banner in single category??
Is there a way to add an advertising banner in a single category? We want to sell sponsorships for each section of category and have just the sponsors banner show up when a user is reading that category or section of the Forum.

Richard

Richard Bilger
RBilger@MERGINET.com
MERGINET.com: Emergency Responders Web Site
http://www.merginet.com
Quote Reply
Re: [RBilger] Advertising banner in single category?? In reply to
I have done something similar. Using if -> then statements, you can display a banner in the forum using forum_ID. You can get the forum ID number from FORUMS > LIST ALL > DETAILS (for the specific forum)

I think this should work if you insert it into TEMPLATES > USERS TEMPLATES > forum_view.html just under :

<%endloop%>
<%endif%>
<%/body_font%>
</td>
<td>
<%include include_logo.html%>
</td>
</tr>

at the top of that template.




<%if forum_id >= 1><tr>

<td colspan="3">
<center>
<img src="http://www.yoursite.com/ads/ad1.jpg">
</center>
</td>
</tr>
<%endif%>



best of luck to you. I went a step further to make mine work and it was probably more difficult than it was worth. I went to TOOLS > TABLE EDITOR > FORUMS and added a column for some value and gave the one forum that I wanted the special graphic in a 1 value - so my if statement did not have an equal in it - it reads:

<%if team%>

essentially meaning if that forum has a value of 1 in the column named team, it would do the sub routine to add that graphic - the other forums have a 0 in that field. But if you were to have people sponsor different forums, the easiest way would be to utilize the code above so that you could do multiple forums with different sponsors. for instance:




<%if forum_id >= 1><tr>

<td colspan="3">
<center>
<img src="http://www.yoursite.com/ads/ad1.jpg">
</center>
</td>
</tr>
<%endif%>


<%if forum_id >= 2><tr>

<td colspan="3">
<center>
<img src="http://www.yoursite.com/ads/ad2.jpg">
</center>
</td>
</tr>
<%endif%>


<%if forum_id >= 3><tr>

<td colspan="3">
<center>
<img src="http://www.yoursite.com/ads/ad3.jpg">
</center>
</td>
</tr>
<%endif%>
Quote Reply
Re: [shiner] Advertising banner in single category?? In reply to
I tried following what you said and made the changes. It stopped the page from loading. Only the top portion of the page loaded above the new code. Something in the code stopped the page load from that point. Here's what my code looked like:

Code:
<%endloop%>
<%endif%>
<%/body_font%>
</td>
<td>
<%include include_logo.html%>
</td>
</tr>
<%if forum_id >= 10><tr> <td colspan="3">
<center>
<img src="http://www.merginet.com/...nner/pwwlogo260t.gif">
</center>
</td>
</tr>
<%endif%>

<%if forum_total%>


I also tried to replace the forum logo which would be ideal by using:

Code:
<%endloop%>
<%endif%>
<%/body_font%>
</td>
<td>

<%if forum_id >= 10>

<img src="http://www.merginet.com/...nner/pwwlogo260t.gif">

<%else>

<%include include_logo.html%>

<%endif%>


This only resulted in there being no logo in Forum 10 but it allowed the rendering of the whole page.

Any ideas what I might be doing wrong?

Richard

Richard Bilger
RBilger@MERGINET.com
MERGINET.com: Emergency Responders Web Site
http://www.merginet.com
Quote Reply
Re: [RBilger] Advertising banner in single category?? In reply to
I will try to look at it later, but for now - try removing the extra >

<%if forum_id >= 10>

may need to read

<%if forum_id = 10>

>= may be read as greater than or equal to.
Quote Reply
Re: [shiner] Advertising banner in single category?? In reply to
I found the problem. You forgot to add a % symbol in the IF tag. It should have read <%if forum_id = 10%>. So I changed it to include and <%else%> tag to replce the forum logo if the forum_id doesn't equal 10. This is now what I have and it seems to work fine. I'll play with it a bit to see how I can make it easier to work with for all of the forums and potential sponsors.

Code:
<td>
<%if forum_id = 10%>
<img src="http://www.merginet.com/images/banner/logo.gif">
<%else%>
<%include include_logo.html%>
<%endif%>
</td>


Thanks for your help with this.

Richard Bilger
RBilger@MERGINET.com
MERGINET.com: Emergency Responders Web Site
http://www.merginet.com

Last edited by:

RBilger: Dec 9, 2002, 10:57 AM