I am declaring this blog obsolete. This does NOT mean the code does not work. It does mean that I am no longer continuing to test it, or maintain it. I do plan to update my other blog, mostly with 2.0 stuff, but will maintain some 1.0 stuff (mostly for the artist pages). I also plan to update the below index to point to relevant updated content, soon. INDEX to My Other Myspace Code Stuff

Friday, May 18, 2007

Ad banner Hidden, Vanishing Ad Banner

The Vanishing Ad Banner

If your ad banner is hidden, and you did not intentionally install code to hide it, your page may have fallen victim to what I call "The Vanishing Ad Banner".
(If you don't care much about the reason it is hidden, and just want to unhide it, scroll down.)

The symptom behaves as follows:
- The ad may start to show up, and go away as the page paints
- If you turn off style, pieces of the ad can be seen in the small box off to the left.
- In some cases the ad is always hidden, in others it is hidden only some of the time (yesterday my tests showed only about 25%, but other days it is as much as 50%)

There is code being given out (on multiple web pages and in the myspace discussion forum), to hide the bottom links, which is hiding the advertisements.
Some versions of the code only hid about the half the ads prior to a change made in early June, but now hide All the ad banners. Another version of the code currently hides about half of the ad banners.

I have been watching this symptom since early May.

I have learned that there are MULTIPLE CODE PATHS which myspace takes, when generating the code to display the ad banner. This is why the behavior may seem random.

The guilty code lines:
table div {display:none} or {visibility:hidden}
div div {display:none} or {visibility:hidden}
table div div {display:none} or {visibility:hidden}

other forms of these lines may include tr and/or td after table
i.e.
table tr td div
table tr div
table td div
table tr td div div
table tr div div
table td div div
body table div div
body div div
body div div div

If you have any of the above, with either {display:none} or {visibility:hidden} you are potentially hiding all or some of the myspace advertisements. This does put you at risk of having your myspace page deleted.

The reason this code hides the ad banner is because the myspace generated code sometimes places the ad banner at level

div table div (or div table tr td div or div table td div)

And other times places the ad at this level:
div table div div (or div table tr div div or div table td div div or div table td tr div div}

For demonstration purposes, I added style commands, to show the following levels:
div {border:4px hotpink dashed; margin:4px;}
table {border:3px green solid; margin:4px;}
td {border:4px blue dotted; margin:4px;}
table {background-color:transparent;}

I then took a screen shot of the ad banner area:

Notice that the ad banner is located at level div table td div

In the below example, I made a copy of the code, and changed the following line, to include a red dashed border. This is to show exactly which line of code this inner div is coming from:
<div id="ctl00_Header_Header1_bannerAdEmitter1_ctlGoogleAdEmitter" 
name="ctl00_Header_Header1_bannerAdEmitter1_ctlGoogleAdEmitter" style="border:4px red dashed; magin:5px;">


Now comes the mystery,
When did the above line of code show up? It was NOT there in Mid May when I took a code snapshot (at least not in my snapshot), but the symptom, of the vanishing ad banner, was clearly there in early and mid May.
At that point in time I was baffled by the symptom, which is why I ran so many tests. Then on June 5th, as I was testing I noticed the line of code, I show above (using the red dashed line). But the symptom was there, BEFORE that line of code ever showed up.

Then (while testing something else, not related to the ad) I noticed this:
The style block used here is:
div {border:4px hotpink dashed; margin:6px;}
table {border:3px green solid; margin:6px;}
table {background-color:transparent;}

Notice that we are now showing the ad banner at this level:
div table div div

To verify this, I added this line of code to my style block:
div table div div {border:4px yellow dashed; margin:5px;}

Now I have this in the style block:
div {border:4px hotpink dashed; margin:4px;}
table {border:3px green solid; margin:4px;}
table {background-color:transparent;}
div table div div {border:4px yellow dashed; margin:5px;}

I refreshed, and got this:

The ad changed, but it clearly shows that the ad is inside the yellow dashed area.

So I made a copy of the code, with the intent of putting in some of my own trouble shooting lines. To my surprise, the code I got a snapshot of, was DIFFERENT than the code I had been looking at only a few minutes prior (when I could not see the div layer I now show in yellow, in the code).
In this case I clearly saw the div layers, in the code, which were showing in the diagram:

I changed the code as follows (adding borders where I have the code shown in bold)
<div align="center" style="border:4px black dashed; margin:5px;">
<table width="800" border="0" align="center" cellspacing="0" cellpadding="0" bgcolor="003399">
<tr>
<td id="headerBanner" style="height:96px; text-align:center; vertical-align:text-top;">
<span id="ctl00_Header_Header1_bannerAdEmitter1_ctlGoogleAdEmitter"><!-- CMS:00000000-0000-0000-0000-000000000000: -->
</span>
<div style="height:90px; border:3px red dashed; margin:4px;"><div id="tkn_leaderboard" style="border:3px purple dashed; margin:4px;"></div></div>
Then I took a snapshot of the ad banner area of the page:


I then went back to the default myspace code and proceeded to run several tests. The tests were not consistent. Sometimes the ad would show up at level div table div
and other times at level div table div div.

Each time I saw the ad banner at level div table div div I saw the code showing all three divs. Each time I saw the ad banner at level div table div I saw the code showing only the two divs.
I saw the SAME ad show up in both conditions. Sometimes I would get one version of the code, sometimes the other.

How To Fix the Vanishing Ad Problem
If you have the guilty code line, and you want to insure your ad banner displays, remove the line of code.
Search for any of the lines I show above (and the ones I show below).
If you were using the line of code to hide the bottom links, and you still want to hide your bottom links, use this instead:

(I moved this code)Hide Bottom Links, Get Rid of Grey Background

Some other lines of code which will inhibit the display ability of some (or all) advertisements (These are less common than those above, and some of these are more often used to intentionally hide the ad banner):
div table td {display:none}
div table td {visibility:hidden;}
div table {display:none} or {visibility:hidden;}
table {display:none} or {visibility:hidden;}
div {display:none} or {visibility:hidden;}
td {display:none} or {visibility:hidden;}
tr {display:none} or {visibility:hidden;}
table tr {display:none} or {visibility:hidden;}
table tr td {display:none} or {visibility:hidden;}
div table tr td{display:none} or {visibility:hidden;}
.. any of the above with the word body before them (all of this is in the body).
... (anything which can effect level div table tr td OR div table tr td div)

If you can not find the line of code causing the problem, and just want code to override it; Here is a block of code which should work.
This code overrides multiple forms of the guilty code. Likely you don't need this much code, but having the extra code is harmless.
<style>
div table div,
div table div div,
div table td div,
div table td div div,
body div table div,
body div table div div,
body div table div {visibility:visible !important; display:block !important}
</style>


If anyone is wondering why I don't inform those, who are giving out the code which is causing the problem, I really have tried. In late May I began posting my findings to any forum where I found the guilty code.
I first posted the fix to the myspace customizing forum in Mid May.
The thread was quickly buried as were all others where I attempted to report the symptom. I had even asked the moderators to make a sticky thread, and they deleted my post. Then later someone else got it made into a sticky thread, and pointed to someone else's fix. That fix still hid the ad banner 50% of the time, and I attempted to post to that sticky thread, and that post was deleted by the moderators.
Only one of the sites I reported the information to, took me seriously. The site is joyboner.com

[Update June 30: I just checked the two main sites, being given out in the customizing forum. Both have updated their code (the code which hides the bottom links) to use the fix I gave out in Mid May.]

[Note: Aug 1 2007: The symptom which showed up on 1 Aug was cleaned up by that evening. However, during the day, as the myspace engineers attempted to fix the problem, I noticed some interesting things. The code, which generates the ad banner on the div div path, moved 3 or more times. At one point it was moved to the bottom. At another point, the actual ad showed up on the bottom, but only if I turned off style. )