Keyarn
Graham Aahh it didnt work or maybe i did not code well
<script language="javascript" src="http://keyarn.xtgem.com/Ads.js"></script></center></div></a><script> var x = document.getElementsByClassName("myads");
var y = Math.floor(Math.random() * x.length);
var z = Math.floor(Math.random() * x.length);
x[y].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><img src="http://keyarn.xtgem.com/Admin/rating.gif" /><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="'+ads()+'" width="300" height="50" alt="" /></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
x[z].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><img src="http://keyarn.xtgem.com/admin/rating.gif" /><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="'+ads()+'"></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
</script>
Copy code and then in my Ads.js
/* http://keyarn.xtgem.com */
var quotes=new Array()
function ads(){
quotes[0]='<center><div align="center" style="background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_6.jpg" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[1]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_6.jpg" border="0") no-repeat top left; padding-bottom:5; width:320px;"></div></center>'
quotes[2]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_5.gif" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[3]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_4.jpg" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[4]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_3.jpg" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[5]='<center><div align="center" style="background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_2.jpg" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[6]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_1.gif" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[7]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/banner.png" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[8]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_4.jpg" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[9]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_3.jpg" border="0") no-repeat top left; width:320px;"></div></center>'
quotes[10]='<center><div align="center" style="margin:2px; background:url(http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="http://wap4dollar.com/ad/imgs/wap4dollar_banner_6.jpg" border="0") no-repeat top left; width:320px;"></div></center>'}
var whichquote=Math.floor(Math.random()*(quotes.length))
return quotes[whichquote]
Copy code plz edit it for me i realyy need this thing that i want to do which i cannot do
Graham
Keyarn <script>
function ads(){
var a=[
'http://wap4dollar.com/ad/imgs/wap4dollar_banner_6.jpg',
'http://wap4dollar.com/ad/imgs/wap4dollar_banner_5.gif',
'http://wap4dollar.com/ad/imgs/wap4dollar_banner_4.jpg',
'http://wap4dollar.com/ad/imgs/wap4dollar_banner_3.jpg',
'http://wap4dollar.com/ad/imgs/wap4dollar_banner_2.jpg',
'http://wap4dollar.com/ad/imgs/wap4dollar_banner_1.gif',
'http://wap4dollar.com/ad/banner.png' ];
var b=Math.floor(Math.random()*(a.length));
return a[b];}
var x = document.getElementsByClassName("myads");
var y = Math.floor(Math.random() * x.length);
var z = Math.floor(Math.random() * x.length);
x[y].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><img src="http://keyarn.xtgem.com/Admin/rating.gif" /><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="'+ads()+'" width="300" height="50" alt="" /></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
x[z].innerHTML = '\<div class=\"ad\"\>\<b\><div class="full" style="background:url(/B/Bg/download.png)"><table cellspacing="0px"><tr align="middle"><td align="left"><img src="http://keyarn.xtgem.com/admin/Icons/ad.png" alt="**" class="ico" width="27px" height="30px" /></td><td align="left"><img src="http://keyarn.xtgem.com/admin/rating.gif" /><br/><a href="http://wap4dollar.com/ad/serve.php?id=9zxsoiy497"><img src="'+ads()+'"></a></td></tr></table></div><hr style="border:1px dotted red;"/>\</b\>\</div\>';
</script>
Copy code
still untested
Keyarn
Graham But sir is there any way to code the above javascript to xtscript. Plz i want to keep it away from source code viewers plz teach me sir
Graham
Keyarn it may be possible to convert part of it but not all
xtscript does not have the equivalent of some of the javascript
Keyarn
Graham Ok you mean it will not work or what
Keyarn
Graham Sir plz will dis work?
.ford {background-image : url( profile.avatars[16] ); background-repeat : no-repeat; background-position : right bottom; }
Copy code asin i want to use the profile icon as background somewhere plz sir i want to know
Graham
Keyarn The class would have to be defined within the twig for it to work
and it will only work when a forum function is on the page
the value also needs to be wrapped in {{...}}
.ford {background-image : url( {{ profile.avatars[16] }} ); background-repeat : no-repeat; background-position : right bottom; }
Copy code Then just add the class to the element
Keyarn
Graham ok sir but what of dis
{{avarta_src}}
or post.author.avatars[64]
Copy code plz will it work? Because that profile.avatars [16] is very small and if i increase de with or de length then it wont look brighter again and i want it to be bright plz sir elp me
Graham
Keyarn It is in 16 32 64 128 and 150 just change the number
{{avatar_src}} is set within the post_view routine that outputs the post so it changes constantly for each avatar on the page and has no value outside that routine (except maybe the last avatar from the array ) and does not indicate the avatars of online users