Jump to content


Photo

iBlogPro 5 Vanilla Forums Theme issue with Google AdSense


  • Please log in to reply
7 replies to this topic

#1 icatcher

icatcher

    Newbie

  • Members
  • 4 posts

Posted 07 March 2012 - 12:46 PM

Hi everyone


I'm trying to implement the Vanilla Forum and found a bug I couldn't fix myself with the iBlogPro 5 Vanilla Forums Theme. I've implemented a Google AdSense Leaderboard Ad into the branding section of iBlogPro 5 / Pagelines itself and now with the Vanilla Theme activated, the Ad shows up twice but only on the forum pages. Here are as much information as possible, to support you finding the issue, so I or eveb the theme creator can fix it:

a) My iBlogPro 5 Setup:

- Pagelines v. 2.1.1
- iBlogPro v.5.1.1
- Vanilla Forum v.2.0.18.3
- Website without issue: icatcher.com
- Vanilla Forum with issue: icatcher.com/forum

B) My Google AdSense Implementation:

I've changed the code in pagelines -> sections -> branding -> section.php like this:

[...]
function section_template() {
printf('

');
printf('
');
echo adrotate_group(1);
printf('
');
pagelines_main_logo();
[...]


I've already tried to implement the Google AdSense code directly (without the AdRotate Plugin) and with the method described in your support forum (http://www.pagelines...l-icons-move/p1) but the result is the same. Therefore I assume that there is something wrong with the Vanilla Forum Theme for iBlogPro 5 and not with the iBlogPro 5 Theme itself.

Many thanks in advance for all your help!

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 07 March 2012 - 07:50 PM

I am trying to look at your site via the link provided and I'm getting: "Fehler beim Aufbau einer Datenbankverbindung". Please fix the error and provide a working link for us to provide support.

#3 icatcher

icatcher

    Newbie

  • Members
  • 4 posts

Posted 08 March 2012 - 07:30 AM

@rangelone: I tried to access both URLs from different computers, mobile devices and browsers, both links are working correctly, please try again.

#4 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 08 March 2012 - 04:51 PM

Heres the solution.

1) NEVER edit core framework files.
2) Open wp-content/plugins/pagelines-customize/functions.php add:
 add_action( 'pagelines_before_branding', 'my_adsense_code' );
	
	function my_adsense_code() {
	
		printf( '<div class="iad">%s</div>', adrotate_group(1) );
	}

3) Open the pagelines vanilla theme folder and look for default.master.php look for
 
	// Integration - PageLines Head - js
	echo plhead['js'];
Replace with:
 
	// Integration - PageLines Head - js
	preg_match( '#((<[s/]*scriptb[^>]*>)([^>]*)(</script>))#', $plhead['js'], $js );
	echo implode( $js, "n" );


#5 icatcher

icatcher

    Newbie

  • Members
  • 4 posts

Posted 08 March 2012 - 07:09 PM

@Simon: 3) indeed corrected the issue, but if I implement 2) and remove the changes I did in the core framework then the banner gets displayed twice on the website. Therefore I'm using 3) with my core framework change. If you can provide me with a solution on how to implement 2) without the banner appearing twice, I'll never touch the core framework again ;)

#6 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 08 March 2012 - 07:43 PM

2 and 3 are supposed to be used together, i tested with standard branding enabled.

#7 icatcher

icatcher

    Newbie

  • Members
  • 4 posts

Posted 09 March 2012 - 07:53 AM

@Simon: I meant that for me 1+3 works but 2+3 doesn't work, when I use the pagelines customize plugin, then the banner appears twice (even though I removed the code I've changed in the core framework). This was also the reason why I used to modify the core files in the first place, because the customize plugin couldn't do the trick.

#8 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 09 March 2012 - 12:20 PM

The method with the action does work, pagelines-customize plugin has to be active. http://screencast.com/t/avbOj7Ntoop Thats with the action code in customize plugin, with it active and that regex code in the vanilla template.