|
Title: [Code] Change Username Across Board V5 Post by: Agent Moose on September 22, 2007, 10:32:25 am Add this to the top of your headers if you don't have it:
Code: <script src="/jquery.js"></script> Footers Code: <script> function name_across_board(){ //Created by Agent Moose (smcodes.smfforfree3.com) var vfive = new Array(); vfive[vfive.length] = ["OLD NAME","NEW NAME","COLOR","OTHER","1/0","CUSTOM MESSAGE"] for(l=0;l<vfive.length;l++){ $("a:contains(" + vfive[l][0] + ")").html("<font color='"+vfive[f][2]+"'>"+vfive[f][3]+vfive[f][(vfive[f][1] != "" ? 1 : 0)]+"</font>"); if(vfive[l][4] == '1'){ if(location.href.match(/topic/i)){ $("td b a:contains(vfive[l][0])").after("<div class='custommessage'><strong>Custom Message:</strong><br>"+vfive[l][5]+"</div>"); };};};}; name_across_board(); </script> Ok, here is V5 of the Change Username Across Board code. I have added the Custom Message code to it so that you have one code for the price of two! OLD NAME = The persons name you want to change and give the Custom Message too NEW NAME = (OPTIONAL) This will give a new name to the person. COLOR = The color of the username OTHER = You may add any HTML here. 1/0 = Put 1 if the person wants a custom message, put 0 if they don't want one CUSTOM MESSAGE = The custom message that person wants. If you want to add more users, add more of these lines: vfive[vfive.length] = ["OLD NAME","NEW NAME","COLOR","OTHER","1/0","CUSTOM MESSAGE"] I hope you like it! Title: Re: Change Username Across Board V5 Post by: BadgerGirl*naf on September 22, 2007, 10:33:48 am Great code once again... are u gonna add it to our site?
Title: Re: Change Username Across Board V5 Post by: LaundryLady on September 22, 2007, 05:57:32 pm Badgergirl, you can do that yourself, just copy and paste into the areas Moose has indicated. It's really easy after you work with them a little bit.
Moose, I like this and am gonna set it up as soon as I can get a more stable connection. Title: Re: Change Username Across Board V5 Post by: Laugh-nd-kid on September 23, 2007, 12:24:12 pm Good code.
Wondering though.. If it's a '0', would you just leave custom message blank? Or remove it. Title: Re: Change Username Across Board V5 Post by: Agent Moose on September 24, 2007, 02:27:09 pm You would need to put a space in there, or text. If it is just blank, the whole code will not work.
Title: Re: [Code] Change Username Across Board V5 Post by: Sherry on December 28, 2008, 07:25:54 pm Forum Url: http://pittcountymomsclub.smfforfree2.com
Can someone take a look and see what is wrong with this code? I can't get it to work. Code: <script> function name_across_board(){ //Created by Agent Moose (smcodes.smfforfree3.com) $(function() { var vfive = new Array() vfive[vfive.length] = ["Sherry","Sherry","AA00FF","<img src="http://i39.tinypic.com/e6awci.jpg" border="0">","0"," "] vfive[vfive.length] = ["Rita","Rita","FF00FF","<img src="http://i39.tinypic.com/313rdqd.jpg" border="0">","0"," "] vfive[vfive.length] = ["zachsmom","zachsmom","348781","<img src="http://i44.tinypic.com/mv52qb.jpg" border="0">","0"," "] vfive[vfive.length] = ["Michelle","Michelle","32CD99","<img src="http://i44.tinypic.com/2wbucyx.jpg" border="0">","0"," "] vfive[vfive.length] = ["OAEOverlease","OAEOverlease","00BFFF","<img src="http://i43.tinypic.com/2a6laon.jpg" border="0">","0"," "] vfive[vfive.length] = ["Nicole","Nicole","66CCFF","<img src="http://i42.tinypic.com/wb2rde.jpg" border="0">","0"," "] for(l=0;l<vfive.length;l++){ $("a:contains(vfive[l][0])").html("<font color='"+vfive[f][2]+"'>"+vfive[f][3]+vfive[f][(vfive[f][1] != "" ? 1 : 0)]+"</font>") if (vfive[l][4] == '1') { if(location.href.match(/topic/i)){ $("td b a:contains(vfive[l][0])").after("<div class='custommessage'><strong>Custom Message:</strong><br>"+vfive[l][5]+"</div>"); };};};});}; </script> Title: Re: [Code] Change Username Across Board V5 Post by: simply sibyl on December 28, 2008, 07:40:45 pm Try doing the image urls this way instead (using single quotes around the url):
"<img src='IMAGE URL' />" Title: Re: [Code] Change Username Across Board V5 Post by: Sherry on December 28, 2008, 07:42:40 pm Thanks. I'll try that.
Title: Re: [Code] Change Username Across Board V5 Post by: Sherry on December 28, 2008, 07:56:50 pm Maybe I am just too tired of something but I still can't get it to work. I think I did what you told me too. :-\
Here is what it looks like now... Code: <script> function name_across_board(){ //Created by Agent Moose (smcodes.smfforfree3.com) $(function() { var vfive = new Array() vfive[vfive.length] = ["Sherry","Sherry","AA00FF","<img src='http://i39.tinypic.com/e6awci.jpg' />","0"," "] vfive[vfive.length] = ["Rita","Rita","FF00FF","<img src='http://i39.tinypic.com/313rdqd.jpg' />","0"," "] vfive[vfive.length] = ["zachsmom","zachsmom","348781","<img src='http://i44.tinypic.com/mv52qb.jpg' />","0"," "] vfive[vfive.length] = ["Michelle","Michelle","32CD99","<img src='http://i44.tinypic.com/2wbucyx.jpg' />","0"," "] vfive[vfive.length] = ["OAEOverlease","OAEOverlease","00BFFF","<img src='http://i43.tinypic.com/2a6laon.jpg' />","0"," "] vfive[vfive.length] = ["Nicole","Nicole","66CCFF","<img src='http://i42.tinypic.com/wb2rde.jpg' />","0"," "] for(l=0;l<vfive.length;l++){ $("a:contains(vfive[l][0])").html("<font color='"+vfive[f][2]+"'>"+vfive[f][3]+vfive[f][(vfive[f][1] != "" ? 1 : 0)]+"</font>") if (vfive[l][4] == '1') { if(location.href.match(/topic/i)){ $("td b a:contains(vfive[l][0])").after("<div class='custommessage'><strong>Custom Message:</strong><br>"+vfive[l][5]+"</div>"); };};};});}; </script> Title: Re: [Code] Change Username Across Board V5 Post by: simply sibyl on December 28, 2008, 07:59:58 pm put a # before each of the color codes
for instance instead of "AAOOFF" it should be "#AAOOFF" sorry, I shoulda noticed that as well Make sure all of the original names are the "usernames" not the "display names" and its case sensitive so be sure that is correct for them as well. Title: Re: [Code] Change Username Across Board V5 Post by: Sherry on December 28, 2008, 08:19:18 pm Okay I added # before each of the color codes and I doubled checked the spellings and cases of each usernames and made sure that they are not their display names. Still doesn't work.
Title: Re: [Code] Change Username Across Board V5 Post by: simply sibyl on December 29, 2008, 10:05:41 am Sherry since it looks like you are only using the part to change the names color and add an image use this code instead... Places to edit are in Capital Letters - should be pretty self explanatory. I know this code works.
Code: <script> function name_across_board(){ //Created by Agent Moose (smcodes.smfforfree3.com) var vfour = new Array() vfour[vfour.length] = ["OLD NAME","NEW NAME","COLOR","<img src='IMAGE URL' />"]; for(f=0;f<vfour.length;f++){ $("a[href*='u=']").each(function() { if(this.innerHTML.match(vfour[f][0])){ this.innerHTML = this.innerHTML.replace(vfour[f][0],"<font color='" + vfour[f][2] + "'>" + vfour[f][3] + vfour[f][(vfour[f][1] != "" ? 1 : 0)] + "</font>"); };});};} name_across_board(); </script> Title: Re: [Code] Change Username Across Board V5 Post by: Andrew on December 29, 2008, 01:37:03 pm I just went from V4 to V5(this one), removed everything from V4, and tried putting in this one, its not working for me..here is the code I put in my footers:
Code: <script> function name_across_board(){ //Created by Agent Moose (smcodes.smfforfree3.com) $(function() { var vfive = new Array() vfive[vfive.length] = ["Andrew","","#FF0000","<u>","1","Site owner"] vfive[vfive.length] = ["Chris","","#FF0000","<u>","1","Site designer"] vfive[vfive.length] = ["Admiral Savvy","","#FF0000","<u> <b> <marquee>","1","Guildmaster"] vfive[vfive.length] = ["Ben D","","#FF0000","<u>","0"," "] vfive[vfive.length] = ["Ironhook","","#FF0000","<u>","0"," "] vfive[vfive.length] = ["Mahek-p","","#FF0000","<u>","1","Site owner"] vfive[vfive.length] = ["Nautical Nattie","","#33FF00","<marquee> <u>","0","Partner of the week"] for(l=0;l<vfive.length;l++){ $("a:contains(vfive[l][0])").html("<font color='"+vfive[f][2]+"'>"+vfive[f][3]+vfive[f][(vfive[f][1] != "" ? 1 : 0)]+"</font>") if (vfive[l][4] == '1') { if(location.href.match(/topic/i)){ $("td b a:contains(vfive[l][0])").after("<div class='custommessage'><strong>Custom Message:</strong><br>"+vfive[l][5]+"</div>"); };};};});}; </script> Thanks for anyone that can help! Title: Re: [Code] Change Username Across Board V5 Post by: Pan on May 18, 2009, 08:52:26 pm Can I leave the blank on the "OTHER" and "NEW NAME"?
Title: Re: [Code] Change Username Across Board V5 Post by: Seldom Fail on May 18, 2009, 09:32:27 pm Can I leave the blank on the "OTHER" and "NEW NAME"? Yes you should be able to. |