Bob wrote:Additionally I did not find either simple way to get back the date of edition (from a page) in the content file with a php script, what I managed to make easily with pagedata.php (to display this date near to the newsbox title). $s is the pointer of the shown page but not of the newsbox within the page...
Hm, the latter problem already existed with former CMSimple_XH version, didn't it? Finding the correct page-data record could be solved by knowing the index of the news page, or by using the information in $page_data['url']. The latter method has some quirks, as this 'url' might not be correctly set (at least it is not guaranteed to, although I'm not aware that this actually happens), and because the page heading is not necessarily equal to the URL. However, usually the following function in
userfuncs.php should suffice:
Code: Select all
function showLastEdit($heading)
{
global $pd_router;
$pages = $pd_router->find_field_value('url', $heading);
$page = current($pages);
$timestamp = $page['last_edit'];
return date('Y-m-d', $timestamp);
}
Then you can insert the appropriate plugin call in the newsbox:
Instead of reading pagedata.php as in former versions, you can use the following idiom (worked already in earlier versions, and is faster, because pagedata.php doesn't have to be read again):
Code: Select all
$page_data = $pd_router->find_all();