Post by [dmsuperman] on Jan 6, 2005 19:43:55 GMT
Well I see alot of people asking how everyone gets all these custom welcome tables, so I made a code to make your own. There are three variables, each containing the welcome table for each type of member.
You will need a basic knowledge of JS and how to use HTML to create your table.
Not crossbrowser
Rest of stats in code
<script language="javascript" type="text/javascript">
//This script created by [dmsuperman]
//May not be reposted without pemission from me
//May not be edited except for the welcome table itself
//This header may not be removed or edited
//Enjoy =D
/******************************\
Stats
48 lines minus spaces and comments
Fast loading
Not cross browser (Doesn't work in FF)
\*******************************/
//Define basic variables
var td = document.getElementsByTagName("TD");
var table = document.getElementsByTagName("TABLE");
//Hide the current welcome table
table[0].cellSpacing="0";
table[0].bgColor="";
table[0].className="";
td[0].style.display="none";
td[1].style.display="none";
td[2].style.display="none";
td[3].style.display="none";
td[4].style.display="none";
td[5].style.display="none";
var newCell = table[0].insertRow().insertCell();
//Grab important information
var disName = td[2].innerHTML.split("Hey, ")[1].split(", you have")[0];//Display name
if(td[2].innerHTML.match(/0 messages/i)){
var pmTotal = "0";
}else if(td[2].innerHTML.match(/1 message/i)){
var pmTotal = "1";
}else{
if(td[2].innerHTML.match(/">(.+?) messages/i) && !td[2].innerHTML.match(/">0 messages/i)){
var pmTotal = RegExp.$1;
}}//Total PMs
if(td[2].innerHTML.match(/is new/i)){
var pmNew = "1";
}else if(td[2].innerHTML.match(/0 are new/i)){
var pmNew = "0";
}else{
if(td[2].innerHTML.match(/, (.+?) are new/i) && !td[2].innerHTML.match(/0 are new/i)){
var pmNew = RegExp.$1;
}}//New PMs
if(td[2].innerHTML.match("Hey, ")){
var userName = td[5].innerHTML.split("username=")[1].split("\"><")[0];//Username
}
var menu = td[5].innerHTML;//Menu
var date = td[2].innerHTML.split(/<br>/i)[1];//Date
var loc = td[1].innerHTML.split(/<br>/i)[1];//<< home >> Location
var banner = td[1].innerHTML.split(/<br>/i)[0];//Banner
//The variables you may use in the tables are:
//"pmNew", "pmTotal", "disName", "date", "loc", "banner", "menu", "userName"
//(New PMs) (Total PMs) (Display name) (The date you see below PM stuff) (<< home >>) (The banner) (The menu) (Current user's username)
//Start variables to change
//---------------------------------------------------------------------------------------------------
var admin = "admin.gif";//This is all or part of your admin image. It is only used to see if they are logged in. The default PB image is admin.gif
var welcomeguest = "<table border=1 cellpadding=0 cellspacing=0><tr><td>hello</td><td>hi</td></tr><tr><td colspan=2>menu</td></tr></table>";//This is your welcome table that the guests see. Edit it with any HTML you want.
var welcomemember = "<table border=1 cellpadding=0 cellspacing=0><tr><td>hello member</td><td>hi</td></tr><tr><td colspan=2>menu</td></tr></table>";//This is the welcome table that the members see.
var welcomeadmin = "<table border=1 cellpadding=0 cellspacing=0><tr><td>hello admin</td><td>hi</td></tr><tr><td colspan=2>menu</td></tr></table>";//This is the welcome table seen by admins, people that can see the admin button.
//---------------------------------------------------------------------------------------------------
//End variables to change
if(td[5].innerHTML.match("username=")){
if(td[5].innerHTML.match(admin)){
newCell.innerHTML = welcomeadmin;
}else{
newCell.innerHTML = welcomemember;
}}else{
newCell.innerHTML = welcomeguest;
}
</script>
Very ugly preview, but it shows you can do what you want and where the table is
All headers
You will need a basic knowledge of JS and how to use HTML to create your table.
Not crossbrowser
Rest of stats in code
<script language="javascript" type="text/javascript">
//This script created by [dmsuperman]
//May not be reposted without pemission from me
//May not be edited except for the welcome table itself
//This header may not be removed or edited
//Enjoy =D
/******************************\
Stats
48 lines minus spaces and comments
Fast loading
Not cross browser (Doesn't work in FF)
\*******************************/
//Define basic variables
var td = document.getElementsByTagName("TD");
var table = document.getElementsByTagName("TABLE");
//Hide the current welcome table
table[0].cellSpacing="0";
table[0].bgColor="";
table[0].className="";
td[0].style.display="none";
td[1].style.display="none";
td[2].style.display="none";
td[3].style.display="none";
td[4].style.display="none";
td[5].style.display="none";
var newCell = table[0].insertRow().insertCell();
//Grab important information
var disName = td[2].innerHTML.split("Hey, ")[1].split(", you have")[0];//Display name
if(td[2].innerHTML.match(/0 messages/i)){
var pmTotal = "0";
}else if(td[2].innerHTML.match(/1 message/i)){
var pmTotal = "1";
}else{
if(td[2].innerHTML.match(/">(.+?) messages/i) && !td[2].innerHTML.match(/">0 messages/i)){
var pmTotal = RegExp.$1;
}}//Total PMs
if(td[2].innerHTML.match(/is new/i)){
var pmNew = "1";
}else if(td[2].innerHTML.match(/0 are new/i)){
var pmNew = "0";
}else{
if(td[2].innerHTML.match(/, (.+?) are new/i) && !td[2].innerHTML.match(/0 are new/i)){
var pmNew = RegExp.$1;
}}//New PMs
if(td[2].innerHTML.match("Hey, ")){
var userName = td[5].innerHTML.split("username=")[1].split("\"><")[0];//Username
}
var menu = td[5].innerHTML;//Menu
var date = td[2].innerHTML.split(/<br>/i)[1];//Date
var loc = td[1].innerHTML.split(/<br>/i)[1];//<< home >> Location
var banner = td[1].innerHTML.split(/<br>/i)[0];//Banner
//The variables you may use in the tables are:
//"pmNew", "pmTotal", "disName", "date", "loc", "banner", "menu", "userName"
//(New PMs) (Total PMs) (Display name) (The date you see below PM stuff) (<< home >>) (The banner) (The menu) (Current user's username)
//Start variables to change
//---------------------------------------------------------------------------------------------------
var admin = "admin.gif";//This is all or part of your admin image. It is only used to see if they are logged in. The default PB image is admin.gif
var welcomeguest = "<table border=1 cellpadding=0 cellspacing=0><tr><td>hello</td><td>hi</td></tr><tr><td colspan=2>menu</td></tr></table>";//This is your welcome table that the guests see. Edit it with any HTML you want.
var welcomemember = "<table border=1 cellpadding=0 cellspacing=0><tr><td>hello member</td><td>hi</td></tr><tr><td colspan=2>menu</td></tr></table>";//This is the welcome table that the members see.
var welcomeadmin = "<table border=1 cellpadding=0 cellspacing=0><tr><td>hello admin</td><td>hi</td></tr><tr><td colspan=2>menu</td></tr></table>";//This is the welcome table seen by admins, people that can see the admin button.
//---------------------------------------------------------------------------------------------------
//End variables to change
if(td[5].innerHTML.match("username=")){
if(td[5].innerHTML.match(admin)){
newCell.innerHTML = welcomeadmin;
}else{
newCell.innerHTML = welcomemember;
}}else{
newCell.innerHTML = welcomeguest;
}
</script>
Very ugly preview, but it shows you can do what you want and where the table is
All headers