25.08.09
> 2 25
> 1 25
24.08.09
> 24
<?php
global $dateSource, $dateFormat;
$dateSource = isset($dateSource) ? $dateSource : "createdon";
$placeholders['groupDate'] = array(array($dateSource, "*"), "getGroupDate", $dateSource);
$dateFormat = isset($dateFormat)? $dateFormat : '%d.%m.%y';
if (!function_exists("getGroupDate")) {
function getGroupDate($resource) {
static $date = '', $id = '';
global $dateSource, $dateFormat;
if ($date !== strftime('%d.%m.%y', $resource[$dateSource]) || $id == $resource['docid']) {
$id = $resource['id'];
$date = strftime('%d.%m.%y', $resource[$dateSource]);
return strftime($dateFormat, $resource[$dateSource]);
} else {
return false;
}
}
}
?>
[+groupDate:isnot=``:then=`<p class='news_date'>[+groupDate+]</p>`+]
<p class='news_item'>
<span class='title'><a href='[~[+id+]~]'>[+pagetitle+]</a></span>
[+introtext:isnot=``:then=`<br /><span class='description'>[+introtext+]</span>`+]
</p>
Source: https://habr.com/ru/post/69342/
All Articles