In which file is the tag "BODY ONLOAD" located?

When I paste a code with the tag -

<body onload="">

in a HTML block and the saves it, the tag is gone after saving it.

 

I have search for it in a lot of files, but I can't find it.

 

Anyone who knows where it is?

Quote · 30 Sep 2009

This is one of the tags stipped by TinyMCE via safehtml

In D6: plugins/safehtml/safehtml.php

var $deleteTags = array(
'applet', 'base',   'basefont', 'bgsound', 'blink',  'body',
'embed',  'frame',  'frameset', 'head',    'html',   'ilayer',
'iframe', 'layer',  'link',     'meta',    'object', 'style',
'title',  'script',
);


If you delete this tag from safehtml.php, you'll be able to use it...... BUT so will everyone else.  So... not a good solution, and probably not much help to you.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 30 Sep 2009

Ok, I got it.

 

Then it is impossible to use any Google Earth map with some extra stuff.

 

Thank's

Quote · 30 Sep 2009

Not necessarily.  D6 would need some modification to allow all html tags by the admin, while still stripping the tags for regular site members.

I've never tried it, but you can probably create a separate safehtml.php file that allows every html tag, to replace the standard one, so that your code remains intact when you save the html block.  Then after the html block is saved, change the safehtml.php file back to the original version.

Edit: Nope.. doesn't work.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 1 Oct 2009

 

Not necessarily.  D6 would need some modification to allow all html tags by the admin, while still stripping the tags for regular site members.

I've never tried it, but you can probably create a separate safehtml.php file that allows every html tag, to replace the standard one, so that your code remains intact when you save the html block.  Then after the html block is saved, change the safehtml.php file back to the original version.

Edit: Nope.. doesn't work.

 Just throwing out an idea here.  What if we used a 2nd safe.html file, either in the admin directory or right next to the first one and then an if $ownerAdmin true function it allows the extra tags, if $ownerMember true then it doesn't.

 

I don't have the full function, but that might be the way to go here on this one.

Quote · 1 Oct 2009

RE: Just throwing out an idea here.  What if we used a 2nd safe.html file, either in the admin directory or right next to the first one and then an if $ownerAdmin true function it allows the extra tags, if $ownerMember true then it doesn't.

I don't have the full function, but that might be the way to go here on this one.

Don't know.   I've been messing with this one for a while.  I can't even get the google map code to work when I paste it directly into the database.  All I get is "The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false"."


I, of course had the sensor bit properly set in the code.  The very same code works in a stand-alone html file.  I can also put the map in a php block by including that html file:

include 'map.html';

Where map.html =

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(29.752, -95.358);
var myOptions = {
zoom: 10,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}

</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:400px"></div>
</body>
</html>

I even tried putting the code between the header tags in _header.html and the rest in the database, and I still got the same error. 

Now of course, the php block only displays the map in FF... blank box in IE7... go figure.  I quit.  My head hurts.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 1 Oct 2009

Nah.. Work your head a little more, your close on this...

 

Just out of curiosity again.. Just because I'm curious check out the admin/JsHttpRequest/JsHttpRequest.php file.  There's some interesting stuff sitting in that thing, might guide you to the final solutin here.  Especially since it appears to allow different js for Admin than it does the members.

Quote · 1 Oct 2009

Naw... somebody that actually knows what they're doing can work on it.  It's not a total loss. At least now I have a page with a full screen map of Houston I can look at.  I don't have the files you refer to in my D6 installation.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 1 Oct 2009

 

Naw... somebody that actually knows what they're doing can work on it.  It's not a total loss. At least now I have a page with a full screen map of Houston I can look at.

 That really was your goal the whole time wasn't it Houston... ROFLMAO

Quote · 1 Oct 2009

Now I'm confused.  I couldn't get Google map code to work in an html block, but the Google Earth code below works just fine... If I first create an html block on a page in page builder, then edit it's contents in the PageCompose table.  Too bad I keep getting a strange error when I try to install the Google Earth plugin on my computer>  Windows is  a POS some times!

So.... CampethoMedia, I don't know if this helps you, but if you place a new html block on a dolphin page, then go into phpmyadmin, and find the record in the PageCompose table for the block you created, you can replace the content with your code and save it.  It seems to work.

