When using this snippet as per instructions
here I get this error:
Fatal error: Cannot redeclare formatbytes() (previously declared in W:\www\manager\includes\document.parser.class.inc.php(729) : eval()'d code:59) in W:\www\manager\includes\document.parser.class.inc.php(729) : eval()'d code on line 77
I get the error when &summarize > 1 in the Ditto call.
If I limit the Ditto call to one item it works, but I get no output at all. The snippet returns nothing. I have traced this to the setting of the output template.
In line 28 the snippet checks if there is a specified template chunk in the snippet call. If not, it uses a default one.
28 $tpl = isset($tpl)? "$tpl" : '[+icon+] [+size+] | [+filedate+]';
In line 45 the snippet tries to set the template to a template chunk regardless of if a chunk is specified or not. If no chunk is specified this causes a blank (nonexistent) chunk with no placeholders to be used.
45 $tpl = $modx->getChunk($tpl);
I suggest changing the line 28 to this
28 $tpl = isset($tpl)? $modx->getChunk("$tpl") : '[+icon+] [+size+] | [+filedate+]';
and removing line 45 completely.