Autor Tópico: [Livre] ajuda com script  (Lida 5931 vezes)

0 Membros e 2 Visitantes estão a ver este tópico.

Offline ferr@ri

  • Iniciar SmfPt
  • *
  • Mensagens: 138
  • Rank: 4
[Livre] ajuda com script
« em: 07 de Agosto de 2011, 16:11 »
Boas tenho aqui um problema com o scrip de gerador de bbcode que não sei como resolver, por isso agradeço a vossa ajuda se possível.
 
 Então é o seguinte tentei implementar no gerador mais três opções do que as que já tinha antes, são elas:
 
 Compatibilidade: win xp, win vista, win 7 depois de adicionar estas tres opções o script deixou de funcionar ou seja não gera os bbcodes.
 
 Alguem me pode dar uma ajuda a descobrir onde está o erro ?

Aqui fica o script


<head>
<link rel="File-List" href="filmes_ficheiros/filelist.xml">
<title>Gerador de T&oacute;picos</title>
</head>
<body bgcolor="#808000" style="background-attachment: fixed">
<title>Gerador de T&oacute;picos (Filmes)</title>
<script type="text/javascript">
            function doStuff()
            {
            var txt = "";
            txt += "
";
            document.getElementById("gen").value = "";

            if (document.getElementById("title").value != ""){
            txt += "";
            txt += document.getElementById("title").value;
            txt += "
\n\n";
            document.getElementById("gen").value += txt;
            }
           
            {
            txt = "";
            txt += "";
            if (document.getElementById("sv5stars").checked == true)
            {txt += "\nUPSV\n";}
            if (document.getElementById("outro").checked == true)
            {txt += "";}
            document.getElementById("gen").value += txt;
            }
                       
            if (document.getElementById("boxart").value != ""){
            txt = "\n\n";
            document.getElementById("gen").value += txt;
            }
                                 
            if (document.getElementById("site").value != ""){
            txt = "";
            txt += "\n\n#SITE#\n\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot1").value != ""){
            txt = "SCR\n\n";
            txt += "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot2").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot3").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot4").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot5").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

           if (document.getElementById("trail").value != ""){
            txt = "";
            txt += "\n\n\nTR\n\n";
            txt += "[youtube=600,350]";
            txt += document.getElementById("trail").value;
            txt += "[/youtube]";
            document.getElementById("gen").value += txt;
            }
           
            if (document.getElementById("info").value != ""){
            txt = "";
            txt += "\n\n@!\n\n";
            txt += document.getElementById("info").value; //Add info
            txt += "\n\n";
            document.getElementById("gen").value += txt;
            }
           
            {
            txt = "teste";
            txt += "";
            if (document.getElementById("C1").checked == true)
            {txt += "\n\@!";}
            if (document.getElementById("C2").checked == true)
            {txt += "@!";}
            if (document.getElementById("C3").checked == true)
            {txt += "@!";}
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("downlinks").value != ""){
            txt = "";
            txt += "\n\ndow\n\n";
            txt += "[hide]";
            txt += document.getElementById("downlinks").value;
            txt += "[/hide] ";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("pass").value != ""){
            txt = "";
            txt += "\n\n|PSS|\n\n";
            txt += " ";
            txt += document.getElementById("pass").value;
            txt += " ";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("capa").value != ""){
            txt = "";
            txt += "\n\n|CA|\n\n";
            txt += "";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("nota").value != ""){
            txt = "";
            txt += "\n\n|ND|\n\n";
            txt += document.getElementById("nota").value; //Add nota
            document.getElementById("gen").value += txt;
            }

            txt = "";
            txt += "
";
            document.getElementById("gen").value += txt;
            }
        </script>
<p>
<link rel="shortcut icon" href="/imagens/favicon.ico" />
<br /><img alt="" src="/imagens/banner.gif" /><br />
<span style="color: #FFFFFF; font-weight: bold; font-size:250%">Gerador de T&oacute;picos
 </span> </p>
