XeroCint Senior Member
   
Posts: 553 Status: Offline Gender: Male Location: Google Server Streams Age: 33 Joined:
pmmsnyahooaim | | [F] Prename (1st Jan 08 at 10:24pm UTC) | | | is there a way that I could have a code in which that you add onto the username. Basically I want all my users to have a tS: at the beginning of their username | |
|
|
Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | | Re: Prename (1st Jan 08 at 10:25pm UTC) | | of their username?
Or their displayname? | |
|
XeroCint Senior Member
   
Posts: 553 Status: Offline Gender: Male Location: Google Server Streams Age: 33 Joined:
pmmsnyahooaim | | Re: Prename (1st Jan 08 at 10:38pm UTC) | | displayname, sorry for the mix up | |
|
|
Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | | Re: Prename (1st Jan 08 at 10:44pm UTC) | | try this:
 Code: - <script>
- var pref = 'tS: '; //This is the prefix
-
- var a = document.getElementsByTagName('a');
- for(i=0;i<a.length;i++){
- if(a[i].href.match(/\/view_profile\//i) && a[i].href.match(/\/user\//)){
- a[i].innerHTML= pref + a[i].innerHTML
- }
- }
- </script>
Simply modify: var pref = ...
That should do it! | |
|
XeroCint Senior Member
   
Posts: 553 Status: Offline Gender: Male Location: Google Server Streams Age: 33 Joined:
pmmsnyahooaim | | Re: Prename (1st Jan 08 at 11:06pm UTC) | | Hehe, you're the greatest Wrighty | |
|
|
Michael Moderator
    
![[Avatar]](http://av.wservices.co.uk/av.png) Recoding the future Posts: 4,043 Status: Offline Gender: Male Location: UK Joined:
Additional Groups: Coding Team
  
pmvForum | | Re: Prename (1st Jan 08 at 11:13pm UTC) | | Glad it worked! | |
|
Marc vChat Developer
     I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 33 Joined:
Additional Groups: Coding Team
  
pmwww | | Re: [F] Prename (2nd Jan 08 at 3:06am UTC) | | Just so that people don't accidentally end up having double of the "tS:" in their name, you could try this:
 Code: - <script>
- var pref = 'tS: '; //This is the prefix
-
- var a = document.getElementsByTagName('a');
- for(i=0;i<a.length;i++){
- if(a[i].href.match(//view_profile//i) && a[i].href.match(//user//) && !a[i].innerHTML.match(new RegExp(pref,"i"))){
- a[i].innerHTML= pref + a[i].innerHTML
- }
- }
- </script>
| |
rroll.to— Shorten a link, rickroll your friends. |
|
XeroCint Senior Member
   
Posts: 553 Status: Offline Gender: Male Location: Google Server Streams Age: 33 Joined:
pmmsnyahooaim | | Re: [F] Prename (2nd Jan 08 at 3:41am UTC) | | | thanks I had to go through everyone in the forum that already had it (everyone -__-) and fix | |
|
|
Marc vChat Developer
     I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 33 Joined:
Additional Groups: Coding Team
  
pmwww | | Re: [F] Prename (2nd Jan 08 at 3:51am UTC) | | thanks I had to go through everyone in the forum that already had it (everyone -__-) and fix
Haha, sorry that I was a bit late. | |
rroll.to— Shorten a link, rickroll your friends. |
|
XeroCint Senior Member
   
Posts: 553 Status: Offline Gender: Male Location: Google Server Streams Age: 33 Joined:
pmmsnyahooaim | | Re: [F] Prename (2nd Jan 08 at 4:01am UTC) | | actually it doesn't work.. | |
|
|
Marc vChat Developer
     I <3 Rossy
Posts: 3,388 Status: Offline Gender: Male Location: Ontario, Canada Age: 33 Joined:
Additional Groups: Coding Team
  
pmwww | | Re: [F] Prename (2nd Jan 08 at 4:08am UTC) | | actually it doesn't work..
Thought it might not; hold on, I know what the error is.
EDIT: Hmm, for some reason when I copied it the first time it removed some backslashes.
 Code: - <script>
- var pref = 'tS: '; //This is the prefix
-
- var a = document.getElementsByTagName('a');
- for(i=0;i<a.length;i++){
- if(a[i].href.match(/\/view_profile\//i) && a[i].href.match(/\/user\//) && !a[i].innerHTML.match(new RegExp(pref,"i"))){
- a[i].innerHTML= pref + a[i].innerHTML
- }
- }
- </script>
There ya go. | |
rroll.to— Shorten a link, rickroll your friends. |
|