# Get any search pattern entered
get search
# Show list or goto landing page
get_or_default __filelist_page;1
get __file_name
if $__file_name
goto @landing_page
endif
# FILELIST PAGE
# Template for filelist
var $template= .file_name.
if $use_xtcat_counters
var $template= $template $counter_label
endif
var $template= $template
var $template=call htmlspecialchars $val=$template
# Main filelist function
var $list =
# Find end of filelist entries and start of pagination
var $list_end=call strrpos $haystack=$list;$needle=||
# Create list containers
print
# Main loop
var $offset=0
@loop
# Get the next entry
var $list_entry_end=call strpos $haystack=$list;$needle=||;$offset=$offset
var $list_entry=call substr $val=$list;$start=$offset;$length=($list_entry_end-$offset)
# Get description file name
var $desc_file_name_start=call strpos $haystack=$list_entry;$needle=name=;$offset=0
var $desc_file_name_end=call strpos $haystack=$list_entry;$needle=.;$offset=$file_name_start
var $desc_file_name=call substr $val=$list_entry;$start=($desc_file_name_start+5);$length=($desc_file_name_end-$desc_file_name_start-5)
# Get description file
var $description=call source $file=$description_path/$desc_file_name;$html_safe=0;
# No description file
if not $description
delete $img
goto @output_list_entry
endif
# Is it a full html page
var $description_content_offset=call strpos $haystack=$description;$needle=;$offset=$description_content_offset
var $description_content_end=call strpos $haystack=$description;$needle=
endif
# Are item descriptions on
if not $description_in_list
goto @output_list_entry
endif
# Get the item description
var $first_text_start=call strpos $haystack=$description;$needle=xt:text;$offset=0
if $first_text_start
var $first_text_end=call strpos $haystack=$description;$needle=;$offset=($first_text_start+8)
var $first_text=call substr $val=$description;$start=($first_text_start+8);$length=($first_text_end-$first_text_start-8)
var $item_description=
>>
Visitor: T:129 M:1 W:1 D:1
$first_text
endif
#Output this entry or no results
@output_list_ent>>
>>
Share to: facebook twitter Google
Visitor: T:129 M:1 W:1 D:1