Post by UnChained on Oct 22, 2006 14:45:21 GMT -8
Okay folks, what this code does is allow you to place your menu buttons, AND your No New/New PM's buttons ANYWHERE on your banner that you wish. Just edit the horizontal, and vertical positioning of the buttons. Once you play around with the positioning numbers, you will see how they move around for you. This code also removes the spacing between the menu buttons automatically, so only your button images show up the way you have them made. Don't forget to add the total width of the menu buttons, or the PM button. This is so the page won't stretch if you have all the buttons on the same horizontal line. As with ALL my codes, it works in ALL browsers! (Couldn't fit [CB] in the title Peter, sorry. )
Live Preview
GLOBAL HEADER
*10/24/11 - replaced with the one from socal - Wormo
Live Preview
GLOBAL HEADER
<script type="text/javascript">
<!--
/* Adjustable PM/Menu Button Positions For Banners by UnChained */
/* Please leave this header intact. Do not repost. */
/* [url]http://proboardcoding.proboards58.com[/url] */
var pbBanner="Banner Image URL"; // ProBoard banner URL.
var noNew="No New PM's Image URL"; // No new PM image URL.
var newPMs="New Pm's Image URL"; // New PM image URL.
var regButton="Guest Button Image URL"; // Guest image URL.
var banWidth="777"; // Banner width (In pixels).
var banHeight="200"; // Banner height (In Pixels).
var mbHorizontal="163"; // Menu buttons horizontal positioning.
var mbVertical="91"; // Menu buttons vertical positioning.
var mbWidth="430"; // Menu buttons width (total).
var pmHorizontal="-300"; // PM button horizontal positioning.
var pmVertical="61"; // PM button vertical positioning.
var pmbWidth="157"; // PM button width.
// Do Not Edit Below.
var td=document.getElementsByTagName("td")[5].firstChild;
td.innerHTML=td.innerHTML.replace(/&nb{1}sp;/gi,'');
var td=document.getElementsByTagName("td");
td[1].style.backgroundImage='url('+pbBanner+')';
td[1].style.height=banHeight+"px";
document.getElementsByTagName("table")[0].width=banWidth;
if(pb_username=="Guest"){
var pmButton='<a href="/index.cgi?action=register"><img src="'+regButton+'" border="0" /></a>';
} else {
var pmButton='<a href="/index.cgi?action=pm"><img src="'+noNew+'" border="0" /></a>';
}
if(td[2].innerHTML.match(/(\d+) (is|are) new/)){
var pmsrc=(RegExp.$1 > 0) ? newPMs : noNew;
pmButton='<a href="/index.cgi?action=pm"><img src="'+pmsrc+'" border="0" /></a>';
}
td[1].innerHTML='<div id="menuButtons" style="position: relative; top: '+mbVertical+'px; left: '+mbHorizontal+'px; width: '+mbWidth+'px;">'+td[5].innerHTML+'</div><div id="pmButton" style="position: relative; top: '+pmVertical+'; left: '+pmHorizontal+'; width: '+pmbWidth+'px;">'+pmButton+'</div>';
document.getElementsByTagName("tr")[2].style.display="none";
//-->
</script>
*10/24/11 - replaced with the one from socal - Wormo