Page 1 of 1

Content Dripping workdays only

PostPosted: June 4th, 2010, 7:11 am
by jonnytr
Hi,

I would like to know how to do content dripping from monday to friday only ?
And is it possible to hide and show pages like content dripping I mean page 1 is showing for the fist month then on month 2 the page 1 is hidding and page 2 is showing ?

Thanks and regards,
Jonathan

Re: Content Dripping workdays only

PostPosted: June 23rd, 2010, 5:50 pm
by Jason Caldwell
Here is an example of Content Dripping, based on day of the week.

Code: Select all
<?php if(date("l") === "Monday"){ ?>

    show content for Monday.

<?php } else if(date("l") === "Tuesday"){ ?>

    show content for Tuesday.

<?php } else if(date("l") === "Wednesday"){ ?>

    show content for Wednesday.

<?php } else if(date("l") === "Thursday"){ ?>

    show content for Thursday.

<?php } else if(date("l") === "Friday"){ ?>

    show content for Friday.

<?php } else if(date("l") === "Saturday"){ ?>

    show content for Saturday.

<?php } else if(date("l") === "Sunday"){ ?>

    show content for Sunday.

<?php } ?>

Combining this technique, along with conditional checks on the registration date of a Member.
Code: Select all
<?php if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER){ ?>

    This is some content that will be displayed to all Members.
   
    <?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 30){ ?>
       
        Drip content to Members who are more than 30 days old.

      <?php if(date("l") === "Monday"){ ?>
      
          show content for Monday.
      
      <?php } else if(date("l") === "Tuesday"){ ?>
      
          show content for Tuesday.
      
      <?php } else if(date("l") === "Wednesday"){ ?>
      
          show content for Wednesday.
      
      <?php } else if(date("l") === "Thursday"){ ?>
      
          show content for Thursday.
      
      <?php } else if(date("l") === "Friday"){ ?>
      
          show content for Friday.
      
      <?php } else if(date("l") === "Saturday"){ ?>
      
          show content for Saturday.
      
      <?php } else if(date("l") === "Sunday"){ ?>
      
          show content for Sunday.
      
      <?php } ?>

    <?php } ?>
   
    <?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 60){ ?>
        Drip content to Members who are more than 60 days old.
    <?php } ?>
   
    <?php if(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS >= 90){ ?>
        Drip content to Members who are more than 90 days old.
    <?php } ?>

<?php } ?>