latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Change / remove the text in download prompt

Home Forums Community Forum Change / remove the text in download prompt

This topic contains 16 replies, has 5 voices. Last updated by  Jason (Lead Developer) 3 years, 11 months ago.

Topic Author Topic
Posted: Saturday Dec 29th, 2012 at 3:41 pm #35739

HI,
How can I change the text in the download promt/
It now says:
— Confirm File Download —

You`ve downloaded 3 protected files in the last 365 days.

You`re entitled to UNLIMITED downloads though ( so, no worries )

I would like to change that.
I tried the code (s2-hacks.php) from the thread here but it did not change anything
http://www.s2member.com/forums/topic/how-to-edit-javascript-confirmation-prompt/

Thanks,
Dan

List Of Topic Replies

Viewing 16 replies - 1 through 16 (of 16 total)
Author Replies
Author Replies
Posted: Sunday Dec 30th, 2012 at 2:33 am #35781
Bruce
Username: Bruce
Staff Member

Hi Dan,

I believe that this code should work, but you’ll want to create a Must Use plugin with the name s2-a.php, or s2member-a.php. These file names give access to your Must-Use plugin to s2Member’s JavaScript processes, which is what you need to do.

Posted: Sunday Dec 30th, 2012 at 3:11 am #35783

Hi Bruce,
Thanks for your answer, I added a filed named s2-a.php with the above code into the mu-plugins folder inside the wp-content folder. (wp-content/plugins/mu-plugins/s2-a.php)
also tried remaining the file to s2member-a.php

Still getting the original prompt message.

Dan

Posted: Sunday Dec 30th, 2012 at 3:14 am #35784
Bruce
Username: Bruce
Staff Member

Hi Dan,

I’m going to send Jason a message regarding this. In the meantime, you can edit this directly from /s2member/includes/s2member-min.js.

Posted: Sunday Dec 30th, 2012 at 3:18 am #35785

Ok, thanks
will be waiting for your update
I think it would be best to have an option to configure the “system messages” from the s2 member admin – I’ll vote to that…

Dan

Posted: Sunday Jan 6th, 2013 at 5:12 am #36374

Hi,
Any news from Jason regarding this issue?
If it is possible, I would like to remove the JS prompt all together.
When a user clicks to download a file he will be directed to the normal browser download window.

Thanks,

Dan

Posted: Monday Jan 7th, 2013 at 8:24 pm #36514

Dan, you can remove the prompt using the [hilite mono]skip_confirmation[/hilite] parameter. [hilite path]Dashboard -› s2Member® -› Download Options -› Shortcode Attributes & API Functions -> skip_confirmation[/hilite]

Posted: Tuesday Jan 8th, 2013 at 3:04 am #36550

Thanks
But is there a way to remove the S2 prompt alltogether from all downloads?
I already have tens of files and would not like to change all the url’s with the shortcode.
In this project I will not need any JS prompt for the download.

Dan

Posted: Tuesday Jan 8th, 2013 at 3:19 am #36551

I am using advanced custom fields to enter the URL for the file download, and it’s working fine.
When trying to integrate the php code for the skip_confirmation it’s stops working.
This is the code I am using – can you help out:

<a href="<?php echo s2member_file_download_url(array( "file_download" => "the_sub_field('download_link')", "skip_confirmation" =>true)); ?>"><img src="<?php the_sub_field('download_icon'); ?>" /><?php the_sub_field('file_name'); ?></a>
 

thanks
Dan

Posted: Wednesday Jan 9th, 2013 at 5:42 am #36715

So [hilite mono]the_sub_field[/hilite] function just returns a string or does it echo it?

I see [hilite code][/hilite] without an echo, although that’s obviously what’ll happen. But if it echoes, can you really use it to set the value of [hilite mono]"file_download"[/hilite] in the array?

Posted: Wednesday Jan 9th, 2013 at 6:54 am #36723

Hi,
The sub_field does echo out the name or the url, that’s why I wanted to add it after the “file_download” part.
(The icon is showing up and so does the file name)
But if this can’t work , can I disable the prompt entirely?

Thank you
Dan

Posted: Thursday Jan 10th, 2013 at 7:23 am #36854

Hi,
Any news regarding this issue?

Thanks
Dan

Posted: Saturday Jan 12th, 2013 at 4:33 am #37094
Staff Member

Thanks for the heads up on this thread :-)

@ Dan Stramer

~ Thanks for your patience. I apologize for the delay guys.

But is there a way to remove the S2 prompt alltogether from all downloads?
I already have tens of files and would not like to change all the url’s with the shortcode.
In this project I will not need any JS prompt for the download.

You can set this global JavaScript variable to a value of true, to disable ALL confirmation prompts.

var ws_plugin__s2member_skip_all_file_confirmations = true;

So for instance, you might have an MU plugin that does this for you.

Please create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
(NOTE: these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins)
(See also: http://www.s2member.com/kb/hacking-s2member/)

<?php
add_action('wp_head', 'disable_s2_js_confirmations');
function disable_s2_js_confirmations()
	{
		echo '<script type="text/javascript">';
		echo 'var ws_plugin__s2member_skip_all_file_confirmations = true;';
		echo '</script>';
	}

You won’t need to add skip_confirmation onto the end of your links now. You’ve disabled these globally.

Posted: Saturday Jan 12th, 2013 at 2:18 pm #37155

Thank you very much Jason, that did the trick!

Another question if I may – is it possible to have all child pages of a protected parent page to be also automatically protected? Or do I have to set a protection level for each page separately?

Thanks,
Dan

Posted: Saturday Jan 12th, 2013 at 3:53 pm #37177
Staff Member

You’re VERY welcome.

Can you please start another topic for your question about pages. Thanks!

Posted: Monday Jan 14th, 2013 at 2:28 pm #37508
hbgi
Username: hbgi

Jason,

Thanks for the info because I have had the same questions too. However, you have to forgive me because I’m not a coder and I don’t understand where I am supposed to put this code:

var ws_plugin__s2member_skip_all_file_confirmations = true;

Is there someplace under Appearance>Editor>?? that I should go to and place this line?

thanks!

Joanne

Posted: Monday Jan 14th, 2013 at 2:42 pm #37513
Staff Member

Thanks for the follow-up :-)

@ hbgi

Please see this KB article for full details.
http://www.s2member.com/kb/disable-file-download-confirmations/

Viewing 16 replies - 1 through 16 (of 16 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.