Some have ask how I added the image buttons to my profile. For that to work you must use a js file.
You can create any size image you want using ur favorite editor!
Preview at [url=http://profiles.friendster.com/bobcbar]MY Profile![/url]
The sample code I am using here has spaces of 6 buttons and locates the buttons on the bottom of the right side.
If you already have js codes, just insert the addbox code as shown, below ur on handler, do not copy the entire code.
If you only use css right now you should inject your external css code into the js file as shown in the first part of the code below .
Here is how to create the js file.
Just copy this code to your notepad and edit accordingly.
Go to ripway.com and create an account, and then [b]Create A Subfoler[/b] called myjs.
Go to ur myjs folder and [b]Create A Text File[/b] name it myscripts.js [b]LEAVE IT BLANK.[/b]
Open the empty file myscripts.js then copy and paste the code from your notepad to the empty file and save.
You can post the url to ur js file using the current js linker code. Check the underground thread for the latest.
[quote]//CSS Injector
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "CSS_LINK_HERE";
css.media = "screen, print";
document.getElementsByTagName("head")[0].appendChild(css);
//onload handler
function onProfileLoad() {
//insert generated boxes here
var links="<center><a href='LINK HERE' target='_blank'><img src='LINK OF IMAGE HERE'></a></center> <center><a href='LINK HERE' target='_blank'><img src='LINK OF IMAGE HERE'></a></center> <center><a href='LINK HERE' target='_blank'><img src='LINK OF IMAGE HERE'></a></center> <center><a href='LINK HERE' target='_blank'><img src='LINK OF IMAGE HERE'></a></center> <center><a href='LINK HERE' target='_blank'><img src='LINK OF IMAGE HERE'></a></center> <center><a href='LINK HERE' target='_blank'><img src='LINK OF IMAGE HERE'></a></center>";
addBox("RIGHT","*-mY lInKs :-*",links,"button",null);
}
if (!attachOnLoadHandler(function(){onProfileLoad()})) window.onload = function(){onProfileLoad()};
function addBox(head,code,id,siblingafter) {
/*
head:
html string title
null - no header bar
code:
html string content
id:
unique string css pointer
siblingafter:
regexp classname
'left' - mainbar column end
'right' - sidebar column end
*/
try {
var li=document.createElement("li");
} catch(e) {
var li=document.createElement("<li>");
}
if(!head) head="";
else head="<h2>"+head+"</h2>";
li.innerHTML="<div id=\""+id+"\" class=\"commonbox "+id+"\">"+
head+
"<div id=\"content_"+id+"\">"+
code+
"</div>"+
"</div>";
if(siblingafter=="left") getElementsByClass(/commonbox[\s]*?controlpanel/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else if(siblingafter=="right") getElementsByClass(/commonbox[\s]*?friends/i,null,"DIV")[0].parentNode.parentNode.appendChild(li);
else {
var si=getElementsByClass(siblingafter,null,"DIV")[0];
si.parentNode.parentNode.insertBefore(li,si.parentNode);
}
}
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp(searchClass);
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}[/quote]
Here is an example of the completed code for the boxes, these are used on my spidy profile.
[quote]//Links
var links="<left><a href='http://www.friendster.com/publiccomments.php?uid=[b]30031645[/b]' target='_blank'><img src='http://h1.ripway.com/bobcbar/images/spidycomments.gif'></a></left><br><br><br> <left><a href='http://www.friendster.com/sendmessage.php?uid=[b]30031645[/b]' target='_blank'><img src='http://h1.ripway.com/bobcbar/images/spidymessage.gif'></a></left><br><br><br> <left><a href='http://www.friendster.com/friends/[b]30031645[/b]' target='_blank'><img src='http://h1.ripway.com/bobcbar/images/spidyfriends.gif'></a></left><br><br><br><left><a href='http://bobcbar.123Guestbook.com/' target='_blank'><img src='http://h1.ripway.com/bobcbar/images/spidyguest.gif'</a><br><br><br></left>";
addBox("LEFT","*-mY lInKs :-*",links,"button","10");[/quote]
[b]Edit the bold with your friendster userid..numbers only not custom code like bobcbar.[/b]
CREDITS: [b]Ephemeral for codes to create the link
Marifallster for addbox function codes[/b]
Last edited by bobcbar (2008-08-20 21:33:32)