7 length=0; width=0; height=0;
8 if [ -r "$meta" ]; then
9 head -n1 "$meta" |read length width height info
10 tags="$(sed -n 2p "$meta" |sed -r 's:^\|(.*)$:\1:')"
11 description="$(sed -n '3,$p' "$meta")"
14 egrep -q "(^|.*\|)$tag(\|.*|$)" <<<"$tags" || tags="$tag|$tags"
17 $length $width $height $info
24 if [ -n "${CONTENT_LENGTH}" -a "${CONTENT_LENGTH}" -gt 0 ]; then
25 (head -c "${CONTENT_LENGTH}"; echo)|sed 's/&/\n/g' |while read line; do
26 if expr "$line" : "tagsel=" >/dev/null; then
28 tagsel[$n]="$(echo -e "$(sed -nr 's:(^|&)tagsel=(.*)(&|$):\2:;s:&.*$::;s:\+: :g;s:%:\\x:g;p' <<<"$line" )")"
29 elif expr "$line" : "ctag=" >/dev/null; then
30 tag="$(sed -r 's:^ctag=(.*)$:\1:;s:\+:_:g;s:%:\\x:g' <<<"$line")"
31 tag="$(echo -e "${tag}" |sed -r 's:\t| :_:g;s:^!|\r|\$|\^::g;s:\\:\\\\:g;s/</\<\;/g;s/>/\>\;/g')"
33 addtag "${_DATA}/meta/$tagsel[$i].meta" "$tag"
34 rm "${_DATA}/cache/$tagsel[$i].cache" 2>/dev/null
36 elif expr "$line" : 'tags=.\+' >/dev/null; then
37 tags="$(sed -r 's:^tags=(.*)$:\1:;s:\+:_:g;s:%:\\x:g' <<<"$line")"
38 tags="$(echo -e "${tags}" |sed -r 's:\t| :_:g;s:^!|\r|\$|\^::g;s:\\:\\\\:g;s/</\<\;/g;s/>/\>\;/g')"
39 for i in {1..$n}; do echo "$tags" |while read tag; do
40 addtag "${_DATA}/meta/$tagsel[$i].meta" "$tag"
41 rm "${_DATA}/cache/$tagsel[$i].cache" 2>/dev/null
47 rm "${_DATA}"/cache/\?* 2>/dev/null
49 echo -n "Location: i?${QUERY_STRING}#$info\n\n"