RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AJAX upload progress bar

File sharing script

File mirror script

Newsletter script
Countdown button

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro
View previous topic :: View next topic  
Author Message
thebeer



Joined: 01 Feb 2010
Posts: 47

PostPosted: Oct 18, 2011 10:15 am    Post subject: Countdown button Reply with quote

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
View user's profile Send private message
PowerChaos



Joined: 19 Dec 2009
Posts: 440
Location: belguim

PostPosted: Oct 28, 2011 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
glumbo



Joined: 11 Mar 2011
Posts: 204
Location: US

PostPosted: Nov 05, 2011 7:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
thebeer



Joined: 01 Feb 2010
Posts: 47

PostPosted: Nov 05, 2011 1:43 pm    Post subject: Reply with quote

PowerChaos it doesn't work inside javascript.
Back to top
View user's profile Send private message
PowerChaos



Joined: 19 Dec 2009
Posts: 440
Location: belguim

PostPosted: Nov 05, 2011 2:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
sharing1



Joined: 04 Nov 2011
Posts: 6

PostPosted: Nov 05, 2011 7:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
PowerChaos



Joined: 19 Dec 2009
Posts: 440
Location: belguim

PostPosted: Nov 05, 2011 11:45 pm    Post subject: Reply with quote

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

Greetings From PowerChaos
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group