<p>
<span style="color: #FFFF00; font-weight: bold; font-size:200%">Preencher o
m&aacute;ximo de informa&ccedil;&atilde;o poss&iacute;vel</span> </p>
<span style="font-weight: bold; color:#cc0000; font-size:200%">Jogos / Software</span><p>
<br /><img alt="" src="/imagens/jogos.gif" /><br />
</p>
<form name="frm" action="jogos.html">
<table border="1">
<tbody>
<tr>
<td><font color="#FFFFFF"><strong>Nome/Release:</strong></font></td>
<td><input id="title" value="" maxlength="200" size="65" type="text" /></td></tr>
<tr>
<td><strong><input name="radio" id="sv5stars" value="sv5stars" type="radio">
<label for="sv5stars"><i><font size="4" color="#FFFFFF">Links sv5stars</font></i></br></label></tr>
<tr>
<td><strong><input name="radio" id="outro" value="outro" type="radio">
<label for="sv5stars"><i><font size="4" color="#FFFFFF">N&atilde;o sv5stars</font></i></br></label></tr>
<tr>
<td><font color="#FFFFFF"><strong>Link imagem/poster:</strong></font></td>
<td><font color="#FFFFFF"><input id="boxart" value="" maxlength="200" size="65" type="text" /></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Site Oficial:</strong></font></td>
<td><font color="#FFFFFF"><input id="site" value="" maxlength="200" size="65" type="text" /></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Screenshots:</strong></font></td>
<td><font color="#FFFFFF"><input id="sshot1" maxlength="200" size="65" type="text" /><br />
<input id="sshot2" maxlength="200" size="65" type="text" /><br />
<input id="sshot3" maxlength="200" size="65" type="text" /><br />
<input id="sshot4" maxlength="200" size="65" type="text" /><br />
<input id="sshot5" maxlength="200" size="65" type="text" /></font></td></tr>
<td><font color="#FFFFFF"><strong>Trailer (Link video):</strong></font></td>
<td><font color="#FFFFFF"><input id="trail" value="" maxlength="100" size="65" type="text" /></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>info:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="info" cols="58" rows="5"></textarea></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Links para o Download:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="downlinks" cols="58" rows="10"></textarea></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Compatibilidade:</strong></font></td>
<td>
<font color="#FFFFFF"><input type="checkbox" name="C1" value="ON" maxlength="200" size="65" type="text"/>win xp</font>
<font color="#FFFFFF"><input type="checkbox" name="C2" value="ON" maxlength="200" size="65" type="text"/>win vista</font>
<font color="#FFFFFF"><input type="checkbox" name="C3" value="ON" maxlength="200" size="65" type="text"/>win 7</font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Password:</strong></font></td>
<td><font color="#FFFFFF"><input id="pass" value="" maxlength="5" size="65" type="text" /></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Capa:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="capa" cols="58" rows="2"></textarea></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Notas/Dicas:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="nota" cols="58" rows="5"></textarea></font></td></tr>
<tr>
<td colspan="2">
<center><font color="#FFFFFF"><input onclick="doStuff()" value="Gerar T&oacute;pico" type="button" /></font></center></td></tr>
<tr>
<td colspan="2"><font color="#FFFFFF"><textarea id="gen" cols="82" rows="10">Aqui ir&aacute; ser&aacute; gerado o t&oacute;pico, depois de clicar em &quot;Gerar T&oacute;pico&quot; copie tudo e cole no seu novo T&oacute;pico</textarea></font></td></tr></tbody></table>
<table border="0" width="100%">
    <tr>
        <td>
        <p align="center"><font color="#FFFFFF">Design
        <a href=""></a></font></td>
    </tr>
</table>
</form>
</body>
</html>

Offline oliveirandre21

  • Moderador Global
  • *
  • Mensagens: 40
  • Rank: 1
  • Sexo: Masculino
    • Musica-Portuguesa
Re: [Livre] ajuda com script
« Responder #1 em: 12 de Agosto de 2011, 07:30 »
essas tres opções é para que? escolher um dos SO ?

Offline r00t

  • Iniciar SmfPt
  • *
  • Mensagens: 3
  • Rank: 0
  • Hosting by Aplic
Re: [Livre] ajuda com script
« Responder #2 em: 13 de Agosto de 2011, 02:49 »
mete o código original que funcione.. antes de colocares a parte das três opções...

Offline r00t

  • Iniciar SmfPt
  • *
  • Mensagens: 3
  • Rank: 0
  • Hosting by Aplic
Re: [Livre] ajuda com script
« Responder #3 em: 13 de Agosto de 2011, 03:24 »
Código: [Seleccione]
<head>
<link rel="File-List" href="filmes_ficheiros/filelist.xml">
<title>Gerador de T&oacute;picos</title>
</head>
<body bgcolor="#808000" style="background-attachment: fixed">
<title>Gerador de T&oacute;picos (Filmes)</title>
<script type="text/javascript">
        function doStuff()
            {
            var txt = "";
            txt += "";
            document.getElementById("gen").value = "";

            if (document.getElementById("title").value != ""){
            txt += "";
            txt += document.getElementById("title").value;
            txt += "\n\n";
            document.getElementById("gen").value += txt;
            }

                       
            if (document.getElementById("boxart").value != ""){
            txt = "\n\n";
            document.getElementById("gen").value += txt;
            }
                                 
            if (document.getElementById("site").value != ""){
            txt = "";
            txt += "\n\n#SITE#\n\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot1").value != ""){
            txt = "SCR\n\n";
            txt += "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot2").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot3").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot4").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("sshot5").value != ""){
            txt = "\n";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("trail").value != ""){
            txt = "";
            txt += "\n\n\nTR\n\n";
            txt += "[youtube=600,350]";
            txt += document.getElementById("trail").value;
            txt += "[/youtube]";
            document.getElementById("gen").value += txt;
            }
           
            if (document.getElementById("info").value != ""){
            txt = "";
            txt += "\n\n@!\n\n";
            txt += document.getElementById("info").value; //Add info
            txt += "\n\n";
            document.getElementById("gen").value += txt;
            }

           
            if (document.getElementById("C1").checked == true){           
            txt = "Windows XP\n";
            document.getElementById("gen").value += txt;
            }
            if (document.getElementById("C2").checked == true){           
            txt = "Windows Vista\n";
            document.getElementById("gen").value += txt;
            }
            if (document.getElementById("C3").checked == true){           
            txt = "Windows 7";
            document.getElementById("gen").value += txt;
            }


            if (document.getElementById("downlinks").value != ""){
            txt = "";
            txt += "\n\ndow\n\n";
            txt += "[hide]";
            txt += document.getElementById("downlinks").value;
            txt += "[/hide] ";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("pass").value != ""){
            txt = "";
            txt += "\n\n|PSS|\n\n";
            txt += " ";
            txt += document.getElementById("pass").value;
            txt += " ";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("capa").value != ""){
            txt = "";
            txt += "\n\n|CA|\n\n";
            txt += "";
            document.getElementById("gen").value += txt;
            }

            if (document.getElementById("nota").value != ""){
            txt = "";
            txt += "\n\n|ND|\n\n";
            txt += document.getElementById("nota").value; //Add nota
            document.getElementById("gen").value += txt;
            }

            txt = "";
            txt += "";
            document.getElementById("gen").value += txt;
            }
        </script>
