Agent Moose
|
 |
« on: August 28, 2009, 09:40:38 pm » |
|
Footers: <script type="text/javascript"> var yes = "Welcome {user}."; var no = "Please <a href='" + smf_scripturl + "?action=login'>Login</a> or <a href='" + smf_scripturl + "?action=join'>Register</a>";
var name = document.getElementsByTagName("span"); //Created by Agent Moose (revolutionx.smfforfree3.com) for(v=0;v<name.length;v++){ if(name[v].innerHTML.match(/Hello <b>(.*)<\/b>/i)){ var username = RegExp.$1; if(yes.match(/{user}/i)) yes = yes.replace(/{user}/i,username); };}; var O_o = document.getElementsByTagName("td"); for(o_O=0;o_O<O_o.length;o_O++){ if(O_o[o_O].className == "catbg" && O_o[o_O].height == "32" && username){ O_o[o_O].innerHTML = "<span style='float: right;'>" + yes + "</span>" + O_o[o_O].innerHTML; }else if(O_o[o_O].className == "catbg" && O_o[o_O].height == "32" && !username){ O_o[o_O].innerHTML = "<span style='float: right;'>" + no + "</span>" + O_o[o_O].innerHTML; };}; </script> Original Request: http://revolutionx.smfforfree3.com/index.php/topic,1010.0.htmlThis code will add either "Welcome {user}" or "Please Login or Register" to the top where it shows your board name. If you have a banner for your forum, this code will not look very well on your forum. Edit as you wish  If you put {user} in the var yes = ""; part, it will show the users' username  Enjoy 
|
|
|
|
|
Andrew
|
 |
« Reply #1 on: August 28, 2009, 10:40:51 pm » |
|
Lmao what's with all the 'O_o' s in there? Makes the code look kinda.. silly  Gonna go add this one now! Great code Agent!! 
|
|
|
|
|
Exilis
Optimistic & Creative
Global Moderator
 
Offline
Posts: 929
 Badges: (View All)
|
 |
« Reply #2 on: August 29, 2009, 09:03:33 am » |
|
Ah yes I love the variable names.
|
|
|
|
|
Nick
Member
 
Offline
Gender: 
Posts: 48
 Badges: (View All)
|
 |
« Reply #4 on: August 29, 2009, 11:56:36 am » |
|
Awesome code 
|
|
|
|
|
KrylonKrystals
Starter
 
Offline
Gender: 
Posts: 22
 Badges: (View All)
|
 |
« Reply #6 on: August 30, 2009, 09:14:59 pm » |
|
Hey moose I've got a question.. Is it possible to make the code wrapped in <span class= "smalltext"> html? Also, is there a way maybe I can possible move the thing out of catbg? I see you have it in the code, I tried didn't succeed well in doing that maybe you can take a look at my forum for a better spot? http://gamerscoreachievements.smfforfree3.com (not advertising) - Thanks again KrylonKrystals
|
|
|
|
|
|