Support Forum

Best way to integrate advertisements?

1 2 >
Cringe Channel
Member
Free Members
Nov 26, 2013 - 10:36 am

hello,

Anyone have any tips on the best wayo integrate ads? Maybe between people's posts?

I currently have one in the header above the forum,but I'm not sure it's getting much use.

Thoughts?

Thanks

Yellow Swordfish
Glinton, England
Member
Nov 26, 2013 - 10:47 am

The easiest is to place your code directly into the SP theme templates. That way you can put it wherever you want it and in as many places as you want.

Cringe Channel
Member
Free Members
Dec 10, 2013 - 3:44 pm

Yellow Swordfish said
The easiest is to place your code directly into the SP theme templates. That way you can put it wherever you want it and in as many places as you want.

 

Thanks. I don't know what I am doing. Can you tell me EXACTLY where to put my ad code so that it appears between the first post in the thread and the second post in the thread?

Thanks

Yellow Swordfish
Glinton, England
Member
Dec 10, 2013 - 4:25 pm

The article on our codex 'how to' FAQs describes exactly that actually:

http://codex.simple-press.com/.....the-forum/

Cringe Channel
Member
Free Members
Dec 11, 2013 - 10:15 am

Follow the instructions but got this error...

 

Parse error:  syntax error, unexpected T_STRING, expecting ',' or ';' in /problem-with-post-edit-buttonome/cringech/public_html/wp-content/sp-resources/forum-themes/mytheme/templates/spTopicView.php on line 199

 

This is what i integrated into my spTopicView.php

 

if($spTopicView->currentPost==1)

{echo '<div id='div-gpt-ad-1385134515547-2' style='width:728px; height:90px;'>

<script type='text/javascript'>

googletag.cmd.push(function() { googletag.display('div-gpt-ad-1385134515547-2'); });

</script>

</div>';

}

Yellow Swordfish
Glinton, England
Member
Dec 11, 2013 - 11:48 am

Well the first thing to correct is the fact that you placed the string to echo in single quotes. But the string itself contains single quotes so it has confused the interpreter.

use double quotes for the echo statement instead.

Cringe Channel
Member
Free Members
Dec 11, 2013 - 12:10 pm

That got rid of the error but still not working correctly. See this thread as an example

 

http://www.cringechannel.com/f.....t-loading/

 

you'll notice that there is a space in the proper place now, but the ad isn't showing up. How can I fix this?

Thanks

Yellow Swordfish
Glinton, England
Member
Dec 11, 2013 - 12:47 pm

I wouldn't really know. The script is there as it should be but it seems to be acting upon this CSS:

div[id^="div-gpt-ad-"] {
    -moz-binding: url("about:abp-elemhidehit?727251689742#dummy") !important;
}

which appears to cause it to not display. I think you need to talk to the ad supplier for more help as I can assure you the script is in place as you want it.

Or --- the script has also changed from being 'Javascript' to 'Rocketscript' which I believe is spmething to do with Cloudflare so perhaps that is having some impact?

Cringe Channel
Member
Free Members
Dec 11, 2013 - 2:13 pm

i dont really understand.. the ad script works perfectly everywhere else on the site.

Can you tell me what I should try next to fix this?

Yellow Swordfish
Glinton, England
Member
Dec 11, 2013 - 3:34 pm

As I already said - I have no real idea. TRhe script IS in place. Look - this is the source being generated fpr that area of the page:

...
<p>???????????????????</p>
</div>
</div>
<div class='spPluginSection spCenter' style='width: 100%; min-height: 40px;' style='width: 100%; min-height: 40px;'>
</div>
<div style='clear: both; height:1px;'></div>
<div id='spThanksList24033' class='spThanksList spInlineSection'></div><div style='clear: both; height:1px;'></div>
</div>
</div>
<div id='div-gpt-ad-1385134515547-2' style='width:728px; height:90px;'>
 <script type='text/rocketscript'>
 googletag.cmd.push(function() { googletag.display('div-gpt-ad-1385134515547-2'); });
 </script>
 </div><div class='spTopicPostSection spEven spType-Admin spRank-admin spSpecialRank-admin spUserPost' id='post24050'>
 ...

You can see your  script is in there plain and simple.

And this is the CSS beinbg generated for that section - I assume from somethign to do with this ad featire that you haver installed:

div[id^="div-gpt-ad-"] {
    -moz-binding: url("about:abp-elemhidehit?727251689742#dummy") !important;
}

Something is causing it to be invalid. I have no idea what though. I do not see anything that SP is doing that can in any way effect this. As you can see - it is in the generated code.

1 2 >