vForums Support > Programming & Coding :: Code Requests & Support :: > [F]Profile Spoiler Area

[F]Profile Spoiler Area - Posted By dog199200 (dog199200) on 18th Apr 08 at 4:14pm
OK this shouldn't be hard, but i need a code that will add an edit area to the modify profile called E-Stuff, and then when they put something in here is calls a spoiler drop down at the top of the sig.

Basically if this help, i need s system that adds an area in the modify profile area that when you add stuff to it it will add to a drop down at the top of the sig, but also if possible (not required) can you make it so taht is they dont have anything in the area then the drop down doesn't show.

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 18th Apr 08 at 4:52pm
The options will probably have to seperated by a comma (when entering them!). But other than that, should be fine! ^_^

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 18th Apr 08 at 5:03pm
ok np, but for the description of the field you might want to add that in {Smile}

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 20th Apr 08 at 6:50pm
bump

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 21st Apr 08 at 9:48pm
I know of this. Been very busy with my new camera. So please, bare with me and wait for once in a while! {Smile}

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 22nd Apr 08 at 1:18am
i am waiting...and i understand, i just bump in case someone else wants to take a crack at it

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 25th Apr 08 at 4:48pm
Try this. It's a hell of a long code!!!

Code:
 
  1. <script>
  2. /*Profile Spoiler Area in Signature
  3. Created By Wrighty
  4. support.virtualforums.co.uk*/
  5.  
  6. var d;
  7. function save(){
  8.     if(!f.vf_mp.value == "" ){
  9.         f.hidden.value = '{w_spoiler:'+f.vf_mp.value+'}' + f.hidden.value;
  10.     }
  11. }
  12. if(document.profile_form && document.profile_form.hidden){
  13.     var f  = document.profile_form;
  14.     r = f.avatar_height.parentNode.parentNode.parentNode.parentNode.insertRow(8);
  15.     r.insertCell(0).innerHTML = '<font size=2>Personal Spoiler:</font>';
  16.     r.insertCell(1).innerHTML = '<input type="text" size="25" name="vf_mp">';
  17.     r.insertCell(2).innerHTML = '<font size=1>Seperate each item by a comma.</font>';
  18.     f.vf_mp.value=(f.hidden.value.match(/{w_spoiler:(.+?)}/))?RegExp.$1:'';
  19.     f.hidden.value = f.hidden.value.replace(/{w_spoiler:(.+?)}/,'');
  20.     if(document.addEventListener){
  21.         f.addEventListener('submit', save,false);
  22.     }else{
  23.         f.attachEvent('onsubmit', save);
  24.     }
  25. }
  26. if(location.href.match(/view/)) {
  27.     var x=document.getElementsByTagName('tr');
  28.     for(i=0;i<x.length;i++){
  29.         if(x[i].innerHTML.match(/hidden_vars/)){
  30.             var s = x[i].getElementsByTagName('span');
  31.             for(ui=0;ui<s.length;ui++){
  32.                 if(s[ui].id.match(/hidden_vars/)){
  33.                     d = s[ui];
  34.                 }
  35.             }
  36.             for(z=0;z<x[i].getElementsByTagName('td').length;z++){
  37.                 if((x[i].getElementsByTagName('td')[z].className.match(/signature/) || x[i].getElementsByTagName('td')[z].getElementsByTagName('div')[0] &&  x[i].getElementsByTagName('td')[z].getElementsByTagName('div')[0].id.match(/signature/)) && d.innerHTML.match(/{w_spoiler:(.+?)}/) && RegExp.$1 != ''){
  38.                     var d_ub = document.createElement('SELECT');
  39.                     var w_ub = [];
  40.                     w_ub = RegExp.$1.split(/,/);
  41.                     for (ar=0;ar<w_ub.length;ar++) {
  42.                         d_ub.options[d_ub.options.length] = new Option(w_ub[ar]);
  43.                     }
  44.                     if(x[i].getElementsByTagName('td')[z].getElementsByTagName('div')[0]){
  45.                         x[i].getElementsByTagName('td')[z].getElementsByTagName('div')[0].insertBefore(d_ub, x[i].getElementsByTagName('td')[z].getElementsByTagName('div')[0].firstChild);
  46.                     }else{
  47.                         x[i].getElementsByTagName('td')[z].insertBefore(d_ub, x[i].getElementsByTagName('td')[z].getElementsByTagName('font')[0]);
  48.                     }
  49.                 }
  50.             }
  51.             break;
  52.         }
  53.     }
  54. }
  55. </script>
 


Global Footer

I'm 99% sure that's what you want... But if not, we can go from it at least

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 25th Apr 08 at 9:10pm
{Smile} its not showing up in mine

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 28th Apr 08 at 9:11pm
ok use this code, edit your profile, don't enter any information into any EXTRA boxes (if it's already there, delete it!)

and then save.
Then remove this code!

<script>
get('hidden','name')[0].value = '';
</script>

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 29th Apr 08 at 1:15am
i'm... i cant find where taht is

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 29th Apr 08 at 6:44am
add that code , then remove it...

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 29th Apr 08 at 7:40pm
ah ok

Edit:

ok use this code

<script>
get('hidden','name')[0].value = '';
</script>

and place it in the global footers, then edit my profile and remove any text in the spoiler box, then save and the remove this cide

<script>
get('hidden','name')[0].value = '';
</script>

right? if so that doesn't work, the spoiler tag still only shows in melody's sig... (Thats when i go back and re add the text)

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 6th May 08 at 4:08am
bump

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 7th May 08 at 11:04pm
bump

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 12th May 08 at 2:31am
bump

Re: Profile Spoiler Area - Posted By Marc (cr0w) on 12th May 08 at 4:21am
Could I get a link to the user's sig where the problem is occurring? {Smile}

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 12th May 08 at 4:29am
here is the thread:

http://deluxeanimeforum.vforums.co.uk/board/Introductions/topic/5/action/view_topic/hello-all.---//page/2/#reply-56

here is her profile:

http://deluxeanimeforum.vforums.co.uk/action/view_profile/user/melody/

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 15th May 08 at 4:56pm
Try this: {Grin}

<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>


Replace the last one with that.

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 15th May 08 at 5:35pm
ok the input box for it is still in the modify profile area, but the spolier box doesn't show up anywhere.

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 15th May 08 at 6:10pm
You have no signature. This is needed for the code to work.

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 16th May 08 at 12:51am
ok now it only shows when viewing the persons profile...

Re: Profile Spoiler Area - Posted By Michael (wrighty) on 16th May 08 at 3:31pm
put it at the top of GLOBAL FOOTER? {Unsure}

Re: Profile Spoiler Area - Posted By dog199200 (dog199200) on 17th May 08 at 12:48am
{Smile} ok taht works ty so much