Separate Groups With Line Break?
Posted August 4th 2011, 4:25pm
Hi,

I want to separate the staff usergroups from the Clan usergroups.

Image

Maybe separate with a line break?

Thanks!!

And no, I will not copy/paste the tutorial/script, but I will post a link to this topic!! ^.^
φ
Posts: 122
Joined: July 23rd 2011, 11:00pm
Likes Received: 1
Separate Groups With Line Break?
Posted August 4th 2011, 4:47pm
Try this:

var x=document.getElementById('i_whosonline').nextSibling.lastChild;
x.removeChild(x.childNodes[4]);
jQuery(x.childNodes[3]).after(' ]<br>[ ');

Please note that this code is VERY specific to your board. If you change your groups, you may need to change the code.

Since this General Javascript Questions forum is members-only, it would be best if you don't copy ANYTHING from it. No links, no copy/paste, nothing. When this board was known as IPBDion™ a few months ago, I banned two members for copying things from members-only areas...
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Separate Groups With Line Break?
Posted August 4th 2011, 5:29pm
Hmm well I first tried to put it in the CSS, but nothing happened except it returned this message:

[align=center]CSS updated successfully.
Note :
Html tags generate errors in style sheets.
A correction has been made to delete html tags that you typed in the style sheet.[/align]


I also tried it in the Homepage Message, and it didn't work (obviously). And I tried a Javascript page too which was I also kind of dumb of me but which I did anyway - still elicited no response.
φ
Posts: 122
Joined: July 23rd 2011, 11:00pm
Likes Received: 1
Separate Groups With Line Break?
Posted August 4th 2011, 6:17pm
Hmm...I thought you would have known to add those lines to the script you created to change the stats. Guess not. So, go to this post:

http://www.diondesigns.org/t1812-?showpost-p2447

and add the three lines to that script. If you've been following these topics, you'll know how and where to add the three lines to that script. Consider this your first exam. ;)
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Separate Groups With Line Break?
Posted August 5th 2011, 8:10am
Well I'm actually using the "+20" script you provided me right now

But no matter, I checked out how you did it before and I thought of something like this.
<script type="text/javascript">
jQuery(function() {
var x=document.getElementById('i_whosonline').nextSibling.lastChild;
x.removeChild(x.childNodes[4]);
jQuery(x.childNodes[3]).after(' ]<br>[ ');
});
</script>


But of course, I didn't add any
x.innerHTML='__';

yet.

<script type="text/javascript">
jQuery(function() {
var x=document.getElementById('i_whosonline').nextSibling.lastChild;
x.removeChild(x.childNodes[4]);
jQuery(x.childNodes[3]).after(' ]<br>[ ');
x.innerHTML='__';
});
</script>



That didn't work either. Maybe you could drop me a hint? I hope you can see though that I am eager to learn how to do this script and I hope I can prove to you that I am willing to learn! ^.^
φ
Posts: 122
Joined: July 23rd 2011, 11:00pm
Likes Received: 1
Separate Groups With Line Break?
Posted August 5th 2011, 12:11pm
If you add the code you posted above:

<script type="text/javascript">

jQuery(function() {
    var x=document.getElementById('i_whosonline').nextSibling.lastChild;
    x.removeChild(x.childNodes[4]);
    jQuery(x.childNodes[3]).after(' ]<br>[ ');
});
</script>

to your homepage message, it should work. However, and this is important, this must be the FIRST script in the homepage message.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Separate Groups With Line Break?
Posted August 5th 2011, 1:18pm
It still doesn't seem to work. Here's a screenshot of what I think may be the problem. That line is too long, so the "var x" gets separated... could this influence the script?

Image
φ
Posts: 122
Joined: July 23rd 2011, 11:00pm
Likes Received: 1
Separate Groups With Line Break?
Posted August 5th 2011, 2:30pm
Actually the problem is that you used a "$" in the script, and it was converted to its HTML code equivalent by eToxic's idiotic character censor. Try this:

<script type="text/javascript">

jQuery(function() {
    var x=document.getElementById('i_whosonline').nextSibling.lastChild;
    x.removeChild(x.childNodes[4]);
    jQuery(x.childNodes[3]).after(' ]<br>[ ');
});
</script>
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Separate Groups With Line Break?
Posted August 5th 2011, 2:41pm
Alright! It works wonderfully :D Thanks Dion!!
And I'ved learned something too :P
φ
Posts: 122
Joined: July 23rd 2011, 11:00pm
Likes Received: 1
Re: Separate Groups With Line Break?
Posted February 4th 2012, 9:10pm
Dion said:
Actually the problem is that you used a "$" in the script, and it was converted to its HTML code equivalent by eToxic's idiotic character censor. Try this:

<script type="text/javascript">

jQuery(function() {
    var x=document.getElementById('i_whosonline').nextSibling.lastChild;
    x.removeChild(x.childNodes[4]);
    jQuery(x.childNodes[3]).after(' ]<br>[ ');
});
</script>


Hey Dion, how could I get this script to separate the first 3 groups (instead of first 2)?
φ
Posts: 122
Joined: July 23rd 2011, 11:00pm
Likes Received: 1
Re: Separate Groups With Line Break?
Posted February 4th 2012, 10:26pm
This should work:

<script type="text/javascript">

jQuery(function() {
    var x=document.getElementById('i_whosonline').nextSibling.lastChild;
    x.removeChild(x.childNodes[6]);
    jQuery(x.childNodes[5]).after(' ]<br>[ ');
});
</script>
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Separate Groups With Line Break?
Posted February 5th 2012, 9:54pm
Thanks, works perfectly :)
φ
Posts: 122
Joined: July 23rd 2011, 11:00pm
Likes Received: 1
Topic locked
12 posts

Who is online

Users browsing this forum: No registered users and 1 guest