%META:TOPICINFO{author="TWikiContributor" date="1141838558" format="1.1" version="1.1"}%
%META:TOPICPARENT{name="TopicFunction"}%
---+!! Function: %TOPIC%
%FORMFIELD{"TopicDescription"}%

---++ Parameters
   * QUERY: the item to be searched for in the archive

---++ Implementation
<verbatim>
%STARTINCLUDE%
*~~
%STOPALIASAREA%
<noautolink>
*~~
<div class="blogArchiveLexMins">
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=1" 
~~~    title="every occurrence" 
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="1" then="class=\"current\"" glue="off"}%>1</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=2" 
~~~    title="at least two ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="2" then="class=\"current\"" glue="off"}%>2</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=3" 
~~~    title="at least three ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="3" then="class=\"current\"" glue="off"}%>3</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=4" 
~~~    title="at least four ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="4" then="class=\"current\"" glue="off"}%>4</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=5" 
~~~    title="at least five ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min" default="5"}%" as="5" then="class=\"current\"" glue="off"}%>5</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=6" 
~~~    title="at least six ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="6" then="class=\"current\"" glue="off"}%>6</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=7" 
~~~    title="at least seven ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="7" then="class=\"current\"" glue="off"}%>7</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=8" 
~~~    title="at least eight ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="8" then="class=\"current\"" glue="off"}%>8</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=9" 
~~~    title="at least nine ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="9" then="class=\"current\"" glue="off"}%>9</a>
  </span>
  <span class="blogArchiveLexMin">
    <a rel="nofollow" href="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?mode=lex;min=10" 
~~~    title="at least ten ocurrences"
~~~    %IFDEFINED{"%URLPARAM{"min"}%" as="10" then="class=\"current\"" glue="off"}%>10</a>
  </span>
</div>
*~~
%~~ TAGCLOUD{
~~~   "$percntDBQUERY{\"TopicType=~'\bBlogEntry\b' AND State='published'\"
~~~     format=\"$formfield(Headline) $formfield(Teaser) $formfield(Text)\" 
~~~     separator=\", \"
~~~   }$percnt"
~~~   header="<div class=\"blogArchiveTagCloud\">"
~~~   group="<strong>$group</strong>"
~~~   format="<span style=\"font-size:$weightpx;line-height:90%;margin:0;padding:0;\">
~~~     <a href=\"%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?
*~~          mode=lex;
*~~          search=$term;
*~~          min=%URLPARAM{"min" default="5"}%
*~~          #hits
*~~       \"
~~~        class=\"$percntCALC{\"$IF($EXACT(%QUERY%,$term),current)\"}$percnt\"
~~~        style=\"color:$fadeRGB(%TAGCLOUDFADE%);\"
~~~        title=\"$count\">$term</a></span>"
~~~   footer="</div>"
~~~   min="%URLPARAM{"min" default="5"}%"
~~~   buckets="40"
~~~   offset="9"
~~~   stopwords="on"
~~~   plural="off"
~~~   exclude="http.*|citeblog.*|xxxxxxxxxx|www.*|WebPreferences|WebHome|
*~~     com|ve|([A-Z]+)"
~~~   map="twiki=TWiki"
~~~ }%
%IFDEFINEDTHEN{"%QUERY%"}%
%~~   $nopDBCALL{"RenderBlogArchiveHitList"
~~~     QUERY="AND (Headline=~'%QUERY%' OR Teaser=~'%QUERY%' OR Text=~'%QUERY%')"
~~~     PARAMS="
*~~       mode=lex;
*~~       min=%$nopURLPARAM{"min" default="5"}%;
*~~       search=%QUERY%
*~~       #hits
*~~     "
~~~   }%
%FIDEFINED%
</noautolink>
%STARTALIASAREA%
*~~
%STOPINCLUDE%
</verbatim>

<!-- interrupt glue -->

---++ Test
See BlogArchive.

%DBCALL{"RenderFunctionCallers"}%

<!--
   * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup
   * Set SIDEBAR = Admin
   * Set SIDEBARARG = TopicFunction
-->


%META:FORM{name="TopicForm"}%
%META:FIELD{name="TopicType" attributes="M" title="TopicType" value="TopicFunction"}%
%META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="Renders the BlogArchive in CAT mode"}%
