filters="${_GET[f]}"
debug "FILTERS: $filters"
+present_filter(){ printf %s "$*" |sed -r 's;(^|!|\^|\|)([^!\^\|:]+:);\1;g;s;\^; \&\; ;g' }
+
+if [ -n "$search" ]; then
+ TITLE="$search by $order"
+elif [ -n $filter ]; then
+ TITLE="$(present_filter "$filter") by $order"
+else
+ TITLE="List by $order"
+fi
+
quicklinks(){
output=''
tac ${_DATA}/meta/recent \
| while [ "$(printf %s "$output" |wc -l)" -lt 10 ] && read line; do
- line="<a href="$line">$line</a>"
printf %s "$output" |grep -qF "$line" || output="$output$line$LF"
done
- printf %s\\n "$output"
+ printf %s "$output" |while read line; do
+ linef=$(printf %s "$line" |sed -r 's;^.*(\?|&)f=([^&]+)&?.*$;\2;g')
+ lineo=$(printf %s "$line" |sed -r 's;^.*(\?|&)o=([^&]+)&?.*$;\2;g')
+ printf %s "<a href="$line">by ${lineo}: $(present_filter "$linef")</a>"
+ done
}
category_selected(){
location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)"
directory="${location%/*}"
+TITLE="$info"
+
meta="${_DATA}/meta/$info.meta"
[ -n "$info" ] && video="${_DATA}/videos/$info" \
|| video="${treeroot%/}/${location#/}"
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Serve0
#
<html>
<head>
<meta name="viewport" content="width=device-width">
- <title>${PAGE}</title>
+ <title>${TITLE:-${PAGE}}</title>
<style type="text/css">
<!--
$(. "${_EXEC}/templates/common.css.sh")