[pmwiki-users] help with custom markup for adsense
Crisses
crisses at kinhost.org
Sun Nov 5 19:01:59 CST 2006
On Nov 4, 2006, at 11:33 PM, Brian wrote:
> Hello pmwiki-users,
>
> I tried to add custom markup for adsense but am getting a "Parse
> error: syntax error, unexpected T_STRING"
>
> Here is the code added to my local/config.php:
>
> Markup('adsense', 'directives',
> '/\\(:adsense:\\)/',
> Keep("<script type="text/javascript"><!--
> google_ad_client = "pub-";
> google_ad_width = 728;
> google_ad_height = 90;
> google_ad_format = "728x90_as";
> google_ad_type = "text";
> google_ad_channel = "";
> //--></script>
> <script type="text/javascript"
> src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
> </script>"));
>
>
> --
> Best regards,
> Brian
This worked for me:
//long google block markup
Markup('Google1', 'block',
'/\\(:Google1:\\)/e',
Keep("<script type='text/javascript'><!--
google_ad_client = 'pub-########';
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = '120x600_as';
google_ad_type = 'text_image';
google_ad_channel ='';
//--></script>
<script type='text/javascript'
src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script>"));
I first did a search-replace " to ' on the code given me by Google.
Then dropped it in the Keep("")
Note I did mine as a block markup, not a directive. Not sure it
makes a difference, but mine is working.
Crisses
More information about the pmwiki-users
mailing list