vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: [F] Remove :: - View Topic
Topic Rating: *****
Printable View
This topic was locked 12th Mar 08 at 4:52pm by Michael
Alex Bailey
Senior Member
****

Posts: 503
Status: Offline
Gender: Male
Location: Uk
Age: 33
Joined:  
Reputation: 8%  


pmmsnaim
[F] Remove :: (11th Mar 08 at 5:52pm UTC)
Can i have a code to remove :: between new thread etc and have it spaced by 2px

ting-tong2k6@hotmail.com
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: Remove :: (11th Mar 08 at 6:17pm UTC)
Code:
 
  1. <script type="text/javascript">
  2. /*Remove  ::  from Menu
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var menu = document.getElementById('welcome_table').getElementsByTagName('td')[2];
  7.  
  8. menu.innerHTML = menu.innerHTML.replace(new RegExp("::","g"),'');
  9. </script>
 

rroll.to— Shorten a link, rickroll your friends.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Remove :: (11th Mar 08 at 6:19pm UTC)
Not in menu he said! {Wink}

In the space between new topic etc....

I'll try to get to this tonight! {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: Remove :: (11th Mar 08 at 6:20pm UTC)
 
Not in menu he said! {Wink}

In the space between new topic etc....

I'll try to get to this tonight! {Smile}


Oops, my bad. {Tongue Out}

rroll.to— Shorten a link, rickroll your friends.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Remove :: (11th Mar 08 at 7:42pm UTC)
try:

<script>
/*Remove :: from buttons
Usual Copyright stuff here!
Wrighty*/

for(i=0; i<get('td','tag').length;i++){
    if(get('td','tag')[i].innerHTML.match(/ :: /) && get('td','tag')[i].className.match(/title(1|2)/)){
        get(''td','tag')[i].innerHTML = get(''td','tag')[i].innerHTML.replace(/ :: /,' ');
    }
}
</script>


Untested, .... Also, Global Footer... Should work! {Smile}
Alex Bailey
Senior Member
****

Posts: 503
Status: Offline
Gender: Male
Location: Uk
Age: 33
Joined:  
Reputation: 8%  


pmmsnaim
Re: Remove :: (11th Mar 08 at 9:34pm UTC)
Nope doesnt work {Sad}

ting-tong2k6@hotmail.com
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: Remove :: (11th Mar 08 at 9:58pm UTC)
Code:
 
  1. <script>
  2. <!--
  3. /* Remove :: */
  4.  
  5. var td = get('td','tag');
  6. for(i=0;i<td.length;i++){
  7.     if(td[i].innerHTML.match(/::/) && td[i].className.match(/title(1|2)/)){
  8.         td[i].innerHTML = td[i].innerHTML.replace(/ ::/,'');
  9.     }
  10. }
  11. //-->
  12. </script>
 


{Smile}

rroll.to— Shorten a link, rickroll your friends.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Remove :: (11th Mar 08 at 10:01pm UTC)
No...



<script>
/*Remove :: from buttons
Usual Copyright stuff here!
Wrighty*/

for(i=0; i<get('td','tag').length;i++){
    if(get('td','tag')[i].innerHTML.match(/ :: /) && get('td','tag')[i].className.match(/title(1|2)/)){
        get('td','tag')[i].innerHTML = get('td','tag')[i].innerHTML.replace(/ :: /g,' ');
    }
}
</script>
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: Remove :: (11th Mar 08 at 10:05pm UTC)
 
No...



<script>
/*Remove :: from buttons
Usual Copyright stuff here!
Wrighty*/

for(i=0; i<get('td','tag').length;i++){
    if(get('td','tag')[i].innerHTML.match(/ :: /) && get('td','tag')[i].className.match(/title(1|2)/)){
        get('td','tag')[i].innerHTML = get('td','tag')[i].innerHTML.replace(/ :: /g,' ');
    }
}
</script>


You had a quote instead of an apostrophe in one spot, but I decided to rewrite the code, why is mine wrong? {Tongue Out}

rroll.to— Shorten a link, rickroll your friends.
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Remove :: (11th Mar 08 at 10:31pm UTC)
You aren't removing them all, it's longer and also contains a variable. Mine is better and works! {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: Remove :: (11th Mar 08 at 10:40pm UTC)
 
You aren't removing them all, it's longer and also contains a variable. Mine is better and works! {Tongue Out}


It contains a variable because the get() function doesn't cache, thus every time you use get(), you're recreating the array of the hundred-and-something td's on the page; thus a variable is much more efficient. {Wink}

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

Posts: 503
Status: Offline
Gender: Male
Location: Uk
Age: 33
Joined:  
Reputation: 8%  


pmmsnaim
Re: Remove :: (12th Mar 08 at 3:57pm UTC)
Lol code battle going on {Tongue Out} Anyway thanks for the code. It worked. XD

ting-tong2k6@hotmail.com
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Remove :: (12th Mar 08 at 4:51pm UTC)
Yey!

I win!

Smiley
 Printable View

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