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

---++ Parameters
   * AUTHOR: only list unpublished stuff by the given author (optional)

---++ Implementation
<verbatim>
%STARTINCLUDE%
*~~
%~~ DBQUERY{"TopicType=~'\bBlogEntry\b' AND State='unpublished' AND name=~'^\bBlog'
~~~     %IFDEFINED{"%AUTHOR%" then="AND BlogAuthor=~'\b%AUTHOR%\b'" glue="off"}%"
~~~   order="created" reverse="on"
~~~   hidenull="on"
~~~   header="
~~~     <div class=\"blogSideBarSection blogSideBarCategories\">
~~~       <h1>Unpublished$percntREDDOT{\"%WEB%.%TOPIC%\"}$percnt</h1>
~~~       <noautolink><ul style=\"margin-top:0px;margin-bottom:0px;\">"
~~~   format="<li>
~~~     <a href=\"%SCRIPTURLPATH{"view"}%/$web/$topic\"
~~~       title=\"link to <nop>$topic\">
*~~       $formfield(Headline)
~~~     </a>$percntREDDOT{\"$web.$topic\" style=\"margin:0;padding:0;\"}$percnt</li>"
~~~   footer="</ul></noautolink></div>"
~~~ }%
*~~
%STOPINCLUDE%
</verbatim>

<!-- interrupt glue -->

---++ Test
<div class="alt">
%DBCALL{"%TOPIC%"}%
</div>

%DBCALL{"RenderFunctionCallers"}%

<!--
   * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup
   * Set ALLOWTOPICVIEW = %MAINWEB%.BlogAuthorGroup
   * 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="Render a list of BlogEntries that are not yet published"}%
