[quote]if (!attachOnLoadHandler(function(){editfriend()})) parent.onload = function(){editfriend()};
//load script
function attachOnLoadHandler(func)
{
if(parent.attachEvent)
{
//win 5.0-6.0
parent.attachEvent('onload',func);
return true;
}
if(parent.addEventListener)
{
//moz,opera & safari
parent.addEventListener('load',func,false);
return true;
}
return false;
}
function editfriend() {
var friend = "<div><div class='boxcontent'><div class='flogrid75'><div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div><br>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div><br>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div><br>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div>"+
"<div class='flogriditem'><div class='ir'><a href='[b]userid[/b]'><img src='[b]photourl[/b]l'></a></div><div class='dr'><a href='[b]userid[/b]'>[b]name[/b]</a></div></div></div></div><br></div></div><div class='viewall'><a href='/friends/userid'>View All</a></div>";
addSideBar("-sUiLuJ-'s Featured Friends",friend,"friends_2_2");
}
function addSideBar(head,htm,div_id) {
var innerHtm=htm;
var cont= "<div id='"+div_id+"' class='commonbox "+div_id+"'>"+
"<h2>"+head+"</h2>"+
"<div id='content_"+div_id+"'>"+
innerHtm+
"</div>"+
"</div>";
try {
var obj=document.createElement("<li>");
} catch(e) {
var obj=document.createElement("li");
}
var x=document.getElementById("friends_2_2");
x.parentNode.parentNode.appendChild(obj);
obj.innerHTML=cont;
}[/quote]
in case that you have the onloadhandler and the sidebar function, you don't need to put the function again... copy the code above and paste it where you put your cbox..
u can use this code so that, you will not input anymore css extensions.. the css used in the special friend box is like the css you used in your friend box..
credits to eyk!!
Last edited by jagcopra (2007-06-16 10:33:00)