
<?php
if($modx->db->getRecordCount($rs) >= 1) {
$row = $modx->db->getRow($rs);
// go trough the results and build the document list
while( $row = $modx->db->getRow( $rs ) ) {
$today_doc .= $row['id'].",";
}
// remove the extra comma
$today_doc = substr($today_doc, 0, -1);
} else {
$today_doc = $default;
}?><?php
$parent = isset($parent) ? $parent : "0";
$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 DESC","5");
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" => $display,
"tpl" => "ditto-prva" ));
return $output;
?><?php
$parent = isset($parent) ? $parent : "0";
$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 DESC","5");
if($modx->db->getRecordCount($rs) >= 1) {
while( $row = $modx->db->getRow( $rs ) ) {
$today_doc .= $row['id'].",";
}
$today_doc = substr($today_doc, 0, -1);
} else {
$today_doc = $default;
} // <= THIS IS THE MISSING BRACKET
$output = $modx->runSnippet("Ditto_dogodki", array(
"documents" => $today_doc,
"display" => $display,
"tpl" => "ditto-prva" ));
return $output;
?>
... it works fine, but i have another problem. It echos out max. 3 docs... and i have nowhere limit to 3...