vForums Support > Programming & Coding :: Code Requests & Support :: > [F] Remove ::

[F] Remove :: - Posted By Alex Bailey (system) on 11th Mar 08 at 5:52pm
Can i have a code to remove :: between new thread etc and have it spaced by 2px

Re: Remove :: - Posted By Marc (cr0w) on 11th Mar 08 at 6:17pm
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>
 

Re: Remove :: - Posted By Michael (wrighty) on 11th Mar 08 at 6:19pm
Not in menu he said! {Wink}

In the space between new topic etc....

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

Re: Remove :: - Posted By Marc (cr0w) on 11th Mar 08 at 6:20pm
 
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}

Re: Remove :: - Posted By Michael (wrighty) on 11th Mar 08 at 7:42pm
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}

Re: Remove :: - Posted By Alex Bailey (system) on 11th Mar 08 at 9:34pm
Nope doesnt work {Sad}

Re: Remove :: - Posted By Marc (cr0w) on 11th Mar 08 at 9:58pm
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}

Re: Remove :: - Posted By Michael (wrighty) on 11th Mar 08 at 10:01pm
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>

Re: Remove :: - Posted By Marc (cr0w) on 11th Mar 08 at 10:05pm
 
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}

Re: Remove :: - Posted By Michael (wrighty) on 11th Mar 08 at 10:31pm
You aren't removing them all, it's longer and also contains a variable. Mine is better and works! {Tongue Out}

Re: Remove :: - Posted By Marc (cr0w) on 11th Mar 08 at 10:40pm
 
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}

Re: Remove :: - Posted By Alex Bailey (system) on 12th Mar 08 at 3:57pm
Lol code battle going on {Tongue Out} Anyway thanks for the code. It worked. XD

Re: Remove :: - Posted By Michael (wrighty) on 12th Mar 08 at 4:51pm
Yey!

I win!

Smiley