PDA


View Full Version : How to display banner ad on the main index?


trana
06-09-2005, 11:00 AM
I recently added a banner ad to my site. I placed the code into the navbar template, and it works, but it only shows on any page other than the cmps index. I would like to place this code so that it shows up everywhere. I think it has to do with where I placed it in the template, I guess inside a conditional. Can someone recommend the proper placement of this code so that it will display in the same place on EVERY page?

Thanks.

<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php?$session[sessionurl]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions</strong></div>
</if>
[B]<div align="right">
$mybanner</div>
</td>

<if condition="$bbuserinfo['userid']">

<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">
<!--<span style="float:$stylevar[right]">[<a href="login.php?$session[sessionurl]do=logout&amp;u=$bbuserinfo[userid]" onclick="return log_out()">$vbphrase[log_out]</a>]</span>-->
<strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
<phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>

Brian
06-09-2005, 12:25 PM
Admin CP => vBa CMPS => Default Settings => Portal Output Global Variables

Add 'mybanner' to that option.

trana
06-09-2005, 03:30 PM
Works like a charm.

One other question.

When I enabled the banner ad in my navbar, my shoutbox module suddenly started spitting out an error:

Table 'bannerads.adv_shoutbox' doesn't exist

Since the "bannerads" has nothing to do with the shoutbox, I'm a little confused as to where it is picking up that variable.

Any help would be appreciated.

Thanks.

trana
06-09-2005, 03:32 PM
Ack, I actually have another problem.

All of my pages display the banner in the navbar just fine, EXCEPT the VBA Links page. When that page is opened, the banner fails to display.

Brian
06-09-2005, 03:47 PM
bannerads is the database name, so it looks like you're banner program is causing a problem with the database info for your shoutbox.

For the links directory, look in your forum/includes/functions_links.php file for this code:
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox;


Replace with:
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox, $mybanner;

And that should do the trick.

trana
06-09-2005, 04:52 PM
Brian,

Thanks for the help with the links. I will apply that change this evening.

In regards to the shoutbox thing, do you have any idea what might be causing this? The only thing I can think of is a common variable or something global on the page that is changing the dbase name.

Both the shoutbox and bannerads were working fine before the bannerads code was added to the homepage. I think there is a crossover of information somewhere, but I'm not too sure where to start looking.

Thanks.