SMF For Free Support Forum
Signup For Free Forum
July 30, 2010, 06:18:46 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Change Username Across Board V5  (Read 1871 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 825


Do not PM me for Code Support or Request


View Profile
« 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!
« Last Edit: June 11, 2009, 09:44:06 am by Agent Moose » Logged

Check out Revolution X's Brand new Code Index!
BadgerGirl*naf
SMF For Free Full Member
*
Offline Offline

Posts: 135



View Profile WWW
« Reply #1 on: September 22, 2007, 10:33:48 am »

Great code once again... are u gonna add it to our site?
Logged

LaundryLady
Helpers
*
Offline Offline

Posts: 3230


Internet Challenged


View Profile
« 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 Offline

Posts: 1409


Thankyou for this great software SMF For Free!


View Profile
« 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
Moderator
*****
Offline Offline

Posts: 825


Do not PM me for Code Support or Request


View Profile
« 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

Check out Revolution X's Brand new Code Index!
Sherry
SMF For Free Full Member
*
Offline Offline

Posts: 119


View Profile
« Reply #5 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>
Logged
simply sibyl
Global Moderator
*
Offline Offline

Posts: 13697



View Profile WWW
« 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 Offline

Posts: 119


View Profile
« Reply #7 on: December 28, 2008, 07:42:40 pm »

Thanks. I'll try that.
Logged
Sherry
SMF For Free Full Member
*
Offline Offline

Posts: 119


View Profile
« 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.  Undecided

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> 
 
Logged
simply sibyl
Global Moderator
*
Offline Offline

Posts: 13697



View Profile WWW
« 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 Offline

Posts: 119


View Profile
« 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 Offline

Posts: 13697



View Profile WWW
« 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.

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>
Logged

Andrew
Helpers
*
Offline Offline

Posts: 1780


Andrew at your service


View Profile WWW
« 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:
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!
Logged

Pan
SMF For Free Member
*
Offline Offline

Posts: 33



View Profile WWW
« Reply #13 on: May 18, 2009, 08:52:26 pm »

Can I leave the blank on the "OTHER" and "NEW NAME"?
Logged
Seldom Fail
Helpers
*
Offline Offline

Posts: 1768


Please feel free to email me ;)


View Profile WWW
« 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



Pages: [1]
  Print  
 
Jump to:  



Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Hostgator Hosting
Page created in 0.366 seconds with 15 queries. (Pretty URLs adds 0.081s, 2q)