vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Prename - View Topic
Topic Rating: *****
Printable View
XeroCint
Senior Member
****

Posts: 553
Status: Offline
Gender: Male
Location: Google Server Streams
Age: 33
Joined:  
Reputation: 0%  


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]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Prename (1st Jan 08 at 10:25pm UTC)
of their username? {Shocked}

Or their displayname?
XeroCint
Senior Member
****

Posts: 553
Status: Offline
Gender: Male
Location: Google Server Streams
Age: 33
Joined:  
Reputation: 0%  


pmmsnyahooaim
Re: Prename (1st Jan 08 at 10:38pm UTC)
displayname, sorry for the mix up {Cheesy}

Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Prename (1st Jan 08 at 10:44pm UTC)
try this:

Code:
 
  1. <script>
  2. var pref = 'tS: '; //This is the prefix
  3.  
  4. var a = document.getElementsByTagName('a');
  5. for(i=0;i<a.length;i++){
  6.     if(a[i].href.match(/\/view_profile\//i) && a[i].href.match(/\/user\//)){
  7.         a[i].innerHTML= pref + a[i].innerHTML
  8.     }
  9. }
  10. </script>
 


Simply modify: var pref = ...

That should do it! {Smile}
XeroCint
Senior Member
****

Posts: 553
Status: Offline
Gender: Male
Location: Google Server Streams
Age: 33
Joined:  
Reputation: 0%  


pmmsnyahooaim
Re: Prename (1st Jan 08 at 11:06pm UTC)
Hehe, you're the greatest Wrighty {Cheesy}

Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Prename (1st Jan 08 at 11:13pm UTC)
Glad it worked! {Smile}
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


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:
 
  1. <script>
  2. var pref = 'tS: '; //This is the prefix
  3.  
  4. var a = document.getElementsByTagName('a');
  5. for(i=0;i<a.length;i++){
  6.     if(a[i].href.match(//view_profile//i) && a[i].href.match(//user//) && !a[i].innerHTML.match(new RegExp(pref,"i"))){
  7.         a[i].innerHTML= pref + a[i].innerHTML
  8.     }
  9. }
  10. </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:  
Reputation: 0%  


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


Reputation: 40%  


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. {Tongue Out}

rroll.to— Shorten a link, rickroll your friends.
XeroCint
Senior Member
****

Posts: 553
Status: Offline
Gender: Male
Location: Google Server Streams
Age: 33
Joined:  
Reputation: 0%  


pmmsnyahooaim
Re: [F] Prename (2nd Jan 08 at 4:01am UTC)
actually it doesn't work.. {Tongue Out}

Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 33
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: [F] Prename (2nd Jan 08 at 4:08am UTC)
 
actually it doesn't work.. {Tongue Out}


Thought it might not; hold on, I know what the error is. {Smile}

EDIT: Hmm, for some reason when I copied it the first time it removed some backslashes. {Unsure}

Code:
 
  1. <script>
  2. var pref = 'tS: '; //This is the prefix
  3.  
  4. var a = document.getElementsByTagName('a');
  5. for(i=0;i<a.length;i++){
  6.     if(a[i].href.match(/\/view_profile\//i) && a[i].href.match(/\/user\//) && !a[i].innerHTML.match(new RegExp(pref,"i"))){
  7.         a[i].innerHTML= pref + a[i].innerHTML
  8.     }
  9. }
  10. </script>
 


There ya go. {Smile}

rroll.to— Shorten a link, rickroll your friends.
 Printable View

All times are GMT+0 :: The current time is 4:23am
Page generated in 0.3006 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums