vForums Support > Programming & Coding :: Database of Codes/Hacks/Mods :: > Welcome Table Mod

Welcome Table Mod - Posted By Marc (cr0w) on 9th Dec 07 at 11:58pm
Preview: Here

Description: This code changes the look of your welcome table, and is completely customizable.

Placement: Global Headers

Editing: Details are given in the code itself.

Code:
 
  1. <script type="text/javascript">
  2. <!--
  3. /*
  4. Welcome Table Mod by Cr0w
  5. Copyright 2007
  6. Do not Repost
  7. */
  8.  
  9. //Edit Below
  10.  
  11. /* Start Date/PM Cell Variables */
  12. var wtp = 2; //0 = above banner, 1 = above menu buttons, 2 = below menu buttons
  13. var pmb = 0; //0 = Hide PM bar, 1 = Keep PM bar
  14. var mar = 1; //0 = Hide "Mark All Read" link, 1 = Display below welcome table
  15. /* End Date/PM Cell Variables */
  16.  
  17. /* Start Menu Bar Variables */
  18. var pos = "center"; //left = buttons on left, center = buttons in center, right = buttons on right
  19. var ss = "[ "; // Symbol to go before buttons
  20. var div = "|"; // Symbol for between buttons
  21. var es = " ]"; // Symbol to go after buttons
  22. /* End Menu Bar Variables */
  23.  
  24. //Edit Above
  25. var wt = document.getElementById("welcome_table");
  26.  
  27. //Change Menu Bar
  28. var mbb = wt.getElementsByTagName("tr")[1].getElementsByTagName("td")[0].getElementsByTagName("table")[0].getElementsByTagName("td")[0];
  29.  
  30. mbb.style.cssText = "text-align: "+pos;
  31. mbb.innerHTML = ss+mbb.innerHTML+es;
  32. while(mbb.innerHTML.match("::")){
  33. mbb.innerHTML = mbb.innerHTML.replace("::",div);
  34. }
  35.  
  36. //Update Row Colspans
  37. wt.getElementsByTagName("td")[0].colSpan="3";
  38. wt.getElementsByTagName("td")[1].colSpan="3";
  39.  
  40. //Create Row & Cells
  41. var nRow=wt.insertRow(wtp);
  42. var nCell=nRow.insertCell(0);
  43. var nCell2=nRow.insertCell(1);
  44. var nCell3=nRow.insertCell(2);
  45.  
  46. //Declare Cell Attributes
  47. nCell.style.cssText="width: 33%;text-align: center;height: 25px;font-size: 12px";
  48. nCell.className="welcome";
  49. nCell2.style.cssText="width: 33%;text-align: center;height: 25px;font-size: 12px";
  50. nCell2.className="welcome";
  51. nCell3.style.cssText="width: 33%;text-align: center;height: 25px;font-size: 12px";
  52. nCell3.className="welcome";
  53.  
  54. //Insert Cell Values
  55. var d = new Date();
  56. var hours = d.getHours();
  57. var min = d.getMinutes();
  58. var date = d.getDate();
  59. var ap = "am";
  60. var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  61.  
  62. if(hours>=12){
  63. ap = "pm";
  64. hours -= 12;
  65. }
  66. if(hours==0){
  67. hours = 12;
  68. }
  69.  
  70. nCell.innerHTML = months[d.getMonth()]+' '+date+((date>3) ? 'th' : ((date==1) ? 'st' : ((date==2) ? 'nd' : 'rd')))+', '+d.getFullYear()+' ['+hours+':'+((min<10) ? '0'+min : min)+ap+']';
  71. nCell2.innerHTML = 'Welcome, '+((vf_username=="guest") ? 'Guest.' : '<a href="/action/view_profile/user/'+vf_username+'/">'+vf_displayname+'</a>.');
  72. nCell3.innerHTML = ((vf_username=="guest") ? 'Please <a href="/action/login/">login</a> or <a href="/action/register/">register</a>.' : 'Total PM's: <a href="/action/pm/">'+vf_total_pms+'</a> ('+vf_new_pms+' new)');
  73.  
  74. //Hide PM Bar
  75. if(pmb==0){
  76. var ut = document.getElementById("user_table");
  77. if(mar==1){
  78. ut.getElementsByTagName("tr")[0].innerHTML = '<td align="center" class="menu"><a href="/action/markasread/type/boards/">Mark All Boards Read</a></td>';
  79. }
  80. else{
  81. ut.style.display="none";
  82. }
  83. }
  84. //-->
  85. </script>
 

Re: Welcome Table Mod - Posted By Tyson (Fithad) on 10th Dec 07 at 1:51am
Nice work Cr0w, I like it a lot.

Re: Welcome Table Mod - Posted By Marc (cr0w) on 10th Dec 07 at 2:05am
 
Nice work Cr0w, I like it a lot.


Yay. {Smile}

Re: Welcome Table Mod - Posted By Luke (Zero) on 10th Dec 07 at 2:10am
Ya, I find it funny that you put Copyright 2007.... {Cheesy}

Re: Welcome Table Mod - Posted By Tyson (Fithad) on 10th Dec 07 at 2:13am
 
Ya, I find it funny that you put Copyright 2007.... {Cheesy}


It is afterall.. 2007 {Tongue Out}

Re: Welcome Table Mod - Posted By Marc (cr0w) on 10th Dec 07 at 2:14am
 
Ya, I find it funny that you put Copyright 2007.... {Cheesy}


*Checks Date*

Says 2007, or is my computer clock just broken? {Tongue Out}

Re: Welcome Table Mod - Posted By Luke (Zero) on 10th Dec 07 at 2:15am
 
 
Ya, I find it funny that you put Copyright 2007.... {Cheesy}


It is afterall.. 2007 {Tongue Out}
Yes but you can not declare copyright if you wish to... I think... (Yes I think, big news! {Shocked} )

Re: Welcome Table Mod - Posted By Marc (cr0w) on 10th Dec 07 at 2:20am
 
 
 
Ya, I find it funny that you put Copyright 2007.... {Cheesy}


It is afterall.. 2007 {Tongue Out}
Yes but you can not declare copyright if you wish to... I think... (Yes I think, big news! {Shocked} )


Actually, yes I can. {Wink} Look it up. {Tongue Out}

Re: Welcome Table Mod - Posted By Luke (Zero) on 10th Dec 07 at 2:22am
 
 
 
 
Ya, I find it funny that you put Copyright 2007.... {Cheesy}


It is afterall.. 2007 {Tongue Out}
Yes but you can not declare copyright if you wish to... I think... (Yes I think, big news! {Shocked} )


Actually, yes I can. {Wink} Look it up. {Tongue Out}
My mistake! {Grin}





Copyright 2007

Re: Welcome Table Mod - Posted By Marc (cr0w) on 10th Dec 07 at 2:25am
 
 
 
 


It is afterall.. 2007 {Tongue Out}
Yes but you can not declare copyright if you wish to... I think... (Yes I think, big news! {Shocked} )


Actually, yes I can. {Wink} Look it up. {Tongue Out}
My mistake! {Grin}





Copyright 2007

{Smile}

Re: Welcome Table Mod - Posted By Tyson (Fithad) on 10th Dec 07 at 3:31am
We're learning this in school lately... to copyright all you need to do is state Copyright (or (C)) #Date, #Name and it's legally yours and nobody else can take it. Although in court, unless you register it with the government, it won't do too much.

Re: Welcome Table Mod - Posted By Marc (cr0w) on 10th Dec 07 at 3:35am
 
We're learning this in school lately... to copyright all you need to do is state Copyright (or (C)) #Date, #Name and it's legally yours and nobody else can take it. Although in court, unless you register it with the government, it won't do too much.


Actually, if you can prove you wrote whatever the other person used, and they did not give you credit, then it will still hold up in court.

Re: Welcome Table Mod - Posted By Tyson (Fithad) on 10th Dec 07 at 3:37am
It can hold up either way, but not as much if it's not "officially" registered.

But then again, the person could say it's for educational purposes and write up something quick{Confused}

Anyways... back to the welcome table {Cheesy}

Re: Welcome Table Mod - Posted By Marc (cr0w) on 10th Dec 07 at 3:38am
 
It can hold up either way, but not as much if it's not "officially" registered.

But then again, the person could say it's for educational purposes and write up something quick{Confused}

Anyways... back to the welcome table {Cheesy}


Heh, I've got some sexy ideas for it, but I'll work on those when I have more time. {Smile}

Re: Welcome Table Mod - Posted By nr4life (nr4life) on 26th Mar 08 at 1:24am
the code isnt working for me

Re: Welcome Table Mod - Posted By Marc (cr0w) on 26th Mar 08 at 1:25am
 
the code isnt working for me


Head on over to Code Support. {Wink}