Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Best way to integrate advertisements?
Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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/

andy-signature.png
YELLOW
SWORDFISH
Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
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>';

}

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
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

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Cringe Channel
Member
Free Members
sp_UserOfflineSmall Offline
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?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
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.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625