# No search pattern so output the default html and exit the script
var $exists=call strlen $val=$srch
if not $exists
print
goto @end
else
# Create the filelist template for the search results
# Must be all on one line
var $template=
# convert reserved characters
var $template=call htmlspecialchars $val=$template
# Note: If all your search files have file-extensions (.mp3 .png etc.) set the filter to $srch*.*
# This will filter out all files without extensions (ie: index)
# Get the search results using $srch* in the xt:filelist filter
var $results = <xt:filelist sort_type="$typ" sort_dir="$dir" folder="/$fldr" template="$template" per_page="$per_page" filter="$srch*" />
endif
# No results so output the default html for no search results and exit the script
if not $results
print
No results for $srch in $fltyp
goto @end
else
# Output the results
print
$fltyp results for "$srch"
print $results
endif
@end
# Close the results output container
print
<!--/parser:xtscript-->