XFileSharing Pro - make invisible the download button while in the countdown

Message
Author
flashdriveit
Posts: 11
Joined: May 03, 2012 2:28 pm

make invisible the download button while in the countdown

#1 Postby flashdriveit » Oct 24, 2012 10:37 am

Sorry for the stupid question but I wanted to ask for your help to hide the download button during the countdown. thanks for the help

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#2 Postby trinsic » Oct 24, 2012 11:38 am

I see 2.0 does things a little different from 1.8 (which I'm on) so I didn't modify the jQuery already present in 2.0 and just created a entirely new countdown for the download button.

Put in download1.html roughly around line 132 after </Form>

Code: Select all

<script>
$('#btn_download').hide();
var count=10;
countdown=setInterval (function()
	{
	if(count==0)
		{
		$('#btn_download').show()
		}
	count --
	}
,1000);
</script>

flashdriveit
Posts: 11
Joined: May 03, 2012 2:28 pm

#3 Postby flashdriveit » Oct 24, 2012 4:26 pm

thanks for the help now I feel if it works in 2.0

Edit: Work fine thanks

randy
Posts: 321
Joined: Mar 13, 2012 7:00 pm

#4 Postby randy » Oct 24, 2012 11:00 pm

cannot get it working please help me

my code

Code: Select all

<TMPL_IF countdown>
<br><span id="countdown_str"><TMPL_VAR lang_wait> <span id="<TMPL_VAR rnd1>"><TMPL_VAR countdown></span> <TMPL_VAR lang_seconds></span>
</TMPL_IF>
<br>
<TMPL_IF direct_links>
<input type="hidden" name="down_direct" value="1">
<div class="rrd2">
<input type="submit" id="btn_download" value="<TMPL_VAR lang_create_link>">
</div>
<TMPL_ELSE>
<input type="hidden" name="down_script" value="1">
<div class="rrd2">
<input type="submit" id="btn_download" value="<TMPL_VAR lang_download_file>">
</div>
</TMPL_IF>

</TMPL_UNLESS>

</Form>
please post correct code

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#5 Postby trinsic » Oct 24, 2012 11:14 pm

Put it at the very end of that code you posted.

randy
Posts: 321
Joined: Mar 13, 2012 7:00 pm

#6 Postby randy » Oct 24, 2012 11:20 pm

im no coder please just update the code. thx ;)

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#7 Postby trinsic » Oct 24, 2012 11:24 pm

Code: Select all

<TMPL_IF countdown>
<br><span id="countdown_str"><TMPL_VAR lang_wait> <span id="<TMPL_VAR rnd1>"><TMPL_VAR countdown></span> <TMPL_VAR lang_seconds></span>
</TMPL_IF>
<br>
<TMPL_IF direct_links>
<input type="hidden" name="down_direct" value="1">
<div class="rrd2">
<input type="submit" id="btn_download" value="<TMPL_VAR lang_create_link>">
</div>
<TMPL_ELSE>
<input type="hidden" name="down_script" value="1">
<div class="rrd2">
<input type="submit" id="btn_download" value="<TMPL_VAR lang_download_file>">
</div>
</TMPL_IF>

</TMPL_UNLESS>

</Form>
<script> 
$('#btn_download').hide(); 
var count=10; 
countdown=setInterval (function() 
   { 
   if(count==0) 
      { 
      $('#btn_download').show() 
      } 
   count -- 
   } 
,1000); 
</script>

randy
Posts: 321
Joined: Mar 13, 2012 7:00 pm

#8 Postby randy » Oct 24, 2012 11:34 pm

not working. generate link not showing up now?

do I have to activate countdown in user limits?

or works without?

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#9 Postby trinsic » Oct 24, 2012 11:40 pm

Works without it. The countdown is set to 10 seconds, did you wait this long? You can make it shorter if you want.

randy
Posts: 321
Joined: Mar 13, 2012 7:00 pm

#10 Postby randy » Oct 24, 2012 11:41 pm

it didnt even show up! whole download button did not show up and no counts. nothing :(

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#11 Postby trinsic » Oct 24, 2012 11:51 pm

It won't show a counter you need to set that yourself in XFS, what this script does is just hide the download button for 10 seconds.

randy
Posts: 321
Joined: Mar 13, 2012 7:00 pm

#12 Postby randy » Oct 24, 2012 11:52 pm

oh. that's pretty bad :( user must see a waittime! otherwise he is confused!

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#13 Postby trinsic » Oct 24, 2012 11:58 pm

XFS has a built in countdown we don't need to make another one.
Last edited by trinsic on Oct 25, 2012 12:12 am, edited 1 time in total.

randy
Posts: 321
Joined: Mar 13, 2012 7:00 pm

#14 Postby randy » Oct 24, 2012 11:59 pm

yes but time with showing download button below. we talked about a download button not showing before countdown is finish!

also captchas should only appear after countdown or clicking generate download link. looks pretty bad

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#15 Postby trinsic » Oct 25, 2012 12:27 am

Maybe in the future I'll have a look as it requires a bit more work and since I'm only on 1.8 things are quite a bit different. Have far too many custom mods in 1.8 to make for an easy upgrade.