MyBB Community Forums
put javascript code - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: put javascript code (/thread-13880.html)



put javascript code - ludogorie - 2006-11-17

there is a code under... when I put this code normal html pages it shows top of the page and right side..

how can I put this code to the mybb forum. and which template

<!-- code start -->
<div id="phpads_e6c8d575" style="position:absolute; width:105px; height:164px; z-index:99; left: 0px; top: 0px; visibility: hidden"> <table cellspacing="0" cellpadding="0">

<td align="center">

<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="105" id="AutoNumber1">

<tr>
<td>

<a href="http://www.kalbimden.net" target=_blank><img src="http://www.zumzuma.com/reklam/kalbimdenhv.gif" border=1></a>

</td>
</tr>

<tr>
<td align="center" height=14 style="padding: 0px"><font face="Verdana" size="1" color="#FFFFFF"><a href="javascript:;" onClick="phpAds_simplepop_e6c8d575('close'); return false;" style="color:#0000ff"><font color=black><b>Tanitimi Kapat</b></font></a></td></tr>
<tr>

</table>

</center>
</div>

</td>
</tr></table></td></tr></table></div>

<p>
<script>

function phpAds_findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=phpAds_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function phpAds_adlayers_place_e6c8d575()
{
var c = phpAds_findObj('phpads_e6c8d575');

if (!c)
return false;

if (c.style)
c = c.style;

if (window.innerHeight)
ih = window.innerHeight;
else
ih = document.body.clientHeight;

if (window.innerWidth)
iw = window.innerWidth;
else
iw = document.body.clientWidth;


if (document.all) {

c.pixelLeft = iw + document.body.scrollLeft - 126;
c.pixelTop = 0 + document.body.scrollTop;

} else {
c.left = iw + window.pageXOffset - 126 - 16;
c.top = 0 + window.pageYOffset;

}

c.visibility = phpAds_adlayers_visible_e6c8d575;
}


function phpAds_simplepop_e6c8d575(what)
{
var c = phpAds_findObj('phpads_e6c8d575');

if (!c)
return false;

if (c.style)
c = c.style;

switch(what)
{
case 'close':
phpAds_adlayers_visible_e6c8d575 = 'hidden';
phpAds_adlayers_place_e6c8d575();
window.clearInterval(phpAds_adlayers_timerid_e6c8d575);
break;

case 'open':
phpAds_adlayers_visible_e6c8d575 = 'visible';
phpAds_adlayers_place_e6c8d575();
phpAds_adlayers_timerid_e6c8d575 = window.setInterval('phpAds_adlayers_place_e6c8d575()', 10);


break;
}
}


var phpAds_adlayers_timerid_e6c8d575;
var phpAds_adlayers_visible_e6c8d575;


phpAds_simplepop_e6c8d575('open');

</script>

<!-- code end -->



RE: put javascript code - Garlant - 2006-11-17

Hi ludogorie,

At First in your code were some mistakes. I fixed them

You have to edit the header and the footer template.
Open the headertemplate an add in the first line:
<table border="0" width='100%'>
<tr>
<!-- start: how many space we nee to show the banner-->
<td width="12%">
<!-- end: how many space we nee to show the banner-->
<div id="phpads_e6c8d575" style="position:absolute; width:105px; height:164px; z-index:99; left: 0px; top: 0px; visibility: hidden">
<table cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; bordercolor: #111111;" width="105" id="AutoNumber1">
<tr>
<td><a href="http://www.kalbimden.net" target="_blank"><img src="http://www.zumzuma.com/reklam/kalbimdenhv.gif" alt="" border="1" /></a></td>
</tr>

<tr>
<td align="center" height="14" style="padding: 0px"><font face="Verdana" size="1" color="#FFFFFF"><a href="javascript:;" onclick="phpAds_simplepop_e6c8d575('close'); return false;" style="color:#0000ff"><font color="black"><b>Tanitimi
Kapat</b></font></a></font></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</div>
<p><script type="text/javascript">

function phpAds_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=phpAds_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function phpAds_adlayers_place_e6c8d575()
{
var c = phpAds_findObj('phpads_e6c8d575');

if (!c)
return false;

if (c.style)
c = c.style;

if (window.innerHeight)
ih = window.innerHeight;
else
ih = document.body.clientHeight;

if (window.innerWidth)
iw = window.innerWidth;
else
iw = document.body.clientWidth;


if (document.all) {

c.pixelLeft = iw + document.body.scrollLeft - 126;
c.pixelTop = 0 + document.body.scrollTop;

} else {
c.left = iw + window.pageXOffset - 126 - 16;
c.top = 0 + window.pageYOffset;

}

c.visibility = phpAds_adlayers_visible_e6c8d575;
}


