vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Database of Codes/Hacks/Mods :: Code Submissions :: Profile Spoiler Area - View Topic
Topic Rating: *****
Printable View
Michael
Moderator
*****

[Avatar]
Recoding the future

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

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Profile Spoiler Area (18th May 08 at 3:39pm UTC)
This code will allow your members to choose some 'text' to show in their sig. Each thing will appear as an option in a drop down. Was requested for 'profile spoiler' or something like that.

Use for anything you want! {Smile}
Possibly RPG items? {Unsure}

Enjoy

<script>
/*Profile Spoiler Area in Signature
Created By Wrighty
support.virtualforums.co.uk*/

var d;
function save(){
    if(!f.vf_mp.value == "" ){
        f.hidden.value = '{w_spoiler:'+f.vf_mp.value+'}' + f.hidden.value;
    }
}
if(document.profile_form && document.profile_form.hidden){
    var f = document.profile_form;
    r = f.avatar_height.parentNode.parentNode.parentNode.parentNode.insertRow(8);
    r.insertCell(0).innerHTML = '<font size=2>Personal Spoiler:</font>';
    r.insertCell(1).innerHTML = '<input type="text" size="25" name="vf_mp">';
    r.insertCell(2).innerHTML = '<font size=1>Seperate each item by a comma.</font>';
    f.vf_mp.value=(f.hidden.value.match(/{w_spoiler:(.+?)}/))?RegExp.$1:'';
    f.hidden.value = f.hidden.value.replace(/{w_spoiler:(.+?)}/,'');
    if(document.addEventListener){
        f.addEventListener('submit', save,false);
    }else{
        f.attachEvent('onsubmit', save);
    }
}
if(location.href.match(/view/)) {
    var num = 0;
    var x = get('tr','tag');
    for(re=0;re<x.length;re++){
        if(x[re].innerHTML.match(/hidden_vars/) && x[re].innerHTML.match(/w_spoiler/)){
            var s = x[re].getElementsByTagName('span');
            for(ui=0;ui<s.length;ui++){
                if(s[ui].id.match(/hidden_vars/)){
                    d = s[ui];
                }
            }
            for(z=0;z<x[re].getElementsByTagName('td').length;z++){
                if(d.innerHTML.match(/{w_spoiler:(.+?)}/) && RegExp.$1 != ''){
                    var d_ub = document.createElement('SELECT');
                    var w_ub = [];
                    w_ub = RegExp.$1.split(/,/);
                        for (ar=0;ar<w_ub.length;ar++) {
                            d_ub.options[d_ub.options.length] = new Option(w_ub[ar]);
                        }
                        if(x[re].getElementsByTagName('td')[z].className.match(/signature/) && num != 0){
                            x[re].getElementsByTagName('td')[z].insertBefore(d_ub, x[re].getElementsByTagName('td')[z].getElementsByTagName('font')[0]);
                            break;
                        }else if(x[re].getElementsByTagName('td')[z].getElementsByTagName('div')[0] && x[re].getElementsByTagName('td')[z].getElementsByTagName('div')[0].id.match(/signature/)){
                            x[re].getElementsByTagName('td')[z].getElementsByTagName('div')[0].insertBefore(d_ub, x[re].getElementsByTagName('td')[z].getElementsByTagName('div')[0].firstChild);
                    break;
                    }
                }
            }
            num++;
        }
    }
}
</script>


Global Footer
 Printable View

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