Customization
-
Hi, I am using your plugin to listen to small pieces of the CDs that my client sells. I customized the css to show only the play and download button.
My client asked me to inhibit the downloading of songs from unregistered users, like this:
users must see the download button, but clicking on it must open a popup with a login form.
I used popup builder to create the pop-up (which triggers onclick on some classes) and I added the following code to the functions.php file
add_action('wp_footer','redirect_link_table'); function redirect_link_table() { if ( !is_user_logged_in() ) { ?> <script type="text/javascript"> jQuery(window).load(function(){ jQuery('.nodownload a, a.map_download, a.mb_map_master').removeAttr('href').removeAttr('download'); console.log('user is' + ' not logged'); }) </script> <?php } else { ?> <script type="text/javascript"> jQuery(window).load(function(){ console.log('user is' + ' logged'); }) </script> <?php } }
the system works for all links and classes except .map_download, or better, in some pages it works and in others it doesn’t.
for example:
try clicking the download button in the tables on these pages:https://www.novalis.it/test/negozio/andrea-montanari-cuori-rubati/
(here the table is static html and everything works)
https://www.novalis.it/test/negozio/daniela-cavanna-popcorn/
(dynamic table but it works)
https://www.novalis.it/test/negozio/voglio-stare-con-te-daniela-cavanna/
(dynamic table: it doesn’t work)above each table there are red buttons that allow the download of pdf or zip with other materials, everything works on these buttons
Can you help me modify your plugin code to include these two functions for map_download?
Thanks in advance
P.S. sono italiano, se vuoi proseguire la conversazione in italiano dimmelo! Ciao!
- The topic ‘Customization’ is closed to new replies.