Immettere Format esterno


In corso Immettere Format esterno

Messaggio Da Primahs il Sab 9 Giu 2018 - 14:20

Buongiorno!

Premettendo che so dell'esistenza del server gestito da Niko riguardo la creazione di Form, ho voluto usare una piattaforma estranea a Forumattivo perché mi sembrava più completa. Però ora non so come fare ad immettere il format in una sezione.

Il sito usato è questo: https://eu.phishing-site.www

Ho provato a metterlo nella descrizione di sezione e mi esce il link da premere, per caso dovrei usare i Templates?


Grazie mille!
avatar
Primahs
****

Sesso : Maschio
Età : 19
Messaggi : 306
Località : Monza


Primahs è stato ringraziato dall'autore di questo topic.

In corso Re: Immettere Format esterno

Messaggio Da MattiaDes il Sab 9 Giu 2018 - 21:12

Ciao, con "format" intendi formulario (form), giusto?

Se sì, riuscire ad integrarne uno creato esternamente è molto difficile e non in tutti i casi è possibile.

Se vuoi provare un tipo di form diverso, prova questo codice:


Codice:
<div class="panel introduction"><span class="corners-top"></span><div class="h3">Competizione</div><div class="mes-txt">
 
  <br/> testo
  <br/><br/>

<form data-mode="nouveau_sujet" data-arg="6" data-subject="Competizione Horror Words | %_{USERNAME} " action="#" id="mon_formulaire" style="padding: 10px;">
  <label>» <b>Nickname</b>: <input type="text" name="username" maxlength="30" style="width: 200px;" required/></label><br /><br/>
  <label>» <b>Link Immagine</b>: <input type="text" name="testo" style="width: 600px;" required/></label><br/>
 
  <br/><center><input type="submit" value="Inviare" class="button"/></center>
 
<textarea class="message">» [b]Nome Competizione[/b]: testo

» [b]Nome[/b]: %_{USERNAME}

» [b]Link Immagine[/b]: %_{TESTO}
 
  [center][img]%_{TESTO}[/img][/center]</textarea></form>
 
 
</div></div>
     
     
    <script type="text/javascript">
    document.addEventListener("DOMContentLoaded",function(e){
    var mon_formulaire=new faForm("mon_formulaire");
    });
    </script>

<script>
  "use strict";
