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
Need help after upgrading to v5
Avatar
Ingo
Member
Free Members
sp_UserOfflineSmall Offline
Mar 31, 2012 - 11:43 am

Thanks. I put it in a few lines before, after

sp_PostIndexUserSignature('tagClass=spPostUserSignature spCenter&maxHeightBottom=55');
                            sp_InsertBreak();

 

then it is directly at the bottom of the post (instead of between two posts), like it was before.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 31, 2012 - 12:22 pm

ah, so you want it in the first post and the last post...  bit different, but glad you figured it out! wink

Avatar
MartiL
Member
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2012 - 3:34 pm

Mr Papa said

so go to your sp theme and the template directory... edit the file spTopicView.php...  find this line of code:

                    sp_SectionEnd('', 'post');

after it, do something like:

if ($spThisPost->first_post_on_page || $spThisPost->last_post_on_page) {
    # my adsense code here
}

I'm starting to think I'm just to dumb to use SP cry

I've tried all the examples given in all the adsense topics, including this one (with and without php tags) and all I get is a fatal error ... confused

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 3, 2012 - 4:37 pm

Paste us your code and we can take a look. Most errors with this come down to mismatched quotes. If you can use the code button on the toolbar here to format it it will be better.

paste us the actual fatal error message as well.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2012 - 5:42 pm

MartiL said

I'm starting to think I'm just to dumb to use SP cry

I've tried all the examples given in all the adsense topics, including this one (with and without php tags) and all I get is a fatal error ... confused

 

Your adsense code probably looks something like this:

<script type="text/javascript"><!--
google_ad_client = "ca-pub-363700071xxxxxxx";
/* 468 */
google_ad_slot = "7759544xxxx";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.go

What you would do is echo it out like this.

echo '<script type="text/javascript"><!--
google_ad_client = "ca-pub-363700071xxxxxx";
/* 468 */
google_ad_slot = "7759544xxxx";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';

 

Make sure you use the ' single quote at the beginning and end and finish with the semicolon.

You could also create a function in your theme's spFunction.php file like this.

function spAdsense468() {
 echo '<center><script type="text/javascript"><!--
 google_ad_client = "ca-pub-3637000718xxxxx";
 /* 468 */
 google_ad_slot = "7759544xxxx";
 google_ad_width = 468;
 google_ad_height = 60;
 //-->
 </script>
 <script type="text/javascript"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
 </script></center>';
 }

 

Then wherever you want to place your 468x60 ad use

spAdsense468();

You can create several adsense functions for any size ad and include in your spFunctions file to make it easier too.

Create one called spAdsense728() for 728x90 sizes or spAdsenseText() for text ads, etc. Then just put the function that uses the ad you want to show into wherever you want it.

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: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626