{if $videos}

#### Videos See All

{foreach $videos as $video} {include file="$style_dir/blocks/video.html" display_type='normal'} {/foreach}
{/if} {if $photos}

#### Photos See All

{foreach $photos as $photo} {include file="$style_dir/blocks/photo.html" } {/foreach}
{/if} {if $users}

#### Users See All

{foreach $users as $user} {$user_details = $userquery->get_user_details($user.userid)} {include file="$style_dir/blocks/user.html" display_type='normal'} {/foreach}
{/if}
{include file="$style_dir/blocks/pagination.html"}
{if !$videos && !$photos && !$users } {lang code="no_search_results"} {/if}

#### Videos See All

{if $videos} {foreach $videos as $video} {include file="$style_dir/blocks/video.html" display_type='normal'} {/foreach}
{include file="$style_dir/blocks/pagination.html"}
{else} {lang code="no_search_results"} {/if}

#### photos See All

{if $photos} {foreach $photos as $photo} {include file="$style_dir/blocks/photo.html"} {/foreach}
{include file="$style_dir/blocks/pagination.html"}
{else} {lang code="no_search_results"} {/if}

#### Users See All

{if $users} {foreach $users as $user} {$user_details = $userquery->get_user_details($user.userid)} {include file="$style_dir/blocks/user.html" display_type='normal'} {/foreach}
{include file="$style_dir/blocks/pagination.html"}
{else} {lang code="no_search_results"} {/if}
Sort by:
{foreach $filter_results as $key => $filter}
{if $filter.0 != ''}

#### {$key}

{foreach $filter as $final} {if $final@iteration < 5}
- {if $key == 'CATEGORY' } {$category = $final} {cleanString($final.source)} ( {$final.counts} ) {elseif $key == 'AUTHOR'} {$author = $final} {cleanString(name($final.source))} ( {$final.counts} ) {elseif $key == 'VIDEO' } {$video_name = $final} {cleanString($final)} {elseif $key == 'GROUP' } {$group_name = $final} {cleanString($group_name.source)} {elseif $key =='COLLECTION' } {$collection_name = $final} {cleanString($collection_name.source)} {elseif $key == 'USER' } {$user_name = $final} {cleanString($final)} {elseif $key == 'SOURCE' } {cleanString($final.key)} ( {$final.doc_count} ) {else} {cleanString($final)} {/if}
{else} {$flag = true}
- {if $key == 'CATEGORY' } {$category = $final} {cleanString($final.source)} ( {$final.counts} ) {elseif $key == 'AUTHOR'} {$author = $final} {cleanString($final)} {elseif $key == 'VIDEO' } {$video_name = $final} {cleanString($final)} {elseif $key == 'GROUP' } {$group_name = $final} {cleanString($final.source)} ( {$final.counts} ) {elseif $key =='COLLECTION' } {$collection_name = $final} {cleanString($final.source)} ( {$final.counts} ) {elseif $key == 'USER' } {$user_name = $final} {cleanString($final)} {elseif $key == 'SOURCE' } {$source = explode(' ',$final)} {$source = $source.1} {cleanString($final)} {else} {cleanString($final)} {/if}
{/if} {/foreach}

{if $flag} More... {/if} {/if}
{/foreach}