| View previous topic :: View next topic |
| Author |
Message |
thebeer
Joined: 01 Feb 2010 Posts: 47
|
Posted: Oct 18, 2011 10:15 am Post subject: Countdown button |
|
|
Hi, so I have set the countdown button script on download0 page to 15 seconds, now what I want is to be able to set the time in user limits page.
The code looks like this now:
| Code: | <script>
var tminus = 15; /// <- need to change this value so it gets the user limits value
function countdown(){
if (tminus >= 0.1){
tminus = tminus - 0.1;
tminus = Math.round(tminus*100)/100
if (!(Math.round(tminus*100) % 100)){
tminus = tminus + ".0";
}
}else {
tminus = "Continue";
}
if (tminus != "Continue"){
document.countdown_form.countdown.disabled = true;
}else{
document.countdown_form.countdown.disabled = false;
}
document.getElementById("countdown").value=tminus;
setTimeout("countdown();", 100);
}
</script> |
What I need is somehow to get the value that is set in user limits Downloads countdown fields.
Can anyone help?
Thanks! |
|
| Back to top |
|
 |
PowerChaos
Joined: 19 Dec 2009 Posts: 440 Location: belguim
|
Posted: Oct 28, 2011 2:54 pm Post subject: |
|
|
here is your code
| Code: |
<script>
var tminus = <TMPL_VAR countdown>; /// <- need to change this value so it gets the user limits value
function countdown(){
if (tminus >= 0.1){
tminus = tminus - 0.1;
tminus = Math.round(tminus*100)/100
if (!(Math.round(tminus*100) % 100)){
tminus = tminus + ".0";
}
}else {
tminus = "Continue";
}
if (tminus != "Continue"){
document.countdown_form.countdown.disabled = true;
}else{
document.countdown_form.countdown.disabled = false;
}
document.getElementById("countdown").value=tminus;
setTimeout("countdown();", 100);
}
</script>
|
it should work , exept if it can not take the value
Greetings From PowerChaos |
|
| Back to top |
|
 |
glumbo
Joined: 11 Mar 2011 Posts: 204 Location: US
|
Posted: Nov 05, 2011 7:44 am Post subject: |
|
|
| I didn't need help with this question but just wanted to thank PowerChaos for helping out so many users. You are awesome! |
|
| Back to top |
|
 |
thebeer
Joined: 01 Feb 2010 Posts: 47
|
Posted: Nov 05, 2011 1:43 pm Post subject: |
|
|
| PowerChaos it doesn't work inside javascript. |
|
| Back to top |
|
 |
PowerChaos
Joined: 19 Dec 2009 Posts: 440 Location: belguim
|
Posted: Nov 05, 2011 2:00 pm Post subject: |
|
|
here is a other work around
| Code: |
<TMPL_UNLESS premium>
<TMPL_IF registered>
<script>
var tminus = 15; /// <- Logged in users
function countdown(){
if (tminus >= 0.1){
tminus = tminus - 0.1;
tminus = Math.round(tminus*100)/100
if (!(Math.round(tminus*100) % 100)){
tminus = tminus + ".0";
}
}else {
tminus = "Continue";
}
if (tminus != "Continue"){
document.countdown_form.countdown.disabled = true;
}else{
document.countdown_form.countdown.disabled = false;
}
document.getElementById("countdown").value=tminus;
setTimeout("countdown();", 100);
}
</script>
<TMPL_ELSE>
<script>
var tminus = 35; /// <- Not logged in users
function countdown(){
if (tminus >= 0.1){
tminus = tminus - 0.1;
tminus = Math.round(tminus*100)/100
if (!(Math.round(tminus*100) % 100)){
tminus = tminus + ".0";
}
}else {
tminus = "Continue";
}
if (tminus != "Continue"){
document.countdown_form.countdown.disabled = true;
}else{
document.countdown_form.countdown.disabled = false;
}
document.getElementById("countdown").value=tminus;
setTimeout("countdown();", 100);
}
</script>
</TMPL_IF>
</TMPL_UNLESS>
<TMPL_IF premium>
</TMPL_IF>
|
this way you manaul set the value , but you just show a differend value depending on user
Greetings From PowerChaos |
|
| Back to top |
|
 |
sharing1
Joined: 04 Nov 2011 Posts: 6
|
Posted: Nov 05, 2011 7:51 pm Post subject: |
|
|
hey power chaos i saw you helped a lot of ppl.
you got no solutuion for my problem?
i wanna use flash upload as main upload forum instead of normal upload |
|
| Back to top |
|
 |
PowerChaos
Joined: 19 Dec 2009 Posts: 440 Location: belguim
|
Posted: Nov 05, 2011 11:45 pm Post subject: |
|
|
| sharing1 wrote: | hey power chaos i saw you helped a lot of ppl.
you got no solutuion for my problem?
i wanna use flash upload as main upload forum instead of normal upload |
ask in a new post
this topic is just for the countdown button
but to give a answer , i do not use the flashupload but i can see what i can get done ( shoulnd be to hard )
Greetings From PowerChaos |
|
| Back to top |
|
 |
|