Hello!
I have a problem again... because i had too many documents in parent, i didn’t see, that one document isn’t echoed out...
If there is only one document unpublished for today, i get - No documents.
Here is code, if you could check it out please...
<?php
$parent = isset($parent) ? $parent : "67";
$default = isset($default) ? $default : "1";
$table = $modx->getFullTableName("site_content");
$fields = "id";
$where = "(FROM_UNIXTIME( unpub_date, '%Y-%m-%d' ) = CURDATE( )) AND (parent = ".$parent.") AND (published = '1')";
$rs = $modx->db->select("id",$table,$where,"unpub_date ASC","30");
if($modx->db->getRecordCount($rs) >= 1) {
$row = $modx->db->getRow($rs);
while( $row = $modx->db->getRow( $rs ) ) {
$today_doc .= $row['id'].",";
}
$today_doc = substr($today_doc, 0, -1);
} else {
$today_doc = $default;
}
$output = $modx->runSnippet("Ditto_dogodki", array(
"documents" => $today_doc,
"display" => "all",
"tpl" => "ditto-prva" ));
return $output;
?>
Thank you for your help, Jure