Can't seem to get the correct subscript to this...
Posted January 15th 2012, 10:16am
Image
here is the snippet:

$(function() {
    var x=$('fieldset.frm-set dl dd')[3];
    if(x) {x.innerHTML=x.innerHTML.replace(/Allow visitor messages on my profile :/,'Allow comments on my profile');}
});


I've tried subscripts 0-20 lmao doesn't seem to work :(

though when I use this snippet:


$(function() {
    var x=$('.main .main-content.frm')[0];
    if(x) {x.innerHTML=x.innerHTML.replace(/Allow visitor messages on my profile :/,'Allow comments on my profile');}
});


it works, though, it messes up the BBCode inserting for some reason... Any idea's?
φ
Posts: 237
Joined: October 29th 2011, 11:00pm
Location: england, united kingdom, stoke on trent
Likes Given: 20
Likes Received: 4
Can't seem to get the correct subscript to this...
Posted January 15th 2012, 1:27pm
You're approaching it from the wrong direction. ;)

The unique parts of each field are the names of the radio buttons. So you need to select a button and go up the DOM tree to the element you want. Something like:

document.getElementsByName('profilemsgs')[0].parentNode.parentNode.parentNode

would select the DL tag that contains the entire "Allow visitor messages on my profile" block.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Re: Can't seem to get the correct subscript to this...
Posted January 15th 2012, 3:55pm
something like this

$(function() {

    var x=document.getElementsByName('profilemsgs')[0].parentNode.parentNode.parentNode;
    if(x) {x.innerHTML=x.innerHTML.replace(/Allow visitor messages on my profile :/,'All');}
});
?

Btw, love the revamp of the buttons ;)

OK, I've noticed it disables a few things on the forum, notably the login box and the user information toggle lol
φ
Posts: 237
Joined: October 29th 2011, 11:00pm
Location: england, united kingdom, stoke on trent
Likes Given: 20
Likes Received: 4
Can't seem to get the correct subscript to this...
Posted January 15th 2012, 5:10pm
You have a PunBB board, so I'd suggest modifying the page in the profile_add_body template. Look for this:

<!-- BEGIN switch_profile_advanced -->
<dl>

and I think you will know what to change. ;)
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Can't seem to get the correct subscript to this...
Posted January 15th 2012, 5:25pm
Oh god, I'm dumb lmao
φ
Posts: 237
Joined: October 29th 2011, 11:00pm
Location: england, united kingdom, stoke on trent
Likes Given: 20
Likes Received: 4

Who is online

Users browsing this forum: No registered users and 0 guests