How to display page permission expire time?

Permalink
I would like to output the End Date/Time from the page permissions scheduler so the user can see when the page will expire.
Anyone know how to achieve that?

flourish
 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
SheldonB had the same request, solved with 'Magic Data' and 'Last Updated'.

http://www.concrete5.org/community/forums/customizing_c5/show-user-...

http://www.concrete5.org/marketplace/addons/magic-data/...

The actual details of the symbols used are in a support request, so I have copied some of that here. If you need to know more, please ask.
++++
When learning Magic Data, it often helps to build up sets of symbols piece by piece and evaluate each part and also conduct some experiments on the way.

UID - should return a number for the current user ID

SET Members AS_GROUP - should return a number for the group ID, showing that you have such a group.

UID GROUP_EXIT_TIME Members - should return the exit time from the group (if it is in the future) or null if the user is no longer in the group. This will be a long number like 1378045849 (but above that, this is the time I am writing).

TIME DATE "d M Y" - should return todays date
TIME DATE DATE_APP_GENERIC_MDYT_FULL - as above, but more detail and verbose.

UID GROUP_EXIT_TIME Members DATE DATE_APP_GENERIC_MDYT_FULL - a verbose form of what you are aiming for.

UID GROUP_EXIT_TIME Members FRIENDLY_DATE Human - your destination.

Once you have the above working, bear in mind that you also need to cater for the situation of users not in the Members group. You could do that using more complex Magic Data expressions. However, its probably easier and more practical to use block permissions and only show this block to Members, then another block about joining for those who are not Members.
==========
flourish replied on at Permalink Reply
flourish
Perfect, that's what I was looking for!
Your addon appears to be very robust and offer capabilities far beyond what I need at the moment. I will be back to purchase it later.

For now I found a quick and dirty way to print the expire time.
I chose a specific permission DATE/TIME, created a page attribute to match, then output the page attribute to the page.
Displaying it was straight forward...

$Page_Expires = $c->getAttribute('page_expires');
echo "This page will expire on: " . $Page_Expires;

Thanks for sharing details about Magic Data. It's definitely on my "Need to Have" list.