Pay Per View - Offer PPV for 12 hours not 1 day


I've installed the PPV plugin. It works really well for our Live Streaming service but one problem is the length of time viewers get. At the moment when someone pays £1, they get access to the streaming page for 24 hours. We want to charge £1 per game. The problem is if they pay £1 at 7pm on a Friday, then we have another game at 5pm on Saturday, they get access for free. Is there a way to reduce access to the page for hours instead of days?



  • Jack Kitterhing

    Hi there Kevin,

    I hope you are well today, if you use one time view, then you can set your cookie expiration to 12 hours.

    There is 1 issue caused by doing that is that if your user shuts down their computer, or quits their browser and clears their cookie, they would no longer be able to access the content.

    But if it's a live stream, I would think that's unlikely to happen?

    Do you think that would work for you :slight_smile:

    Thank you!

    Kind Regards

  • Arnold

    Paypal won't do fractional day subscriptions. But requiring login is really a separate problem. Use the cookie method but protect you content pages

    I'm assuming your mainly working on "page" post types? It will worrk for any type but I'll assume "page"

    Make a copy of your themes "page.php" file.Call it say "page-restricted.php"
    At the very top add

    Template Name: Logged-In Users Page

    That give this template a name that will be displayed in the Page editors page template dropdown.

    Then you go two ways one is surround the template code with a login conditional.

    <?php if(is_user_logged_in()):?>
    ...All the content you don't want seen with out login...
    <?php else:
    wp_die('Sorry, you must first <a href="/wp-login.php">log in</a> to view this page. You can <a href="/wp-login.php?action=register">register free here</a>.');

    OR you can just redirect to login. Just add at the top

    <?php auth_redirect(); ?>

    This will redirect them to login and when they finish takes then right back to the original page which can now be seen.

    Then on the page you want to require login from you just pick the the template from the dropdown in the Page Attributes box on the Page editor.

    You can just add it to your "page.php" fiel if you want it for all pages.

  • Kevin


    Thinking, if I just use it out of the box so when they pay a pound watch the game and leave then pay again for the next match. If they want to reply they can simply create an account.

    To set it up so when they come to our streaming page do I:

    Choose "one time view" option?

    Set the Cookie validity time (hours) to zero?

    With that set up, guest can go to the above page, pay the £1 and watch the game and the next time they go to that page for the next game they'll be asked to pay £1 again?

    Is that correct?

  • Arnold

    Yes, but if they go to another site and come back they may be locked out. Makes a session cookie which disappears when the browser goes away.

    But if your interested in comments without login

    In the admin > settings > discussion
    there's an Other comments section that has this option

    Users must be registered and logged in to comment

    un-check it

    Then just put your Protected section in the [ppv] shortcode with the selection tool.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.