[insert_php]
global $current_user;
get_currentuserinfo();
$user_id = get_current_user_id();
$plan = get_user_meta ($user_id, ‘user_plan’, true);
$payment_date = new DateTime(get_user_meta ($user_id, ‘payment_date’, true));
$registration_date = new DateTime(get_userdata( $user_id )->user_registered);
$currentdate = new DateTime(current_time( ‘mysql’ ));
$diff = $currentdate->diff($registration_date);
$diff2 = $currentdate->diff($payment_date);
if ($plan == ‘standardoneweek’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (7 – $diff->days > 1){
echo “
“;
}
elseif (7 – $diff->days == 1){
echo “
“;
}
elseif (7 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (7 – $diff2->days > 1){
echo “
“;
}
elseif (7 – $diff2->days == 1){
echo “
“;
}
elseif (7 – $diff2->days == 0){
echo “
“;
}
}
}
if ($plan == ‘standardonemonth’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (30 – $diff->days > 1){
echo “
“;
}
elseif (30 – $diff->days == 1){
echo “
“;
}
elseif (30 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (30 – $diff->days > 1){
echo “
“;
}
elseif (30 – $diff->days == 1){
echo “
“;
}
elseif (30 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘standardthreemonths’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (90 – $diff->days > 1){
echo “
“;
}
elseif (90 – $diff->days == 1){
echo “
“;
}
elseif (90 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (90 – $diff->days > 1){
echo “
“;
}
elseif (90 – $diff->days == 1){
echo “
“;
}
elseif (90 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘standardsixmonths’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (180 – $diff->days > 1){
echo “
“;
}
elseif (180 – $diff->days == 1){
echo “
“;
}
elseif (180 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (180 – $diff->days > 1){
echo “
“;
}
elseif (180 – $diff->days == 1){
echo “
“;
}
elseif (180 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘standardoneyear’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (365 – $diff->days > 1){
echo “
“;
}
elseif (365 – $diff->days == 1){
echo “
“;
}
elseif (365 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (365 – $diff->days > 1){
echo “
“;
}
elseif (365 – $diff->days == 1){
echo “
“;
}
elseif (365 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘premiumoneweek’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (7 – $diff->days > 1){
echo “
“;
}
elseif (7 – $diff->days == 1){
echo “
“;
}
elseif (7 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (7 – $diff->days > 1){
echo “
“;
}
elseif (7 – $diff->days == 1){
echo “
“;
}
elseif (7 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘premiumonemonth’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (30 – $diff->days > 1){
echo “
“;
}
elseif (30 – $diff->days == 1){
echo “
“;
}
elseif (30 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (30 – $diff->days > 1){
echo “
“;
}
elseif (30 – $diff->days == 1){
echo “
“;
}
elseif (30 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘premiumthreemonths’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (90 – $diff->days > 1){
echo “
“;
}
elseif (90 – $diff->days == 1){
echo “
“;
}
elseif (90 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (90 – $diff->days > 1){
echo “
“;
}
elseif (90 – $diff->days == 1){
echo “
“;
}
elseif (90 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘premiumsixmonths’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (180 – $diff->days > 1){
echo “
“;
}
elseif (180 – $diff->days == 1){
echo “
“;
}
elseif (180 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (180 – $diff->days > 1){
echo “
“;
}
elseif (180 – $diff->days == 1){
echo “
“;
}
elseif (180 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == ‘premiumoneyear’){
if (!get_user_meta ($user_id, ‘payment_date’, true)){
if (365 – $diff->days > 1){
echo “
“;
}
elseif (365 – $diff->days == 1){
echo “
“;
}
elseif (365 – $diff->days == 0){
echo “
“;
}
}
if (get_user_meta ($user_id, ‘payment_date’, true)){
if (365 – $diff->days > 1){
echo “
“;
}
elseif (365 – $diff->days == 1){
echo “
“;
}
elseif (365 – $diff->days == 0){
echo “
“;
}
}
}
if ($plan == “not paid”){
echo “
“;
}
[/insert_php]