<html>
<head>
<title>Sample</title>
<script src="http://www.google.com/jsapi?key=Your_own_API_key_goes_here"> </script>
<script type="text/javascript">
var ge;
google.load("earth", "1");

function init() {
google.earth.createInstance('map3d', initCB, failureCB);
}

function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
}

function failureCB(errorCode) {
}

google.setOnLoadCallback(init);
</script>

</head>
<body>
<div id="map3d" style="height: 400px; width: 100%;"></div>
</body>
</html>

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 1 Oct 2009

I have tested a lot of Google maps who displays fine in a html block. The thing is that I want to embed a Google Earth map who has some kind of button, (like the original 'Dusk to Dawn').

 

When such a map is embeded the block with the map only shows 'Loading...'

 

I have discused it with a 'Google Earth Guru' who briefly surveyed my site, and the he told my that the

<body onload="init"> is not caled.

Quote · 1 Oct 2009

RE: I have tested a lot of Google maps who displays fine in a html block. The thing is that I want to embed a Google Earth map who has some kind of button, (like the original 'Dusk to Dawn').

When such a map is embeded the block with the map only shows 'Loading...'

I have discused it with a 'Google Earth Guru' who briefly surveyed my site, and the he told my that the

<body onload="init"> is not caled.

If you enter the code in page builder, certain tags are going to be stripped, and I couldn find an easy way to bypass the tag stripping.  That's why I suggested entering your html code directly into the database.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 2 Oct 2009

So, if the map is embeded on homepage, where in the database do you belive the <body onload="int"> should be injected?

Quote · 3 Oct 2009

So, if the map is embeded on homepage, where in the database do you belive the <body onload="int"> should be injected?

If you are using cpanel, use phpmyadmin to open your Dolphin database, then browse through the PageCompose table.  You should should see the record for the html block you created.  Just edit that record, replace the cocntents of the field that holds the existing code and save it.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 3 Oct 2009

I saved the Google Earth code with the <body onload="init"> in phpMyAdmin and I can see the code is there after saving it, but the <body onload="init"> code is not included in the HTML block.

Quote · 3 Oct 2009

If it is stored correctly in the DB, then you might have to delete the files in the /cache directory (except for .htaccess)  You may even have to clear your browser's cache.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 3 Oct 2009

I removed the tags 'body' & 'style' from safehtml.php and after that I saved the Google code from phpMyAdmin.

I also tested to save it directly from the HTML block.

But, there is always something else who removes the line -

 

<body onload="init()" style="font-family: arial, sans-serif; font-size: 13px; border: 0;">

from the HTML block.

So what's the trick?

Quote · 4 Oct 2009

RE: I saved the Google Earth code with the <body onload="init"> in phpMyAdmin and I can see the code is there after saving it, but the <body onload="init"> code is not included in the HTML block.

If the code is there when you save it directly in the database, then it WILL be in the HTML block..... unless, of course, you open the HTML block in page puilder and save it.... Then the tags would be stripped again. 

Stay away from looking at the block in page builder.  If you store the code this way in the DB, I don't see anyway it can be altered, other than through the page builder interface..... unless there are some evil forces at work here that I am not aware of.  If the code does not show up in the page source, then I think you must be viewing a cached version.  Did you delete the file in the /cache directory, and clear the browser?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 5 Oct 2009

There must be a 'ghosteraser' somewhere else

 

Ok, the cache is clear and in safehtml.php 'body' & 'style' has been removed.

 

Code segment looks like this in phpMyAdmin after saving -

 

{ document.getElementById('sample-ui').innerHTML += html; }
// --></script>
</head>

<body onload="init()" style="font-family: arial, sans-serif; font-size: 13px; border: 0;">
<div align="center"> .......

 

Code segment looks like this in HTML Block after saving in phpMyAdmin -

 

{ document.getElementById('sample-ui').innerHTML += html; }
// --></script>
</p>
<div align="center"> .......

 

It must be the 'bodysnatchers'

Quote · 5 Oct 2009

Can you post the code you are using, or send it to me via PM?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 5 Oct 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.