|
Agent Moose
|
 |
« on: September 22, 2007, 10:32:25 am » |
|
Add this to the top of your headers if you don't have it: <script src="/jquery.js"></script> Footers <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!
|
|
|
|
« Last Edit: June 11, 2009, 09:44:06 am by Agent Moose »
|
Logged
|
Want to know how good your board is? Why not get it reviewed at Revolution X!

|
|
|
|
|
|
BadgerGirl*naf
|
 |
« Reply #1 on: September 22, 2007, 10:33:48 am » |
|
Great code once again... are u gonna add it to our site?
|
|
|
|
|
Logged
|
|
|
|
LaundryLady
Global Moderator
Offline
Posts: 3056
Internet Challenged
|
 |
« Reply #2 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.
|
|
|
|
|
Logged
|
|
|
|
Laugh-nd-kid
SMF For Free Master
Offline
Posts: 1412
Thankyou for this great software SMF For Free!
|
 |
« Reply #3 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.
|
|
|
|
|
Logged
|
|
|
|
|
Agent Moose
|
 |
« Reply #4 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.
|
|
|
|
|
Logged
|
Want to know how good your board is? Why not get it reviewed at Revolution X!

|
|
|
Sherry
SMF For Free Full Member
Offline
Posts: 120
|
 |
« Reply #5 on: December 28, 2008, 07:25:54 pm » |
|
Forum Url: http://pittcountymomsclub.smfforfree2.comCan someone take a look and see what is wrong with this code? I can't get it to work. <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>
|
|
|
|
|
Logged
|
|
|
|
simply sibyl
Global Moderator
Offline
Posts: 11806
On vacation until July 6th
|
 |
« Reply #6 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' />"
|
|
|
|
|
Logged
|
|
|
|
Sherry
SMF For Free Full Member
Offline
Posts: 120
|
 |
« Reply #7 on: December 28, 2008, 07:42:40 pm » |
|
Thanks. I'll try that.
|
|
|
|
|
Logged
|
|
|
|
Sherry
SMF For Free Full Member
Offline
Posts: 120
|
 |
« Reply #8 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... <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>
|
|
|
|
|
Logged
|
|
|
|
simply sibyl
Global Moderator
Offline
Posts: 11806
On vacation until July 6th
|
 |
« Reply #9 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.
|
|
|
|
« Last Edit: December 28, 2008, 08:02:31 pm by simply sibyl »
|
Logged
|
|
|
|
Sherry
SMF For Free Full Member
Offline
Posts: 120
|
 |
« Reply #10 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.
|
|
|
|
|
Logged
|
|
|
|
simply sibyl
Global Moderator
Offline
Posts: 11806
On vacation until July 6th
|
 |
« Reply #11 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. <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>
|
|
|
|
|
Logged
|
|
|
|
Andrew
SMF For Free Sponsors
Offline
Posts: 1088
Please do not PM for Support Questions
|
 |
« Reply #12 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: <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!
|
|
|
|
|
Logged
|
|
|
|
|
Pan
|
 |
« Reply #13 on: May 18, 2009, 08:52:26 pm » |
|
Can I leave the blank on the "OTHER" and "NEW NAME"?
|
|
|
|
|
Logged
|
|
|
|
Seldom Fail
SMF For Free Sponsors
Online
Posts: 801
Computers make very fast, very accurate mistakes.
|
 |
« Reply #14 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.
|
|
|
|
|
Logged
|
"Failure is not an option -- it comes bundled with Windows."
"Computer dating is fine, if you're a computer."
|
|
|
|
|
|