Recent Topics

1 Oct 27, 2009 22:02    

My b2evolution Version: 3.3.1

I'm running b2evoltuion 3.3.1 released on 08/07/09 @ http://carymathews.info/

I'm trying to set up a single post footer to display a google adsense unit when visitors view single blog pots.

The unit code is simply two html script tags with several attributes:


<script type="text/javascript"><!--
google_ad_client = "pub-7674017125039322";
/* Single post page */
google_ad_slot = "1150796987";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

I've turned off javascript checking in the user config to permit the posting of javascript (an error was being thrown).

I can copy-and-paste the unit code into the single post footer textarea box and save the configuration. When I navigate away from the Advanced tab and back again, the code has become truncated:


<script type="text/javascript"><!--
google_ad_client = "pub-7674017125039322";
/* Single post page */
google_ad_slot = "1150796987";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.

Simpler html works, like:


<p>hi</p>

"Complex" code gets truncated:


<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


to


<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

Obviously, without the full URL and closing script tag, this adsense unit does not display correctly, nor does the single post page.

Under the group configuration, I've unchecked (turned off) "Prevent CSS tweaks", "Prevent iframes", and "Prevent objects" in an attempt to trouble shoot this. That did not work either.

I've tried commenting out the call to balance_tags() inside check_html_sanity() within inc/_core/_param.funcs.php, but that did not work.

I'm trying to make my way through the code, to see where the html might get truncated, but in the meantime, I'll post this here for any pointers anyone wants to share. I suspect this may be a bug, but until I can post code to fix it, I'll just assume I'm doing something bone-headed!

Edit: fix typo in html; additional troubleshooting.

2 Oct 27, 2009 23:46

Found it!

the database field which stores this data is type VARCHAR(255). the data I'm trying to put into it is longer than 255 characters, hence the truncation.

I'll muck around with mysql to see if I can increase the VARCHAR value to something which I can store the entire adsense unit code into.

Hope this helps someone else.

3 Oct 28, 2009 05:50

Just change it to "text". You probably have to edit one of the view files in /inc/collections/views/ to remove the 255 chars limit


Form is loading...