you can try this snippet or someting like that. It stores the docid and the date in a chunk named daylidoc and returns for each day a new random docid.
<?php
//[[daylidoc? &parent=`13`&chunkname=`daylidoc`&excludedocs=`18`]]
//[[daylidoc? &parent=`13`&chunkname=`daylidoc`&mode=`week`&dayoffset=`5`]]
$chunkname = isset ($chunkname)?$chunkname:'daylidoc';
$mode = isset ($mode)?$mode:'day';//day,week,month
$dayoffset = isset ($dayoffset)?$dayoffset:1;
if ( isset ($parent))
{
$table = $modx->getFullTablename('site_htmlsnippets');
$rs = $modx->db->select('*', $table, 'name="'.$chunkname.'"');
$chunk = $modx->db->getRow($rs);
date_default_timezone_set('Europe/Berlin');
switch($mode)
{
case 'month':
$dateformat = '%m.%Y';
$date = @strftime($dateformat);
break;
case 'week':
$timestamp=time();
$ts_dow = ($w = date("w", $timestamp))?$w:7;
$ts_day = strftime("%d", $timestamp);
$ts_month = strftime("%m", $timestamp);
$ts_year = strftime("%Y", $timestamp);
$timestampweekstart = mktime(0, 0, 0, $ts_month, $ts_day-$ts_dow+$dayoffset, $ts_year);
$dateformat = '%d.%m.%Y';
$date = 'week starts at '.@strftime($dateformat,$timestampweekstart);
break;
case 'day':
default:
$dateformat = '%d.%m.%Y';
$date = @strftime($dateformat);
}
$fields['description'] = 'randomID for '.$date;
$randomDocID = $chunk['snippet'];
if (is_array($chunk)){
$excludedocs=isset($excludedocs)?explode(',',$excludedocs):array();
$excludedocs[]=$randomDocID;
$excludedocs=implode(',',$excludedocs);
}
$excludedocs=isset($excludedocs)?' AND id not IN ('.$excludedocs.')':'';
if (is_array($chunk))
{
if ($fields['description'] !== $chunk['description'])
{
$table2 = $modx->getFullTablename('site_content');
$rs = $modx->db->select('id,rand() as random', $table2, 'parent='.$parent.$excludedocs, 'random', '1');
$randomdoc = $modx->db->getRow($rs);
if (is_array($randomdoc))
{
$fields['snippet'] = $randomDocID = $randomdoc['id'];
$modx->db->update($fields, $table, 'name="'.$chunkname.'"');
}
}
}
else
{
$table2 = $modx->getFullTablename('site_content');
$rs = $modx->db->select('id,rand() as random', $table2, 'parent='.$parent.$excludedocs, 'random', '1');
$randomdoc = $modx->db->getRow($rs);
if (is_array($randomdoc))
{
$fields['snippet'] = $randomDocID = $randomdoc['id'];
$fields['name'] = $chunkname;
$modx->db->insert($fields, $table);
}
}
}
return $randomDocID;
?>
and use it in the ditto-call like that:
[!Ditto? &documents=`[[daylidoc? &parent=`13`&chunkname=`daylidoc`&excludedocs=`18`]]` &tpl=`Article_Summary` &extenders=`summary` &truncLen=`500`!]