← Desenvolvimento

Contagem decrescente - Download

Lida 4035 vezes

Offline

skyli 
Membro
Mensagens 381 Gostos 0
Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Viva!

Alguem sabe como é que posso introduzir este sistema num site? Ou seja, queria algo que fizesse contagem decrescente e de seguida aparecesse um icon para clicar e fazer o download. Algo como isto: http://gallery.mobile9.com/d/201493/

Agradeço desde já a vossa atenção
um abraço a todos e bom verão!  8)
Offline

-RJ- 
Membro
Mensagens 1188 Gostos 0
Troféus totais: 30
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Não deve ser muito difícil em php...
Offline

Warrior 
Membro
Mensagens 203 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Aquilo é JavaScript

Adicionas:

Código: [Seleccione]
<meta http-equiv="Refresh" CONTENT="25;url=http://www.dominio.com/ficheiro.rar">
antes do </head>

Depois adiciona esta caixa onde quiseres...
Código: [Seleccione]
<td valign='middle'> <table align='center' cellpadding="4" class="tablefill">
        <tr>
          <td width="100%" align="center">

   <p><a href="http://www.dominio.com/register.php" class="site"><strong>Register for free</strong></a> to increase your download limit and avoid wait time. </p>
   <p><span id="waiting"></span></p>

 <script>
 
 
function fnHide(secs){
     secs--;
if(secs>0)
{
 document.getElementById("waiting").innerHTML = 'Please wait while we transfer your file. Estimated wait time: <b>'+secs+'</b> seconds.';
window.setTimeout("fnHide("+secs+")",1000);
}
else
document.getElementById("waiting").innerHTML = '<a href="http://dominio.com/ficheiro.rar">Carregue aqui para fazer download automaticamente</a>';  

    }
fnHide(27);
</script></td>
        </tr>
      </table></td>


Podes editar a caixa á tua maneira e subsituir a frase de fazer download manual por uma imagem, ou link...
Offline

-RJ- 
Membro
Mensagens 1188 Gostos 0
Troféus totais: 30
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

Pois mas para um sistema automático seria em php não? Assim ele tem que andar a colocar os links pa todos os donwloads diferentes que queria. Com php poderia-se usar um $_GET por exemplo...suponho eu. :)
Offline

Warrior 
Membro
Mensagens 203 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Mas isso é se ele quisesse fazer um sistema de gestão de downloads, ai sim criava uma unica página e substituia os ficheiros por funções..

Mas se quiser fazer manualmente, assim é a forma mais rápida...
Offline

skyli 
Membro
Mensagens 381 Gostos 0
Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Muito obrigado, vou agora exprimentar!
Este em javascript porque só quero aplicar isso em 5 ou 6 ficheiros! Está mesmo optimo para isso!  :wink:

um abraço e muito obrigado  8)
Offline

tiovivi 
Membro
Mensagens 865 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

eu apliquei este javascript num site com uma fnção em php pa meter os links automaticamente.. mas qdo users vê o html vê o codigo (msm antes de acabar a contagem) alguma maneira de contornar isso?

cumps
Offline

tiovivi 
Membro
Mensagens 865 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

ng sabe?  :|
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Citação de: "tiovivi"
ng sabe?  :|


Poes um link.php que vá retornar o link original do download...
Offline

tiovivi 
Membro
Mensagens 865 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

explica la melhor  :|  :|
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

por exemplo link.php?id=1 vai redirecionar para o endereço original do ficheiro...

Assim o user ja nao ve...
xD
Offline

tiovivi 
Membro
Mensagens 865 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

pois.. tens alguma coisa codada?  8)  gracias
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Citação de: "tiovivi"
pois.. tens alguma coisa codada?  8)  gracias


Neps, mas tive a pensar e não dá... eles iam aceder ao link.php igualmente... só se colocasses uma cookie...
:P
Offline

=IceBurn= 
Membro
Mensagens 897 Gostos 3
Feedback +3

Troféus totais: 32
Trófeus: (Ver todos)
Windows User Level 6 Linux User Mobile User Super Combination Combination Topic Starter Poll Voter Poll Starter Level 5

O que muito pouca gente sabe, é que se pode fazer um refresh com PHP e essa é a solução que tu vais precisar...

Simplesmente adicionas no inicio do ficheiro o seguinte:

 
Código: [Seleccione]
header('Refresh: 25; url=http://www.dominio.com/arquivo.rar');

Podes ter a certeza que assim ninguem vê o url no código fonte.
Offline

tiovivi 
Membro
Mensagens 865 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

sim, mas assim entra no site/ficheiro ao fim de 25 segundos ne?

mas e aparecer o link tipo cm ta no inicio do topico em texto/link pa o user clicar? era neste sentido  :|