Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Protected Downloads – SOLVED

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Protected Downloads – SOLVED

Tagged: downloads, pdf stamper, protected member downloads

  • This topic has 2 replies, 2 voices, and was last updated 12 years, 10 months ago by pelfed.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • May 11, 2010 at 10:48 pm #1188
    pelfed
    Member

    I had a requirement to protect pdf documents within a protected member area. Currently eMember doesn’t allow this, it only allows protection of pages etc.

    What I wanted to do was add a digital product (pdf) as a product into eStore and only allow eMember logged in users to download these pdf’s.

    The main reason I wanted this was to force people to log into the site to download the pdfs and not to simply save the download url.

    So, in case any one else has this requirement here is the Teak.

    Navigate (using either FTP program or php editor) to the wp-content/plugins/wp-cart-for-digital-products

    Open up the downloads.php file and alter as follows:

    (on line 2, under <?php) add the following;

    session_start();

    if (!$_SESSION) exit;

    Now the user will have to be logged in to download the file.

    May 12, 2010 at 12:34 am #20436
    amin007
    Participant

    Thanks for sharing this tweak.

    Not sure if this is helpful too:

    http://www.tipsandtricks-hq.com/wordpress-membership/how-to-configure-a-members-only-download-page-70

    May 12, 2010 at 1:25 am #20437
    pelfed
    Member

    Actually found that the above method was clearing out the session for some reason.

    Instead find line 68 and replace with:

    else

    {

    // Offer the product as a download

    $path_parts = pathinfo($file_path);

    $file_name = $path_parts;

    if (isset($_SESSION[“wordpress.AUTH.eMember”])){

    //custom_read3($file_path,$file_name);

    if (ini_get(‘allow_url_fopen’) == ‘1’)

    {

    download_using_fopen($file_path,$file_name);

    }

    else

    {

    download_using_curl($file_path,$file_name);

    }

    }

    }

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