Statistics: Posted by jeffreygaudette — January 12th, 2011, 3:06 pm
Statistics: Posted by Guest — November 8th, 2010, 2:15 pm
define("PREVIEW_EXPIRY", "86400"); // 1 day = 86400 seconds
<?php
if(is_single()) {
$pubDate = get_the_date('c');
$pubUnix = strtotime($pubDate);
$now = time();
if(($now - $pubUnix) > PREVIEW_EXPIRY) {
$expired = true;
}
}
?>
<?php if (current_user_can("access_s2member_level1")){ ?>
[This gets shown to people with whatever access you're testing for in that if statement]
<?php } else { // These are our non-subscribers ?>
<?php // Then in here, we can say:
if($expired) {
[ This post is more than PREVIEW_EXPIRY old, so show limited content ]
} else {
[ This post is less than PREVIEW_EXPIRY old, so show full content temporarily ]
}
?>
<?php } ?>
Statistics: Posted by sugeneris — November 8th, 2010, 1:57 pm
Statistics: Posted by Guest — November 7th, 2010, 4:20 pm
Statistics: Posted by jeffreygaudette — November 4th, 2010, 2:34 pm
Statistics: Posted by BozoTheClown — October 6th, 2010, 4:30 am