Adding some Javascript to entries

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
DortoH
Regular
Posts: 82
Joined: Fri Feb 25, 2005 2:00 am

Adding some Javascript to entries

Post by DortoH »

So i have figured out one half of what I want to do but need some guidance on the other.

I had two pieces of Java script in my blogger temple, on for analyzing visitor traffic and one to provide google ads.

I managed to get my visitor code on every page by editing the Layout.php

<div id="serendipity_banner">
code removed
</div>

My Javascript

<table id="mainpane">

That works great. Now what I would like to do is to place my Google Ads code somewhere (wherever that maybe) so the ads appear on all my entries. Putting the Google javascript into the body of the entry doesn't work (the code shows up in the page source). Maybe I need to place this code elsewhere? I have inserted it into the extended body of the entry, I view the page source and it is there, but it is not showing anything. Is it me or is it possibly Google :?:
Rod
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Adding some Javascript to entries

Post by garvinhicking »

Use a HTML nugget sidebar plugin, so the google ads will appear there.

Look at http://news.supersized.org/ for an example.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

I'm getting an error:

Code: Select all

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@[cut].com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.33 Server at [cut].com Port 80
when I place this code:

Code: Select all

<script type="text/javascript"><!--
google_ad_client = "[cut]";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel ="";
google_color_border = "B4D0DC";
google_color_bg = "ECF8FF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
in the edit screen of a html nugget sidebar. This also happens when I'm trying to insert the adsense code directly in the mysql database. What should I do?
DortoH
Regular
Posts: 82
Joined: Fri Feb 25, 2005 2:00 am

Post by DortoH »

I did get it to work on my sidebar by changing

Apply markup transformations to the text ......

to No on the HTML Nugget plugin.
Rod
Guest

Post by Guest »

Nope, keep getting some Internal Server Error. When I try to put this code in phpmyadmin manually, I get the same error. Kinda weird. "Normal" text can be saved, just this code is giving troubles.

I tried changing all doublequotes to singles but that didnt help either. Why can't the above javascript code be inserted into a TEXT field in MySQL?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Talk to your Administrator. They seem to be running mod_security which prevents execution of your site. You can only get it fixed by contacting your Admin.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply