Advertise Here

Author Topic: [code] Membergroup Changes Username  (Read 3022 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[code] Membergroup Changes Username
« on: June 22, 2009, 11:08:28 am »
Footers:
Code: [Select]
<script type="text/javascript">
var memColor = new Array();
memColor[memColor.length] = ["MEMBERGROUP NAME","START HTML","END HTML"];

//Created by Agent Moose (revolutionx.smfforfree3.com)
if(location.href.match("topic,")){
for(f=0;f<memColor.length;f++){
$("div.smalltext").each(function(){
if(this.innerHTML.match(memColor[f][0] + "<br")){
$(this).prev().children().html(memColor[f][1] + $(this).prev().children().html() + memColor[f][2]);
};});};};
</script>
Original Request: http://revolutionx.smfforfree3.com/index.php/topic,578.0.html

This code changes the username of a person according to which membergroup they are in.

MEMBERGROUP = The membergroup name.
START HTML = The First tag for HTML
END HTML = The End tags for HTML.

Here are two example for editing the code:
Code: [Select]
memColor[memColor.length] = ["Newcomer","<font color='red'>","</font>"];
memColor[memColor.length] = ["Starter","<b><i>","</i></b>"];

To add more membergroups that will change the user name, add more of these lines:
Code: [Select]
memColor[memColor.length] = ["MEMBERGROUP NAME","START HTML","END HTML"];
Enjoy :)
« Last Edit: June 25, 2009, 11:35:12 am by Agent Moose »
Check out Revolution X's Brand new Code Index!

Offline Andrew

  • Helpers
  • *
  • Posts: 2060
  • Andrew at your service
    • View Profile
    • Alabama Weather Prediction

  • Total Badges: 32
    Badges: (View All)
    10 Poll Votes Level 6 Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [code] Membergroup Changes Username
« Reply #1 on: June 22, 2009, 11:19:46 am »
You forgot something ;)

To add more membergroups that will change the username, add more of these lines:
Code: [Select]
memColor[memColor.length] = ["MEMBERGROUP NAME","START HTML","END HTML"];

Offline JayB

  • SMF For Free Member
  • *
  • Posts: 60
  • Please do not PM for support
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [code] Membergroup Changes Username
« Reply #2 on: June 23, 2009, 03:12:58 am »
Forum Url: http://ThePogoHideout.mysmf.com


Great code, using it.  :)

Offline мσנσвσנσ82

  • SMF For Free Sr. Member
  • *
  • Posts: 310
    • View Profile
    • Darkilscape

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [code] Membergroup Changes Username
« Reply #3 on: June 27, 2009, 07:34:43 am »
Forum Url: http://darkilscape.smfforfree.com
Argh not working now.

This is my code.
Code: [Select]
<script type="text/javascript">
var memColor = new Array();
memColor[memColor.length] = ["Administrator","<img src='http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/mod_gold.gif' /><font color='#F7FF0B'>","</font>"];
memColor[memColor.length] = ["Global Moderator","<img src='http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/mod_silver.gif' /><font color='#A2A2A2'>","</font>"];
memColor[memColor.length] = ["Moderator","<img src='http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/mod_silver.gif' /><font color='#A2A2A2'>","</font>"];
memColor[memColor.length] = ["V.I.P Member","<img src='' /><font color='#F6FF07'>","</font>"];
memColor[memColor.length] = ["Donator","<img src='' /><font color='#FF0000'>","</font>"];


//Created by Agent Moose (revolutionx.smfforfree3.com)
if(location.href.match("topic,")){
for(f=0;f<memColor.length;f++){
$("div.smalltext").each(function(){
if(this.innerHTML.match(memColor[f][0] + "<br")){
$(this).prev().children().html(memColor[f][1] + $(this).prev().children().html() + memColor[f][2]);
};});};};
</script>



Offline Seldom Fail

  • Helpers
  • *
  • Posts: 2082
  • Helping for 3 years! :)
    • View Profile
    • My Site!

  • Total Badges: 26
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Apple User Search Poll Voter
Re: [code] Membergroup Changes Username
« Reply #4 on: June 27, 2009, 08:50:49 am »
I see the code fine on your forum.

Try disabling JavaScript in your browser.

To disable Javascript in Firefox
Tools > Options >  Content >  take checkmark out of  "enable Javascript"  in Firefox

To disable Javascript in Internet Explorer:
From the Tools menu, choose Internet Options... .
Click the Security tab.
Click Custom Level... .
Scroll to the "Scripting" section of the list. Click Disable or Enable.
Close and restart your browser.
       
<--- Donate to SMF For Free! :D

Offline мσנσвσנσ82

  • SMF For Free Sr. Member
  • *
  • Posts: 310
    • View Profile
    • Darkilscape

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [code] Membergroup Changes Username
« Reply #5 on: June 27, 2009, 09:02:11 am »
Just tried it with iExplorer and Firefox.
Negative



Offline Seldom Fail

  • Helpers
  • *
  • Posts: 2082
  • Helping for 3 years! :)
    • View Profile
    • My Site!

  • Total Badges: 26
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Apple User Search Poll Voter
Re: [code] Membergroup Changes Username
« Reply #6 on: June 27, 2009, 09:06:14 am »
Ahh ok sorry I read what you were asking about wrong... :P one sec I'll try to figure something out :)
<--- Donate to SMF For Free! :D

Offline мσנσвσנσ82

  • SMF For Free Sr. Member
  • *
  • Posts: 310
    • View Profile
    • Darkilscape

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [code] Membergroup Changes Username
« Reply #7 on: June 27, 2009, 09:07:09 am »
Ok thx.
Take your time. It's only 12:07 midnight  :P



Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [code] Membergroup Changes Username
« Reply #8 on: June 27, 2009, 11:40:59 am »
мσנσвσנσ82 

You need to go through your footer codes  and correct all errors in it before adding anything else.   
Im seeing alot of problems in there

These are only SOME of the problems:

There are  many codes that the scripts are not closed out with a  </script>
The  "Reason for Edit" Code is in there twice
There is an extra </script> just above the "Disable Mouse Right Click" script.
This needs to be removed at the bottom of the FOOTER:
Code: [Select]
<script type='text/javascript'>
Looks like your codes are all jumbled up together.    Your best move is to do a backup of your footer info  (copy/save it to notepad or something)  then remove all of it.    Put your codes back in ONE code at a time and make sure each one is complete and correct and works properly before you add another one.

Need to be very careful putting codes in there -  could make your forum unaccessible plus these errors are removing the copyrite information that has to be there.   The screwed up scripts are making IE's phishing filter report it as a suspicious site.
« Last Edit: June 27, 2009, 01:04:35 pm by simply sibyl »

Offline мσנσвσנσ82

  • SMF For Free Sr. Member
  • *
  • Posts: 310
    • View Profile
    • Darkilscape

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [code] Membergroup Changes Username
« Reply #9 on: June 27, 2009, 05:47:29 pm »
Just saved all Footers and removed them.
Just added the code and nothing :(

Code: [Select]
<script type="text/javascript">
var memColor = new Array();
memColor[memColor.length] = ["Administrator","<img src='http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/mod_gold.gif' /><font color='#F7FF0B'>","</font>"];
memColor[memColor.length] = ["Global Moderator","<img src='http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/mod_silver.gif' /><font color='#A2A2A2'>","</font>"];
memColor[memColor.length] = ["Moderator","<img src='http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/mod_silver.gif' /><font color='#A2A2A2'>","</font>"];
memColor[memColor.length] = ["V.I.P Member","<img src='' /><font color='#F6FF07'>","</font>"];
memColor[memColor.length] = ["Donator","<img src='' /><font color='#FF0000'>","</font>"];


//Created by Agent Moose (revolutionx.smfforfree3.com)
if(location.href.match("topic,")){
for(f=0;f<memColor.length;f++){
$("div.smalltext").each(function(){
if(this.innerHTML.match(memColor[f][0] + "<br")){
$(this).prev().children().html(memColor[f][1] + $(this).prev().children().html() + memColor[f][2]);
};});};};
</script>



 

Related Topics

  Subject / Started by Replies Last post
50 Replies
12956 Views
Last post July 30, 2007, 09:58:16 am
by Agent Moose
27 Replies
9557 Views
Last post May 19, 2009, 07:33:01 am
by Seldom Fail
19 Replies
8439 Views
Last post January 01, 2010, 07:50:30 pm
by chan14
10 Replies
3858 Views
Last post February 03, 2009, 07:27:34 am
by TbG_SpEcTeR_
0 Replies
1440 Views
Last post June 27, 2009, 07:32:26 am
by мσנσвσנσ82