Post by Isa The Great on Jul 26, 2009 10:41:38 GMT -5
Profile Layout differently
global footer
global footer
<script type='text/javascript'>
/* Remove welcome message option in profile
code created by CrAzY_J
do not redistribute this code without the creator's permission*/
if( document.modifyForm && document.modifyForm.user.value == pb_username )
{
var RowS = document.modifyForm.showimages.parentNode.parentNode.parentNode;
var iRow = RowS.parentNode.insertRow( RowS.parentNode.rows.length );
var iCell1 = iRow.insertCell(0);
var iCell2 = iRow.insertCell(1);
var iCell3 = iRow.insertCell(2);
var aFont1 = document.createElement('font');
var aFont2 = aFont1.cloneNode(false);
var aFont3 = aFont1.cloneNode(false);
var aSelect = document.createElement('select');
aSelect.id = 'messageshowchooser';
aSelect.options[0] = new Option('Yes','yes');
aSelect.options[1] = new Option('No','no');
aSelect.selectedIndex = ( document.cookie.match('showelcome=yes') )? 0:1;
aFont1.size = '-1';
aFont2.size = '-1';
aFont3.size = '-2';
aFont1.appendChild( document.createTextNode('Show welcome message:') );
aFont2.appendChild( aSelect );
aFont3.appendChild( document.createTextNode('If you do not want the welcome message in the top table to appear, choose "yes" else choose "no".') );
iCell1.appendChild( aFont1 );
iCell2.appendChild( aFont2 );
iCell3.appendChild( aFont3 );
document.modifyForm.profileaction[0].onclick = function()
{
{
var d = new Date();
d.setYear( d.getFullYear() + 5 );
var thesuperlongid = document.getElementById('messageshowchooser');
document.cookie = 'showelcome='+thesuperlongid.options[thesuperlongid.selectedIndex].value+';expires='+d;
}
}
}
if( document.cookie.match('showelcome=yes') )
document.getElementsByTagName('td')[2].style.display = 'none';
</script>
<script type="text/Javascript">
// Mini-Profile Base v2 by Chris
// Open Source
// Tested in FireFox 1.5, IE6, and Opera 9
// The function returns an associative array containing the data.
var br_re = /<br\s?\/?>/gi;
var rankLines = 2;
function miniProfile(ext){
var _arr = [];
_arr["user"] = "";
_arr["display"] = "";
_arr["customtitle"] = "";
_arr["status"] = "";
_arr["karma"] = false;
_arr["karmalinks"] = false;
_arr["contacts"] = "";
_arr["personal"] = "";
_arr["posts"] = 0;
_arr["location"] = false;
_arr["joined"] = "";
_arr["rank1"] = "";
_arr["rank2"] = "";
var cen = ext.getElementsByTagName("center")[ext.getElementsByTagName("center").length-1];
var cens = cen.innerHTML.split(br_re);
for(var a=0;a<cens.length;a++){
if(cens[a].match(/\[avatar\]/i))
_arr["avatar"] = cens[a];
else if(cens[a].match(/\[(icq|yim|msn|aim|homepage|email|send\spm)\]/i))
_arr["contacts"] += cens[a];
else
_arr["personal"] += cens[a];
}
cen.parentNode.removeChild(cen);
var spi = ext.innerHTML.split(br_re);
_arr["display"] = spi[0];
_arr["rank1"] = spi[1];
_arr["user"] = (spi[0].match(/user=(.+?)("|'|\s|>)/i)?RegExp.$1:"");
if(rankLines == 2){
_arr["rank2"] = spi[2];
spi.splice(2,1);
}
spi.splice(0,2);
for(var a=0;a<spi.length;a++){
if(spi[a].match(/Gender:\s(.+?)\s(<img.+?>)?$/i))
_arr["gender"] = RegExp.$2;
else if(spi[a].match(/Joined: (.+?)$/i))
_arr["joined"] = RegExp.$1;
else if(spi[a].match(/Posts: ([\d,]+)/i))
_arr["posts"] = RegExp.$1;
else if(spi[a].match(/Location: (.+?)$/i))
_arr["location"] = RegExp.$1;
else if(spi[a].match(/Karma: (-?[\d,]+)/i))
_arr["karma"] = RegExp.$1;
else if(spi[a].match(/>Exalt</) && spi[a].match(/>Smite</))
_arr["karmalinks"] = spi[a];
else if(spi[a].match(/Member is ((<b>)?(on|off)line(<\/b>)?)/i))
_arr["status"] = RegExp.$1.replace(/<\/?b>/gi,"");
else if(spi[a] != "")
_arr["customtitle"] += spi[a]+"<br />";
}
return _arr;
}
var aTD = document.getElementsByTagName("TD");
var br = "<br /><br /><br /><br />";
for(a=0;a<aTD.length;a++){
if(aTD[a].width == "20%" && aTD[a].innerHTML.match(/Posts:/i)){
var user = miniProfile(aTD[a]);
var data = '<center><div class="mphead"></div></center>';
for(b in user)
data +='<table width="149px" cellpadding="4" cellspacing="1" align="center" class="bordercolor">';
data +='<tr><td class="windowbg" width="100%" colspan="2" align="center">' + user["display"] + '</td></tr>';
data +='<tr><td class="windowbg" width="100%" colspan="2" align="center">' + user["avatar"] + '<br/>' + user["rank2"] + '<br/>' + user["rank1"] + '<br/>' + user["customtitle"] + '</td></tr>';
data +='<tr><td class="windowbg" width="100%" colspan="2" align="center">Joined in ' + user["joined"] + '</td></tr>';
data +='<tr><td width="50%" class="windowbg" vAlign="top">Gender: ' + user["gender"] + '</td><td width="50%" class="windowbg" vAlign="top">Karma ' + user["karma"] + '</td></tr>';
data +='<tr><td class="windowbg" width="100%" colspan="2" align="center">Forum Posts: ' + user["posts"] + '</td></tr>';
data += (user["karmalinks"])? '<tr><td class="windowbg" width="100%" colspan="2" align="center">' + user["karmalinks"] + '</td></tr>' : '';
data +='<tr><td class="windowbg" width="100%" colspan="2" align="center">' + user["contacts"] + '</td></tr>';
data +='</table><center><div class="' + user["status"] + '"></div></center>';
aTD[a].innerHTML = data;
}
}
</script>