* Graham * JavaExperts This script assumes that all that is in /main is subfolders and a index file
and all the sub folders just contain the files being counted and a index file
if the sub folders do not contain a index file change the maths to
var $total=($total+$subc)
beware of timeouts on very large main folders and sub folders

<!--parser:xtscript-->
var $flist=<xt:filelist folder="/main" template="|.file_name." filter="-index"/>|
var $start=1
@loop
var $end = call strpos $haystack=$flist;$needle=|;$offset=($start+1);
if $end >0
var $subf = call substr $val=$flist;$start=$start;$length=($end-$start)
var $subc = <xt:filecount folder="/main/$subf" />
var $total=($total+$subc-1)
var $start = ($end+1)
goto @loop
endif
print $total
<!--/parser:xtscript-->

Copy code
2015-03-15 09:53 (edited 2015-03-15 10:06 by Graham ) · (0)

Online: Guests: 1