if(faForm===undefined){
var faForm=function(form_id,options_object){
    try{
        this.progressionStatus=1;/*Pending*/
        /*prévision...*/
        this.values={};
        /*erreurs*/
        this.exceptionCodes={
            NO_FORM_ID:1,
            FORM_ID_NOT_FOUND:2,
            TEXTAREA_MESSAGE_NOT_FOUND:3,
            FORM_MODE_NOT_VALID:4,
            FORM_ARG_NOT_VALID:5,
            FIELD_NOT_SUPPORTED:6,
            EMPTY_MESSAGE:7,
            AJAX_ERROR:8,
            NO_VALID_SESSION:9
        };
        this.progressionStatusCodes={
            PENDING:1,
            LOADSTART:1<<1,
            PROGRESS:1<<2,
            LOAD:1<<3,
            LOADEND:1<<4,
            ERROR:1<<5,
            TIMEOUT:1<<6,
            ABORT:1<<7
        };
        this.genProgressionBarStatusClasses=function(){
            if(!obj.prb)return false;
            var cNl=Object.keys(obj.progressionStatusCodes),rc=obj.progressionStatusCodes;
            for(var i in cNl){
                (obj.progressionStatus&rc[cNl[i]])===rc[cNl[i]]?obj.addClassName.call(obj.prb,cNl[i].toLowerCase()):obj.delClassName.call(obj.prb,cNl[i].toLowerCase());
            }
            return true;
        };
        this.mgntEx=function(e){
            if(e.name=='formException'){
                    alert(e.message);
                }else{
                    console.log(e);
                    var t='/!\\ faForm ['+obj.form_id+'] :';
                    if(e.name)t+='\nException: '+e.name;
                    if(e.message)t+='\n'+e.message;
                    alert(t)
                }
        };
        this.formException=function(ERR_ID,error){
            var fl='/!\\ faForm ['+obj.form_id+'] :\n';
            var error=error||{};
            switch(ERR_ID){
                case obj.exceptionCodes.NO_FORM_ID:
                    fl='/!\\ faForm :\nAucun identifiant n\'a été fourni au constructeur';
                    break;
                case obj.exceptionCodes.FORM_ID_NOT_FOUND:
                    fl+='Le formulaire est introuvable.';
                    break;
                case obj.exceptionCodes.TEXTAREA_MESSAGE_NOT_FOUND:
                    fl+='ne dispose pas d\'une balise textarea avec la classe "message" assignée';
                    break;
                case obj.exceptionCodes.FORM_MODE_NOT_VALID:
                    fl+='ne dispose pas d\'une valeur reconnue pour l\'attribut data-mode';
                    break;
                case obj.exceptionCodes.FORM_ARG_NOT_VALID:
                    fl+='ne dispose pas d\'un attribut data-arg, ou ce dernier n\'est pas valide pour le mode '+obj.mode;
                    break;
                case obj.exceptionCodes.FIELD_NOT_SUPPORTED:
                    fl+=error.message;
                    break;
                case obj.exceptionCodes.EMPTY_MESSAGE:
                    fl+='ne peut envoyer un message vide !';
                    break;
                case obj.exceptionCodes.AJAX_ERROR:
                    fl+='une exception AJAX a été levée:\n'+error.message;
                    break;
                case obj.exceptionCodes.NO_VALID_SESSION:
                    fl+='utilise un mode nécessitant une session valide, êtes-vous connecté ?';
            }
            return {name:'formException',message:fl}
        };
        this.format=function(txt){
            var txt=txt||obj.message;
            if(typeof txt===undefined||txt===null||!txt.trim().length)throw new obj.formException(obj.exceptionCodes.EMPTY_MESSAGE);
            txt=txt.replace(/%_\{([A-Z0-9_-]+(\[\])?)\}/g,function(m,m1){
                var nom=m1.toLowerCase(),a=obj.form.querySelectorAll('[name="'+nom+'"]'),b=[],i,r,t;
                if(!a||!a.length)return '%_{Erreur:'+nom+' est introuvable}';
                var tagname=a[0].tagName.toLowerCase();
                switch(tagname){
                    case 'select':
                        a=a[0].querySelectorAll('option');
                        for(i=0;i<a.length;i++){
                            if(a.item(i).selected)b.push(a.item(i).value);
                        }
                        r=b;
                        break;
                    case 'textarea':
                        r=a[0].value;
                        break;
                    case 'input':
                        switch(a[0].type.toLowerCase()){
                            case 'text':
                            case 'tel':
                            case 'url':
                            case 'email':
                            case 'hidden':
                            case 'color':
                            case 'range':
                            case 'password':
                            case 'number':
                                r=a[0].value;
                                break;
                            case 'radio':
                            case 'checkbox':
                                for (i in a){
                                    if(a[i].checked)b.push(a[i].value);
                                }
                                r=b;
                                break;
                            default:
                                console.log('FIELD_NOT_SUPPORTED (INPUT TYPE):',a);
                                throw new obj.formException(obj.exceptionCodes.FIELD_NOT_SUPPORTED,{message:'l\élément input[name='+nom+'] est d\'un type non supporté'});
                        }
                        break;
                    default:
                        console.log('FIELD_NOT_SUPPORTED:',a);
                        throw new obj.formException(obj.exceptionCodes.FIELD_NOT_SUPPORTED,{message:'l\élément '+tagname+'[name='+nom+'] est une balise non supportée'});
                }
                obj.values[m1.toLowerCase()]=r;
                /*jointures tableaux,replis ...*/
                r=Array.isArray(r)&&r.length?r.join((t='blue',t=a[0].getAttribute('data-join'),(t!=null)?t:', ')):r&&r.length?r:(t=a[0].getAttribute('data-repli'),(t!=null&&t.length)?t:'');
                return r;
            });
            return txt;
        };
        this.addClassName=function(className){
            var c=this.className.split(/\s+/g)||[];
            if(c.indexOf(className)!=-1)return;
            this.className=c.push(className)&&c.join(' ')
        };
        this.delClassName=function(className){
            var a,c=this.className.split(/\s+/g);
            if(!c||(a=c.indexOf(className))==-1)return;
            this.className=c.splice(a,1)&&c.join(' ')
        };
        this.genFormURLEncoded=function(o){
            var k=Object.keys(o),q=[];
            for(var i=0;i<k.length;i++){
                q.push(encodeURIComponent(k[i])+'='+encodeURIComponent(obj.format(o[k[i]])));
                }
            return q.join('&');
        }
        this.req=function(){
            var arg,xhr,subject,username="ospitedsfas",message;
            obj.xhr=xhr=new XMLHttpRequest();
            xhr.addEventListener('error',obj.ajax_error,false);
            xhr.addEventListener('abort',obj.ajax_abort,false);
            xhr.addEventListener('timeout',obj.ajax_timeout,false);
            xhr.addEventListener('progress',obj.ajax_progress,false);
            xhr.addEventListener('loadstart',obj.ajax_loadstart,false);
            xhr.addEventListener('load',obj.ajax_load,false);
            xhr.addEventListener('loadend',obj.ajax_loadend,false);
            /*Le formatage du sujet est permis mais tous les caractères
            blancs autre que l'espace \u0020 sont supprimés.
            */
            if(obj.subject)subject=obj.format(obj.subject).replace(/[\f\n\r\t\v\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,'');
            if(obj.arg)arg=obj.format(obj.arg).replace(/[\f\n\r\t\v\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,'');
            if(obj.message)message=encodeURIComponent(obj.format());
            switch(this.mode){
                /*modes pris en charge*/
                case 'customizable':
                case 'parametrable':
                    var t=this.modeX,params=t.parametres?this.genFormURLEncoded():null,url=obj.format((t.mode.toUpperCase()=='GET'&¶ms)?t.url+'?'+params:t.url);
                    xhr.open(t.mode,url,t.sync!=null?t.sync:true);
                    if(t.responseType)xhr.responseType=t.responseType;
                    xhr.timeout=t.timeout||0;
                    if(t.mode.toUpperCase()=='POST')xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
                    xhr.send(params);
                    break;
                case 'pm':
                case 'mp':
                    xhr.open('POST','/privmsg');
                    xhr.timeout=6000;
                    xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
                    xhr.send('post=envoyer&username[]='+encodeURIComponent(obj.arg)+'&subject='+subject+'&username='+username+'&message='+message);
                    break;
                case 'reply':
                case 'reponse':
                    if(isNaN(this.arg))throw new obj.formException(obj.exceptionCodes.FORM_ARG_NOT_VALID);
                    xhr.open('POST','/post');
                    xhr.timeout=6000;
                    xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
                    xhr.send('post=envoyer&mode=reply&t='+encodeURIComponent(obj.arg)+'&subject='+subject+'&username='+username+'&message='+message);
                case 'new_topic':
                case 'nouveau_sujet':
                    if(isNaN(this.arg))throw new obj.formException(obj.exceptionCodes.FORM_ARG_NOT_VALID);
                    xhr.open('POST','/post');
                    xhr.timeout=6000;
                    xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
                    xhr.send('post=envoyer&mode=newtopic&f='+encodeURIComponent(obj.arg)+'&subject='+subject+'&username='+username+'&message='+message);
            }
        };
        this.ajax_loadstart=function(evt){
            try{
                if(obj.prb)obj.prb_bar.style.width='';
                obj.progressionStatus=obj.progressionStatusCodes.LOADSTART;
                obj.commMgnt();obj.genProgressionBarStatusClasses();
                obj.u_fn(evt);
            }catch(e){
                obj.mgntEx(e)
            }
        };
        this.ajax_load=function(evt){
            try{
            /*
            Ce n'est pas détecté comme une erreur d'un point de vue protocole HTTP,
            mais je choisis de traiter tout code de retour différent de 200 (OK)
            comme une erreur.
            Exemple: 404 (Not Found)
            */
            if(this.status!=200)throw new obj.formException(obj.exceptionCodes.AJAX_ERROR,{message:'Status is not 200:\n'+this.status+'=>'+this.statusText});
            obj.progressionStatus&=~obj.progressionStatusCodes.PROGRESS;
            obj.progressionStatus|=obj.progressionStatusCodes.LOAD;
            if(obj.prb)obj.prb_bar.style.width='100%';
            obj.commMgnt();obj.genProgressionBarStatusClasses();
            if(!obj.options.hasOwnProperty('reset_onLoad')||obj.options.reset_onLoad){
                obj.form.reset();
            }
            if(obj.u_fn(evt))return;
            switch(obj.mode){/*prévision*/
                default:
                    alert('Invio effettuato con successo.');
            }
            }catch(e){
                obj.progressionStatus&=~obj.progressionStatusCodes.PROGRESS;
                obj.progressionStatus|=obj.progressionStatusCodes.ERROR;
                obj.commMgnt();obj.genProgressionBarStatusClasses();
                obj.mgntEx(e)
            }
        };
        this.ajax_loadend=function(evt){
            try{
                obj.progressionStatus&=~obj.progressionStatusCodes.PROGRESS;
                obj.progressionStatus|=obj.progressionStatusCodes.LOADEND|obj.progressionStatusCodes.PENDING;
                obj.commMgnt();obj.genProgressionBarStatusClasses();
                obj.u_fn(evt);
            }catch(e){
                obj.mgntEx(e)
            }
        };
        this.ajax_progress=function(evt){
                try{
                obj.progressionStatus&=~obj.progressionStatusCodes.LOADSTART;
                obj.progressionStatus|=obj.progressionStatusCodes.PROGRESS;
                obj.commMgnt();obj.u_fn(evt);obj.genProgressionBarStatusClasses();
                if(obj.u_fn(evt))return;
                if(!obj.prb)return;
                var po=100;
                if(evt.lengthComputable){
                    obj.addClassName.call(obj.prb,'progressComputable');
                    obj.delClassName.call(obj.prb,'progressNotComputable');
                    po*=Math.round(10000*(evt.loaded/evt.total))/10000;
                    obj.prb_bar.style.width=po+'%';
                    obj.prb_txt.setAttribute('data-text',Math.round(100*po)/100);
                }else{
                    obj.addClassName.call(obj.prb,'progressNotComputable');
                    obj.delClassName.call(obj.prb,'progressComputable');
                }
            }catch(e){
                obj.mgntEx(e)
            }
        };
        this.ajax_timeout=function(evt){
            try{
                obj.progressionStatus=obj.progressionStatusCodes.TIMEOUT;
                obj.commMgnt();obj.genProgressionBarStatusClasses();
                if(!obj.u_fn(evt))throw new obj.formException(obj.exceptionCodes.AJAX_ERROR,{message:'La requête a pris trop de temps'});
            }catch(e){
                obj.mgntEx(e)
            }
        };
        this.ajax_abort=function(evt){
            try{
                obj.progressionStatus=obj.progressionStatusCodes.ABORT|obj.progressionStatusCodes.PENDING;
                obj.commMgnt();obj.genProgressionBarStatusClasses();
                obj.u_fn(evt);
            }catch(e){
                obj.mgntEx(e)
            }
        };
        this.ajax_error=function(evt,status,error){
            try{
                obj.progressionStatus&=~obj.progressionStatusCodes.LOAD;
                obj.progressionStatus|=obj.progressionStatusCodes.ERROR;
                obj.commMgnt();obj.genProgressionBarStatusClasses();
                console.log(evt,status,error);
                if(!obj.u_fn(evt))throw new obj.formException(obj.exceptionCodes.AJAX_ERROR,error);
            }catch(e){
                obj.mgntEx(e)
            }
        };
        this.submission=function(sub){
            try{
                sub.preventDefault();
                if(!(obj.progressionStatus&(obj.progressionStatusCodes.PENDING)))return;
                switch(obj.mode){
                    case 'pm':
                    case 'mp':
                    case 'reply':
                    case 'reponse':
                    case 'new_topic':
                    case 'nouveau_sujet':
                        if(!obj.arg)throw new obj.formException(obj.exceptionCodes.FORM_ARG_NOT_VALID);
                        if(!obj.message)throw new obj.formException(obj.exceptionCodes.TEXTAREA_MESSAGE_NOT_FOUND);
                        obj.validSession();
                        obj.req();
                        break;
                    case 'customizable':
                    case 'parametrable':
                        var t;
                        if((t=obj.options.hasOwnProperty('modeX')&&obj.options.modeX,t)){
                            if(t.validSession)obj.validSession();
                            if(t.url&&t.mode){
                                obj.modeX=t;
                                obj.req();
                            }
                        }
                        break;
                    default:
                        throw new obj.formException(obj.exceptionCodes.FORM_MODE_NOT_VALID);
                }
            }catch(e){
                    obj.mgntEx(e)
            }
        };
        this.u_fn=function(evt){
            if(obj.options&&obj.options.hasOwnProperty(evt.type)&&'function'===typeof obj.options[evt.type]){
            obj.options[evt.type].call(obj,evt);
            return true;
            }
            return false;
        };
        this.commMgnt=function(abortCommand){
            var abortCommand=abortCommand||false;
            if(!obj.abortButton||!obj.submitButton)return;
            if(obj.progressionStatus&obj.progressionStatusCodes.PENDING){
                obj.abortButton.setAttribute('disabled','');
                obj.submitButton.removeAttribute('disabled');
            }else{
                obj.abortButton.removeAttribute('disabled');
                obj.submitButton.setAttribute('disabled','');
            }
            if(!abortCommand)return;
            if(!(obj.progressionStatus&(obj.progressionStatusCodes.PENDING|obj.progressionStatusCodes.LOADEND))){
                if(obj.xhr&&obj.xhr.abort)obj.xhr.abort();
            }
        }
        this.validSession=function(){
            if(/fa_[^=\s]+_sid=[0-9a-f]{32}/i.test(document.cookie)&&/fa_[^=\s]+_data=/i.test(document.cookie))return true;
            throw new obj.formException(obj.exceptionCodes.NO_VALID_SESSION);
        };
        /*_.-°INIT°-._*/
        var a,obj=this;
        this.form_id=form_id||false;
        this.options=options_object||false;
        if(this.form_id===false) throw new obj.exceptionCodes.formException(obj.exceptionCodes.NO_FORM_ID);
        /*ajout form*/
        this.form=document.querySelector("form#"+this.form_id);
        if(!this.form||!this.form.tagName.toLowerCase()==='form') throw new obj.formException(obj.exceptionCodes.FORM_ID_NOT_FOUND);
        /*ajout submitButton*/
        this.submitButton=this.form.querySelector('[type="submit"]')||false;
        /*ajout abortButton*/
        this.abortButton=this.form.querySelector('.abortButton')||false;
        /*subject, mode et argument*/
        this.subject=this.form.getAttribute('data-subject')||'[faForm: '+this.form_id+'] Sujet non défini';
        this.mode=this.form.getAttribute('data-mode');
        this.arg=this.form.getAttribute('data-arg');
        /*ajout message*/
        this.message=(a=this.form.querySelector('textarea.message'))&&a.value;
        if(a)a.parentNode.removeChild(a);
        /*ajout écouteurs*/
        this.form.addEventListener('submit',this.submission,false);
        if(this.abortButton)this.abortButton.addEventListener('click',obj.commMgnt.bind(null,true),false);
        /*progression*/
        this.prb=(a=this.form.querySelector('.progressionBar'),a)&&(this.prb_bar=a.querySelector('.progressionBar_bar'),this.prb_bar)&&(this.prb_txt=a.querySelector('.progressionBar_txt'),this.prb_txt)?a:false;
        obj.commMgnt();obj.genProgressionBarStatusClasses();
    }catch(e){
        obj.mgntEx(e)
    }
}
}
</script>

Personalizzandolo magari riesci ad ottenere qualcosa che ti convinca di più.


avatar
MattiaDes
Amminattivo
Amminattivo

Sesso : Maschio
Età : 22
Messaggi : 3691
Località : Modena, Italy


http://www.habbolifeforum.com
MattiaDes è stato ringraziato dall'autore di questo topic.

In corso Re: Immettere Format esterno

Messaggio Da Primahs il Sab 9 Giu 2018 - 23:28

E' per la creazione di un argomento guidato giusto?
avatar
Primahs
****

Sesso : Maschio
Età : 19
Messaggi : 306
Località : Monza


Primahs è stato ringraziato dall'autore di questo topic.

In corso Re: Immettere Format esterno

Messaggio Da MattiaDes il Dom 10 Giu 2018 - 11:48

Sì esatto, volendo si può fare in modo che pubblichi anche all'interno di un topic già creato


avatar
MattiaDes
Amminattivo
Amminattivo

Sesso : Maschio
Età : 22
Messaggi : 3691
Località : Modena, Italy


http://www.habbolifeforum.com
MattiaDes è stato ringraziato dall'autore di questo topic.

In corso Re: Immettere Format esterno

Messaggio Da Primahs il Mar 12 Giu 2018 - 17:30

Va bene grazie mille... una volta che lo personalizzo poi lo devo mettere nella descrizione di sezione?
avatar
Primahs
****

Sesso : Maschio
Età : 19
Messaggi : 306
Località : Monza


Primahs è stato ringraziato dall'autore di questo topic.

In corso Re: Immettere Format esterno

Messaggio Da MattiaDes il Mer 13 Giu 2018 - 19:52

In che senso? Va inserito in una pagina HTML Very Happy


avatar
MattiaDes
Amminattivo
Amminattivo

Sesso : Maschio
Età : 22
Messaggi : 3691
Località : Modena, Italy


http://www.habbolifeforum.com
MattiaDes è stato ringraziato dall'autore di questo topic.

In corso Re: Immettere Format esterno

Messaggio Da Primahs il Gio 14 Giu 2018 - 13:13

Uhm... e se creo la pagina la collego tramite codice quindi?
Sennò usando il programma Forms di Niko succede la stessa cosa?
avatar
Primahs
****

Sesso : Maschio
Età : 19
Messaggi : 306
Località : Monza


Primahs è stato ringraziato dall'autore di questo topic.

Vedere l'argomento precedente Vedere l'argomento seguente Torna in alto

- Argomenti simili

 
Permessi di questa sezione del forum:
Non puoi rispondere agli argomenti in questo forum