function phpAds_simplepop_e6c8d575(what)
{
var c = phpAds_findObj('phpads_e6c8d575');

if (!c)
return false;

if (c.style)
c = c.style;

switch(what)
{
case 'close':
phpAds_adlayers_visible_e6c8d575 = 'hidden';
phpAds_adlayers_place_e6c8d575();
window.clearInterval(phpAds_adlayers_timerid_e6c8d575);
break;

case 'open':
phpAds_adlayers_visible_e6c8d575 = 'visible';
phpAds_adlayers_place_e6c8d575();
phpAds_adlayers_timerid_e6c8d575 = window.setInterval('phpAds_adlayers_place_e6c8d575()', 10);


break;
}
}


var phpAds_adlayers_timerid_e6c8d575;
var phpAds_adlayers_visible_e6c8d575;


phpAds_simplepop_e6c8d575('open');

</script> <!-- code end --></p>
</td>
<td>
Now open the footer and add in the first line:
</td>
</tr>
</table>	
Its will look like on this screen (maybe a little better becouse you're usink unkown css classes)    


RE: put javascript code - ludogorie - 2006-11-18

thank you Garlant but I could put like this. can you arrange it shows on right side...


RE: put javascript code - Garlant - 2006-11-18

Hi Ludogorie,
This code was made to put this banner on left side. Maybe you have to change something on the js, too.
This code will put the banner on the right side.

Open your header.
ADD on the first line:
<table border="0" width='100%'>
<tr>
<td>

Add on the last line:
</td>
<!-- start: how many space we nee to show the banner-->
<td width="10%">
<!-- end: how many space we nee to show the banner-->
<div id="phpads_e6c8d575" style="position:absolute; width:105px; height:164px; z-index:99; right: 0px; top: 0px; visibility: hidden">
<table cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; bordercolor: #111111;" width="105" id="AutoNumber1">
<tr>
<td><a href="http://www.kalbimden.net" target="_blank"><img src="http://www.zumzuma.com/reklam/kalbimdenhv.gif" alt="" border="1" /></a></td>
</tr>

<tr>
<td align="center" height="14" style="padding: 0px"><font face="Verdana" size="1" color="#FFFFFF"><a href="javascript:;" onclick="phpAds_simplepop_e6c8d575('close'); return false;" style="color:#0000ff"><font color="black"><b>Tanitimi
Kapat</b></font></a></font></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</div>
<p><script type="text/javascript">

function phpAds_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=phpAds_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function phpAds_adlayers_place_e6c8d575()
{
var c = phpAds_findObj('phpads_e6c8d575');

if (!c)
return false;

if (c.style)
c = c.style;

if (window.innerHeight)
ih = window.innerHeight;
else
ih = document.body.clientHeight;

if (window.innerWidth)
iw = window.innerWidth;
else
iw = document.body.clientWidth;


if (document.all) {

c.pixelLeft = iw + document.body.scrollLeft - 126;
c.pixelTop = 0 + document.body.scrollTop;

} else {
c.left = iw + window.pageXOffset - 126 - 16;
c.top = 0 + window.pageYOffset;

}

c.visibility = phpAds_adlayers_visible_e6c8d575;
}


function phpAds_simplepop_e6c8d575(what)
{
var c = phpAds_findObj('phpads_e6c8d575');

if (!c)
return false;

if (c.style)
c = c.style;

switch(what)
{
case 'close':
phpAds_adlayers_visible_e6c8d575 = 'hidden';
phpAds_adlayers_place_e6c8d575();
window.clearInterval(phpAds_adlayers_timerid_e6c8d575);
break;

case 'open':
phpAds_adlayers_visible_e6c8d575 = 'visible';
phpAds_adlayers_place_e6c8d575();
phpAds_adlayers_timerid_e6c8d575 = window.setInterval('phpAds_adlayers_place_e6c8d575()', 10);


break;
}
}


var phpAds_adlayers_timerid_e6c8d575;
var phpAds_adlayers_visible_e6c8d575;


phpAds_simplepop_e6c8d575('open');

</script> <!-- code end --></p>
</td>
</tr>
<tr>
<td>

open your footer.
Add on the first line:
</td>
</tr>
</table>

Greez Garlant


RE: put javascript code - ludogorie - 2006-11-23

thank you garlant good work.