<p>
<link rel="shortcut icon" href="/imagens/favicon.ico" />

<img alt="" src="/imagens/banner.gif" />

<span style="color: #FFFFFF; font-weight: bold; font-size:250%">Gerador de T&oacute;picos
 </span> </p>
<p>
<span style="color: #FFFF00; font-weight: bold; font-size:200%">Preencher o
m&aacute;ximo de informa&ccedil;&atilde;o poss&iacute;vel</span> </p>
<span style="font-weight: bold; color:#cc0000; font-size:200%">Jogos / Software</span><p>

<img alt="" src="/imagens/jogos.gif" />

</p>
<form name="frm" action="jogos.html">
<table border="1">
<tbody>
<tr>
<td><font color="#FFFFFF"><strong>Nome/Release:</strong></font></td>
<td><input id="title" value="" maxlength="200" size="65" type="text" /></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Link imagem/poster:</strong></font></td>
<td><font color="#FFFFFF"><input id="boxart" value="" maxlength="200" size="65" type="text"

/></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Site Oficial:</strong></font></td>
<td><font color="#FFFFFF"><input id="site" value="" maxlength="200" size="65" type="text"

/></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Screenshots:</strong></font></td>
<td><font color="#FFFFFF"><input id="sshot1" maxlength="200" size="65" type="text" />

<input id="sshot2" maxlength="200" size="65" type="text" />

<input id="sshot3" maxlength="200" size="65" type="text" />

<input id="sshot4" maxlength="200" size="65" type="text" />

<input id="sshot5" maxlength="200" size="65" type="text" /></font></td></tr>
<td><font color="#FFFFFF"><strong>Trailer (Link video):</strong></font></td>
<td><font color="#FFFFFF"><input id="trail" value="" maxlength="100" size="65" type="text"

/></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>info:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="info" cols="58"

rows="5"></textarea></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Links para o Download:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="downlinks" cols="58"

rows="10"></textarea></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Compatibilidade:</strong></font></td>
<td>
<font color="#FFFFFF"><input type="checkbox" id="C1" value="ON" maxlength="200" size="65"

type="text"/>win xp</font>
<font color="#FFFFFF"><input type="checkbox" id="C2" value="ON" maxlength="200" size="65"

type="text"/>win vista</font>
<font color="#FFFFFF"><input type="checkbox" id="C3" value="ON" maxlength="200" size="65"

type="text"/>win 7</font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Password:</strong></font></td>
<td><font color="#FFFFFF"><input id="pass" value="" maxlength="5" size="65" type="text"

/></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Capa:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="capa" cols="58"

rows="2"></textarea></font></td></tr>
<tr>
<td><font color="#FFFFFF"><strong>Notas/Dicas:</strong></font></td>
<td><font color="#FFFFFF"><textarea id="nota" cols="58"

rows="5"></textarea></font></td></tr>
<tr>
<td colspan="2">
<center><font color="#FFFFFF"><input onclick="doStuff()" value="Gerar T&oacute;pico"

type="button" /></font></center></td></tr>
<tr>
<td colspan="2"><font color="#FFFFFF"><textarea id="gen" cols="82" rows="10">Aqui ir&aacute;

ser&aacute; gerado o t&oacute;pico, depois de clicar em &quot;Gerar T&oacute;pico&quot;

copie tudo e cole no seu novo T&oacute;pico</textarea></font></td></tr></tbody></table>
<table border="0" width="100%">
    <tr>
        <td></td>
    </tr>
</table>
</form>
</body>
</html>

Isto já está a funcionar.. testa aí ;)

O problema era que no script estavas a chamar pela ID e em baixo no html em vez de ID tinhas era NAME..
E uns códigos do script tavam trocados..
já corrigi e já funciona.
Cumps