Page 2 of 2

Re: What I desperatly need.

PostPosted: September 3rd, 2011, 11:27 am
by twaycaster
I just cannot figure out what I am doing wrong, I upload these files with the correct links and pages and it still puts my website down and out. I simply get "This page cannot be displayed"

The minute I remove s2-hacks.php or remove the code from functions.php my website is back up to full speed. I know it is something I am doing wrong, but for the life of me I cannot figure it out.

The only thing I can think of is that I am using word for editing my php, could this be the problem?

Re: What I desperatly need.

PostPosted: September 3rd, 2011, 11:50 am
by Cristián Lávaque
That would cause a problem. You have to use a text editor, not text processor. A good free one is PSPad. http://www.pspad.com/en/download.php

Re: What I desperatly need.

PostPosted: September 3rd, 2011, 1:01 pm
by twaycaster
well sadly even when using the notepad that you suggested it still puts my website out of commission. I feel stuck. I just dont know what is causing it.

Re: What I desperatly need.

PostPosted: September 3rd, 2011, 9:19 pm
by twaycaster
The website cannot display the page
HTTP 500
Most likely causes:
•The website is under maintenance.
•The website has a programming error.

What you can try:
Refresh the page.

Go back to the previous page.

More information

Re: What I desperatly need.

PostPosted: September 4th, 2011, 12:56 pm
by twaycaster
I FIGURED IT OUT!!!!

The last statement the else wpredirect was causing a internal forever loop and not letting anything move forward. I removed the else wpredirect and am now cruising along very nicely

Re: What I desperatly need.

PostPosted: September 5th, 2011, 12:37 am
by Cristián Lávaque
You mean the one that points to http://holistic-living-today.com/detox- ... gar-detox/? That page doesn't seem to even exist, I get a 404.

I'm glad you got it working, though. Well done. :)

You could just protect the pages that require the ccap, using the s2Member meta box in the edit page. Then the hack would not need to check for it and it can just be:

Code: Select all
<?php
add_action 
('template_redirect', 'my_s2_custom_capabilities');
function my_s2_custom_capabilities()
{
    $drips = array(
        7  => array(3, 4, 5),
        14 => array(6, 7, 8),
        21 => array(9, 10, 11),
        28 => array(12),
    );
    foreach ($drips as $drip_day => $drip_pages)
    {
        if (S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < $drip_day && is_page($drip_pages))
        {
            wp_redirect('http://example.com/not-yet-available-to-you/');
            exit;
        }
    }
}
?>


Let me know if that helps. :)