Hi Bob, and thanks for reply,
the problem is that if you use getResources with the parameter
and, let's suppose, resource 3 is deleted, getResources shows it anyway...
I solved filtering more the target resources, this is my snippet:
<?php
$mydate=date('Y-m-d');
$c = $modx->newQuery('modTemplateVarResource');
$c->where(array(
'tmplvarid' => '20',
'value:>' => $mydate,
));
$c->sortby('value','ASC');
$ress = $modx->getCollection('modTemplateVarResource',$c);
foreach($ress as $result){
$target=$result->get('contentid');
$document = $modx->getObject('modResource',array(
'id' => $target,
'deleted' => '0'
));
if ($document) echo $document->get('id').',';
}
I imagine that there is a smarter way to do it...
but for the moment this works