Can't Get Ad Code to Work

Started by gamer12, December 01, 2010, 08:03:29 PM

Previous topic - Next topic

gamer12

<script type="text/javascript">
if(typeof(cachebuster) == "undefined"){var cachebuster = Math.floor(Math.random()*10000000000)}
if(typeof(dcopt) == "undefined"){var dcopt = "dcopt=ist;"} else {var dcopt = ""}
if(typeof(tile) == "undefined"){var tile = 1} else {tile++}
document.write('<scr'+'ipt src="http://ad.doubleclick.net/adj/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;' + dcopt + ';tile=' + tile + ';sz=728x90;ord=' + cachebuster + '?"></scr'+'ipt>');
</script>
<noscript><a href="http://ad.doubleclick.net/jump/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" target="_blank" ><img src="http://ad.doubleclick.net/ad/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" border="0" alt="" /></a></noscript>


Results in a
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /.../index.template.php on line 638

IceXaos

echo '
	
<script type="text/javascript">
	
	
if(typeof(cachebuster) == "undefined"){var cachebuster = Math.floor(Math.random()*10000000000)}
	
	
if(typeof(dcopt) == "undefined"){var dcopt = "dcopt=ist;"} else {var dcopt = ""}
	
	
if(typeof(tile) == "undefined"){var tile = 1} else {tile++}
	
	
document.write(\'<scr\'+\'ipt src="http://ad.doubleclick.net/adj/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;\' + dcopt + \';tile=\' + tile + \';sz=728x90;ord=\' + cachebuster + \'?"></scr\'+\'ipt>\');
	
</script>
	
<noscript><a href="http://ad.doubleclick.net/jump/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" target="_blank" ><img src="http://ad.doubleclick.net/ad/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" border="0" alt="" /></a></noscript>'
;

Matthew K.

Quote from: IceXaos on December 01, 2010, 09:27:33 PM
echo '
<script type="text/javascript">
if(typeof(cachebuster) == "undefined"){var cachebuster = Math.floor(Math.random()*10000000000)}
if(typeof(dcopt) == "undefined"){var dcopt = "dcopt=ist;"} else {var dcopt = ""}
if(typeof(tile) == "undefined"){var tile = 1} else {tile++}
document.write(\'<scr\'+\'ipt src="http://ad.doubleclick.net/adj/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;\' + dcopt + \';tile=\' + tile + \';sz=728x90;ord=\' + cachebuster + \'?"></scr\'+\'ipt>\');
</script>
<noscript><a href="http://ad.doubleclick.net/jump/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" target="_blank" ><img src="http://ad.doubleclick.net/ad/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" border="0" alt="" /></a></noscript>';

is much easier to read.

Topic Starter - That should work for you. If it does, feel free to mark the topic as resolved.

IceXaos

Quote from: Labradoodle-360 on December 01, 2010, 10:15:16 PM
Quote from: IceXaos on December 01, 2010, 09:27:33 PM
echo '
<script type="text/javascript">
if(typeof(cachebuster) == "undefined"){var cachebuster = Math.floor(Math.random()*10000000000)}
if(typeof(dcopt) == "undefined"){var dcopt = "dcopt=ist;"} else {var dcopt = ""}
if(typeof(tile) == "undefined"){var tile = 1} else {tile++}
document.write(\'<scr\'+\'ipt src="http://ad.doubleclick.net/adj/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;\' + dcopt + \';tile=\' + tile + \';sz=728x90;ord=\' + cachebuster + \'?"></scr\'+\'ipt>\');
</script>
<noscript><a href="http://ad.doubleclick.net/jump/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" target="_blank" ><img src="http://ad.doubleclick.net/ad/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" border="0" alt="" /></a></noscript>';

is much easier to read.

Topic Starter - That should work for you. If it does, feel free to mark the topic as resolved.
Awe, but PHP tags colorize. :P

Matthew K.

// Off Topic. It would be neat to have a PHP Code Block :P
* Labradoodle-360 goes to look on mod site to see if there is already one written.
Quote from: IceXaos on December 01, 2010, 10:16:44 PM
Quote from: Labradoodle-360 on December 01, 2010, 10:15:16 PM
Quote from: IceXaos on December 01, 2010, 09:27:33 PM
echo '
<script type="text/javascript">
if(typeof(cachebuster) == "undefined"){var cachebuster = Math.floor(Math.random()*10000000000)}
if(typeof(dcopt) == "undefined"){var dcopt = "dcopt=ist;"} else {var dcopt = ""}
if(typeof(tile) == "undefined"){var tile = 1} else {tile++}
document.write(\'<scr\'+\'ipt src="http://ad.doubleclick.net/adj/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;\' + dcopt + \';tile=\' + tile + \';sz=728x90;ord=\' + cachebuster + \'?"></scr\'+\'ipt>\');
</script>
<noscript><a href="http://ad.doubleclick.net/jump/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" target="_blank" ><img src="http://ad.doubleclick.net/ad/ohn.ultimatebass/fishing_forum;type=bass_fishing;pos=atf_4;sz=728x90;ord=123456789?" border="0" alt="" /></a></noscript>';

is much easier to read.

Topic Starter - That should work for you. If it does, feel free to mark the topic as resolved.
Awe, but PHP tags colorize. :P
[/quote]

IceXaos

It pretty much is already.  You just have to add the PHP tags to it.

<?php

foreach($users as $user) {
  echo 
"$user<br />\n";
}

?>

Aleksi "Lex" Kilpinen

Marked as solved, as the solution is there and the OP hasn't responded in a while.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: