%META:TOPICINFO{author="TWikiContributor" date="1432077376" format="1.1" version="1"}% %META:TOPICPARENT{name="WebSearch"}% ---+ %MAKETEXT{"Search Attachments in [_1] Web" args="%BASEWEB%"}%
%MAKETEXT{"Attachment name:"}%   [[%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?tf=*;af=*][%MAKETEXT{"Show all"}%]] %VBAR% [[%SYSTEMWEB%.SearchHelp][%MAKETEXT{"Help"}%]]
%MAKETEXT{"Use wildcards, such as =*.doc="}%
%MAKETEXT{"Topic name:"}%
%MAKETEXT{"Use wildcards, such as =*= for all topics"}%
%SET{ "tf" value="%URLPARAM{ "tf" encode="quote" }%" }% %SET{ "af" value="%CALCULATE{ $LOWER( $SUBSTITUTE( $SUBSTITUTE( $SUBSTITUTE( $SUBSTITUTE( '''%URLPARAM{ "af" encode="off" }%''', ., \., ), +, \+ ), *, .* ), ?, . ) )}%" note_to_developer="The CALCULATE functions change a wildcard to a regular expression" }% %CALCULATE{$SET(topics, 0)$SET(attachments, 0)}% %SEARCH{ "[%]META:FILEATTACHMENT{name=\"%GET{af}%\" a[a-z]+=" type="regex" web="%BASEWEB%" topic="%GET{tf}%" format="$percntCALCULATE{ | *$NOP(%)ICON{viewtopic}$NOP(%) $CHAR(32) [[$web.$topic][$topictitle]] topic: $SETLIST( attNames, $LISTEACH( $SETHASH(attNameIndex, $index, $item)$item, $query(attachments.name) ) ) $LIST2HASH( attComments, $LISTEACH( $GETHASH(attNameIndex, $index)$CHAR(44)$CHAR(32)$item, $query(attachments.comment, quote:''') ) ) $LIST2HASH( attDates, $LISTEACH( $GETHASH(attNameIndex, $index)$CHAR(44)$CHAR(32)$item, $query(attachments.date) ) ) $LIST2HASH( attUsers, $LISTEACH( $GETHASH(attNameIndex, $index)$CHAR(44)$CHAR(32)$item, $query(attachments.user) ) ) $SETLIST( afNames, $LISTIF( $SEARCH( %GET{af}%, $LOWER($item) ), $GETLIST(attNames) ) ) $SET( num, $LISTSIZE( $GETLIST(afNames) ) ) $SETM(topics, +1) $SETM(attachments, +$GET(num))* || $CHAR(10) $LISTJOIN( $CHAR(10), $LISTEACH( |
$NOP(%)ICON{$IF($index<$GET(num), dot_udr, dot_ur)}$NOP(%) $NOP(%)ICON{ \"$item\" default=\"else\" }$NOP(%) $CHAR(32) [[%PUBURL%/$web/$topic/$item][$item]] $SUBSTITUTE( $GETHASH(attComments, $item), |, %VBAR% ) | $FORMATTIME( $GETHASH(attDates, $item), $year-$mo-$day )''',''' $CHAR(32) $NOP(%)USERINFO{ \"$GETHASH(attUsers, $item)\" format=\"$wikiusername\" }$NOP(%)
|, $GETLIST(afNames) ) )}$percnt" nonoise="on" }%
%MAKETEXT{"Total:"}% %CALCULATE{$GET(topics) topic$IF($GET(topics)!=1, s), $GET(attachments) attachment$IF($GET(attachments)!=1, s)}%
*%MAKETEXT{"Other search options:"}%* * icon:searchtopic [[%BASEWEB%.WebSearch][%MAKETEXT{"Simple search"}%]] * icon:searchtopic [[%BASEWEB%.WebSearchAdvanced][%MAKETEXT{"Advanced search"}%]] * icon:arrowright %MAKETEXT{"If you already know the name of the topic, enter the name of the topic into the ~[~[[_1]~]~[Jump box~]~] at the top" args="%SYSTEMWEB%.JumpBox"}% * icon:indexlist [[%BASEWEB%.WebTopicList][%MAKETEXT{"List all topics in the [_1] web in alphabetical order" args="%INCLUDINGWEB%"}%]] * icon:filter %MAKETEXT{"List topics that start with the letter:"}% %CALCULATE{$LISTEACH($item, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)}% * icon:recentchanges [[%INCLUDINGWEB%.WebChanges][%MAKETEXT{"Recently changed topics"}%]]