Topic: Adding Ads on my forum header

Hi, I would add this code to my header:

<script type="text/javascript">
//<![CDATA[
document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=468X60/r='+new Date().getTime()+'"><\/s'+'cript>');
//]]>
</script>

This code shows an ad, and I want to see this ad on top of my forum page. More detailed... I would like to see it on top-right part (just to the right of the forum title and description)

Just like this image: http://im.altervista.org/cp/banner/bann … 468X60.png

How can I do it? Which file I should change and how?

Thanks, Bye!

Re: Adding Ads on my forum header

Seems like you have to edit the header.php file. Try to add the code above to $gen_elements['<!-- forum_desc -->'] or other element.

Re: Adding Ads on my forum header

Parpalak wrote:

Seems like you have to edit the header.php file. Try to add the code above to $gen_elements['<!-- forum_desc -->'] or other element.

I've added my code just after the line you've mentioned... then I've tried to load the page and this is what I receive:

Parse error: syntax error, unexpected '<' in /membri/rotfl/punbb/header.php  on line 172

I've no experience with PHP.

Re: Adding Ads on my forum header

You have to escape characters like ' by adding the backslash.

Try to add after that line:

$gen_elements['<!-- forum_desc -->'] .= '<script type="text/javascript">document.write(\'<s\'+\'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=468X60/r=\'+new Date().getTime()+\'"><\/s\'+\'cript>\');</script>';

Re: Adding Ads on my forum header

It works, very thanks!
But it shows the banner just below the forum description!

How can I move it to the right?

This is my forum: http://rotfl.altervista.org

Thanks

Re: Adding Ads on my forum header

I've just given you an idea smile

You can make a layout via CSS.

Try this:

$gen_elements['<!-- forum_title -->'] = '<div style="float: left;"><script type="text/javascript">document.write(\'<s\'+\'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=468X60/r=\'+new Date().getTime()+\'"><\/s\'+\'cript>\');</script></div>' . $gen_elements['<!-- forum_title -->'];

7 (edited by kr0n1x 2010-04-06 11:29)

Re: Adding Ads on my forum header

Parpalak wrote:

I've just given you an idea smile

You can make a layout via CSS.

Try this:

$gen_elements['<!-- forum_title -->'] = '<div style="float: left;"><script type="text/javascript">document.write(\'<s\'+\'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=468X60/r=\'+new Date().getTime()+\'"><\/s\'+\'cript>\');</script></div>' . $gen_elements['<!-- forum_title -->'];

oh yeah smile

I've changed "left" to "right" in your piece of code, and now my forum looks like I wanted  smile

Thank you Parpalak!

Bye

Re: Adding Ads on my forum header

Oh, sure, I meant "right" smile

You're welcome.