From: <Mic...@nt...> - 2005-11-10 18:09:21
|
Author: MichaelDaum Date: 2005-11-10 10:07:41 -0800 (Thu, 10 Nov 2005) New Revision: 7423 Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/TWiki/BlogPlugin.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAbout.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAuthorTemplate.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogDev.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogSideBar.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/NewsFeeds.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderAddComment.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesInCategory.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesOfAuthor.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogRoll.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderFrontPage.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentComments.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentPostings.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/SubjectCategoryTemplate.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebHome.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebSideBar.txt twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin.pm twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin/MANIFEST Log: Item840: * new RenderFrontPape that can page forward and backward; renamed the old frontpage layout to RenderFrontTeaser * fixed DBQUERY to skip and limit correctly * added category parameter to RECENTCOMMENTS tag * speedup improvements in getRelatedEntries() * added $depth variable to RELATEDENTRIES tag * new TopicFunction RenderRelatedEntries that generates css classes depending on the distance of the relatedness * fixed getRelatedEntries not to relate to entries that relate to disabled postings still related to the current one * SubjectCategories have their own sidebar now: with latest comments, postings and blog links being restricted to the currewnt category * w3c validation fixes (still some remaining) Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/TWiki/BlogPlugin.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/TWiki/BlogPlugin.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/TWiki/BlogPlugin.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -31,7 +31,7 @@ ---++ Plugin Info | Plugin Author: | TWiki:Main.MichaelDaum | -| Plugin Version: | 04 Nov 2005 (V0.01) | +| Plugin Version: | 10 Nov 2005 (v0.05) | | Change History: | <!-- versions below in reverse order --> | | 04 Nov 2005: | Initial version | | TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 | Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAbout.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAbout.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAbout.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -36,6 +36,12 @@ posted to this blog. %ENDSECTION{"Archive"}% +---++ Category sidebar +%SECTION{"Category"}% +You are visiting this blog by category, that is all postings here are filed into the %BASETOPIC% +category. +%ENDSECTION{"Category"}% + <!-- * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup * Set SIDEBAR = Admin Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAuthorTemplate.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAuthorTemplate.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogAuthorTemplate.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,14 +1,17 @@ -%META:TOPICINFO{author="TWikiContributor" date="1125051587" format="1.1" version="1.1"}% +%META:TOPICINFO{author="TWikiContributor" date="1131556335" format="1.1" version="1.1"}% %META:TOPICPARENT{name="TopicTemplate"}% %NOP{ * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup }% -%INCLUDE{"RenderBlogEntriesOfAuthor" NAME="%TOPIC%"}% -<style type="text/css">.natTopicForm {display:none}</style> +%INCLUDE{"RenderBlogEntriesOfAuthor" NAME="%TOPIC%" SKIP="%URLPARAM{"skip" default=" 0"}%"}% <!-- * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup --> +<style type="text/css"> + .natTopicForm {display:none} +</style> + %META:FORM{name="TopicForm"}% %META:FIELD{name="TopicType" attributes="M" title="TopicType" value="TopicTemplate"}% %META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="Template to create BlogAuthors"}% Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogDev.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogDev.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogDev.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,11 +1,11 @@ -%META:TOPICINFO{author="TWikiContributor" date="1131397119" format="1.1" version="1.1"}% -%INCLUDE{"RenderBlogEntriesInCategory" NAME="%TOPIC%"}% -%INCLUDE{"RenderBlogLinksInCategory" NAME="%TOPIC%"}% +%META:TOPICINFO{author="TWikiContributor" date="1131555747" format="1.1" version="1.1"}% +%INCLUDE{"RenderBlogEntriesInCategory" NAME="%TOPIC%" SKIP="%URLPARAM{"skip" default=" 0"}%"}% <style type="text/css">.natTopicForm {display:none}</style> <!-- * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAuthorGroup * Set WHITEBOARD = off + * Set SIDEBAR = Category --> Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogSideBar.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogSideBar.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/BlogSideBar.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,6 +1,7 @@ -%META:TOPICINFO{author="TWikiContributor" date="1130383754" format="1.1" version="1.1"}% +%META:TOPICINFO{author="MichaelDaum" date="1131636166" format="1.1" version="1.37"}% ---+ Default sidebar <div class="alt"> +<verbatim> %STARTINCLUDE% %SECTION{"Default"}%---+ About%REDDOT{"%WEB%.BlogAbout"}%%REDDOT{"%WEB%.BlogSideBar"}% <div class="blogAbout"> @@ -15,19 +16,21 @@ %INCLUDE{"RenderNewBlogEntryButton" TEXT="New Posting" warn="off"}% %INCLUDE{"RenderNewCategoryButton" TEXT="New Category" warn="off"}% %INCLUDE{"RenderNewBlogLinkButton" TEXT="New Link" warn="off"}% -%INCLUDE{"RenderRecentComments" LIMIT="10"}% +%INCLUDE{"RenderRecentComments" LIMIT="10" CAT=".*"}% %INCLUDE{"RenderRecentPostings" LIMIT="10"}% %INCLUDE{"RenderArchives"}% %INCLUDE{"RenderCategories"}% -%INCLUDE{"RenderBlogRoll"}% +%INCLUDE{"RenderBlogRoll" CAT=".*"}% <!-- %<nop>INCLUDE{"RenderVisitors"}% --> %INCLUDE{"RenderAdminTools" warn="off"}% %ENDSECTION{"Default"}% %STOPINCLUDE% +</verbatim> </div> ---+ Admin sidebar <div class="alt"> +<verbatim> %SECTION{"Admin"}%---+ About%REDDOT{"%WEB%.BlogAbout"}%%REDDOT{"%WEB%.BlogSideBar"}% <div class="blogAbout"> %INCLUDE{"BlogAbout" section="Admin"}% @@ -43,10 +46,12 @@ %INCLUDE{"RenderTopicTypes" NAME="%IFDEFINED{"%SIDEBARARG%" then="%SIDEBARARG%" else="%INCLUDINGTOPIC%"}%"}% %ENDSECTION{"Admin"}% +</verbatim> </div> ---+ BlogEntry sidebar <div class="alt"> +<verbatim> %SECTION{"BlogEntry"}%---+ About%REDDOT{"%WEB%.BlogAbout"}%%REDDOT{"%WEB%.BlogSideBar"}% <div class="blogAbout"> %INCLUDE{"BlogAbout" section="Default"}% @@ -60,17 +65,16 @@ %INCLUDE{"RenderNewBlogEntryButton" TEXT="New Posting" warn="off"}% %INCLUDE{"RenderNewCategoryButton" TEXT="New Category" warn="off"}% %INCLUDE{"RenderNewBlogLinkButton" TEXT="New Link" warn="off"}% - -<div class="blogSideBarSection"> -%RELATEDENTRIES{"%BASETOPIC%" format=" * [[$topic][$headline]]" header="---+ Related$n" depth="2"}% -</div> +%INCLUDE{"RenderRelatedEntries" NAME="%BASETOPIC%"}% %INCLUDE{"RenderRecentPostings" LIMIT="10"}% %INCLUDE{"RenderAdminTools" warn="off"}% %ENDSECTION{"BlogEntry"}% +</verbatim> </div> ---+ Aggregation sidebar <div class="alt"> +<verbatim> %SECTION{"Aggregation"}%---+ About%REDDOT{"%WEB%.BlogAbout"}%%REDDOT{"%WEB%.BlogSideBar"}% <div class="blogAbout"> %INCLUDE{"BlogAbout" section="Aggregation"}% @@ -84,13 +88,15 @@ %INCLUDE{"RenderNewBlogEntryButton" TEXT="New Posting" warn="off"}% %INCLUDE{"RenderNewCategoryButton" TEXT="New Category" warn="off"}% %INCLUDE{"RenderNewBlogLinkButton" TEXT="New Link" warn="off"}% -%INCLUDE{"RenderBlogRoll"}% +%INCLUDE{"RenderBlogRoll" CAT=".*"}% %INCLUDE{"RenderAdminTools" warn="off"}% %ENDSECTION{"Aggregation"}% +</verbatim> </div> ---+ Archive sidebar <div class="alt"> +<verbatim> %SECTION{"Archive"}%---+ About%REDDOT{"%WEB%.BlogAbout"}%%REDDOT{"%WEB%.BlogSideBar"}% <div class="blogAbout"> %INCLUDE{"BlogAbout" section="Archive"}% @@ -104,12 +110,41 @@ %INCLUDE{"RenderArchives"}% %INCLUDE{"RenderAdminTools" warn="off"}% %ENDSECTION{"Archive"}% +</verbatim> </div> +---+ Category sidebar +<div class="alt"> +<verbatim> +%SECTION{"Category"}%---+ About%REDDOT{"%WEB%.BlogAbout"}%%REDDOT{"%WEB%.BlogSideBar"}% +<div class="blogAbout"> +%INCLUDE{"BlogAbout" section="Category"}% +</div> +%IFSKINSTATETHEN{searchbox="pos2"}% +<div class="natSearchBox natSearchBoxPos2"> +%TMPL:P{"searchbox"}% +<p/> +</div> +%FISKINSTATE% +%INCLUDE{"RenderNewBlogEntryButton" TEXT="New Posting" warn="off"}% +%INCLUDE{"RenderNewCategoryButton" TEXT="New Category" warn="off"}% +%INCLUDE{"RenderNewBlogLinkButton" TEXT="New Link" warn="off"}% +%INCLUDE{"RenderRecentComments" LIMIT="10" CAT="%BASETOPIC%"}% +%INCLUDE{"RenderRecentPostings" LIMIT="10" CAT="%BASETOPIC%"}% +%INCLUDE{"RenderBlogRoll" CAT="%BASETOPIC%"}% +%INCLUDE{"RenderCategories"}% +%INCLUDE{"RenderAdminTools" warn="off"}% +%ENDSECTION{"Category"}% +</verbatim> +</div> + + ---+ Nosidebar sidebar <div class="alt"> +<verbatim> %SECTION{"nosidebar"}% %ENDSECTION{"nosidebar"}% +</verbatim> </div> <!-- Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/NewsFeeds.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/NewsFeeds.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/NewsFeeds.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1131397120" format="1.1" version="1.1"}% +%META:TOPICINFO{author="MichaelDaum" date="1131574304" format="1.1" version="1.10"}% %META:TOPICPARENT{name="FrontPage"}% ---+ %TOPIC% %FORMFIELD{"TopicDescription"}% @@ -10,8 +10,6 @@ } </style> -Want to read all feeds in a row? Then start [[%WEB%.BlogLink0][here]]. - <div class="feeds"> %~~ DBQUERY{"TopicType=~'\bSubjectCategory\b'" ~~~ format="$percntINCLUDE{\"RenderBlogLinksInCategory\" NAME=\"$topic\"}$percnt" Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderAddComment.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderAddComment.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderAddComment.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1129717878" format="1.1" version="1.1"}% +%META:TOPICINFO{author="MichaelDaum" date="1131566130" format="1.1" version="1.13"}% %META:TOPICPARENT{name="TopicFunction"}% ---+ Function: %TOPIC% %FORMFIELD{"TopicDescription"}% @@ -43,7 +43,7 @@ </td> </tr> <tr> - <td><textarea id="text" wrap="virtual" name="Text" style="width:98%" rows="10"></textarea></td> + <td><textarea id="text" wrap="virtual" name="Text" style="width:98%" rows="10" cols="80"></textarea></td> </tr> <tr> <td align="right"> Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesInCategory.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesInCategory.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesInCategory.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,10 +1,11 @@ -%META:TOPICINFO{author="TWikiContributor" date="1129733657" format="1.1" version="1.1"}% +%META:TOPICINFO{author="TWikiContributor" date="1131555980" format="1.1" version="1.1"}% %META:TOPICPARENT{name="TopicFunction"}% ---+ Function: %TOPIC% %FORMFIELD{"TopicDescription"}% ---++ Parameters * NAME: name of a SubjectCategory + * SKIP: offset into the archive ---++ Implementation <verbatim> @@ -14,7 +15,7 @@ <div class="blogArchiveDescription"> %DBQUERY{topics="%NAME%" format="$expand(TopicDescription)"}% </div> -%INCLUDE{"RenderFrontPage" FULL="3" LIMIT="10" CAT="%NAME%" AUTHOR=".*"}% +%INCLUDE{"RenderFrontPage" SKIP="%SKIP%" CAT="%NAME%" AUTHOR=".*"}% *~~ %STOPINCLUDE% </verbatim> Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesOfAuthor.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesOfAuthor.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogEntriesOfAuthor.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,10 +1,11 @@ -%META:TOPICINFO{author="TWikiContributor" date="1129733832" format="1.1" version="1.1"}% +%META:TOPICINFO{author="TWikiContributor" date="1131556010" format="1.1" version="1.1"}% %META:TOPICPARENT{name="TopicFunction"}% ---+ Function: %TOPIC% %FORMFIELD{"TopicDescription"}% ---++ Parameters * NAME: name of a BlogAuthor + * SKIP: offset into the archive ---++ Implementation <verbatim> @@ -14,7 +15,7 @@ <div class="blogArchiveDescription"> %DBQUERY{topic="%NAME%" format="$expand(TopicDescription)"}% </div> -%INCLUDE{"RenderFrontPage" FULL="3" LIMIT="10" CAT=".*" AUTHOR="%NAME%"}% +%INCLUDE{"RenderFrontPage" SKIP="%SKIP%" CAT=".*" AUTHOR="%NAME%"}% *~~ %STOPINCLUDE% </verbatim> Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogRoll.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogRoll.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderBlogRoll.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,16 +1,16 @@ -%META:TOPICINFO{author="TWikiContributor" date="1130174493" format="1.1" version="1.1"}% +%META:TOPICINFO{author="TWikiContributor" date="1131559547" format="1.1" version="1.1"}% %META:TOPICPARENT{name="TopicFunction"}% ---+ Function: %TOPIC% %FORMFIELD{"TopicDescription"}% ---++ Parameters -NONE + * CAT: reduce the blogroll to BlogLinks in the given SubjectCategory ---++ Implementation <verbatim> %STARTINCLUDE% <noautolink> -%~~ DBQUERY{"TopicType=~'\bBlogLink\b'" web="%WEB%" +%~~ DBQUERY{"TopicType=~'\bBlogLink\b' AND SubjectCategory=~'\b%CAT%\b'" web="%WEB%" ~~~ order="Name" hidenull="on" ~~~ header="<div class=\"blogSideBarSection blogSideBarAggregations\"> ~~~ $n---+ [[$web.NewsFeeds][Blogroll]]$percntREDDOT{\"%WEB%.%TOPIC%\"}$percnt" @@ -32,7 +32,7 @@ ---++ Test <div class="alt"> -%INCLUDE{"%TOPIC%"}% +%INCLUDE{"%TOPIC%" CAT=".*"}% </div> %INCLUDE{"RenderFunctionCallers"}% Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderFrontPage.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderFrontPage.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderFrontPage.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,22 +1,32 @@ -%META:TOPICINFO{author="TWikiContributor" date="1130399598" format="1.1" version="1.1"}% +%META:TOPICINFO{author="TWikiContributor" date="1131555957" format="1.1" version="1.1"}% %META:TOPICPARENT{name="TopicFunction"}% ---+ Function: %TOPIC% %FORMFIELD{"TopicDescription"}% -see: RenderFullTeaser, RenderBlogTeaser +see: RenderFullTeaser, RenderBlogTeaser, RenderFrontTeaser, RenderFrontPageNavigation ---++ Parameters - * FULL: number of full teasers - * LIMIT: number of teasers + * SKIP: offset into the archive * CAT: categories to extract * AUTHOR: extract postings of this author ---++ Implementation <verbatim> %STARTINCLUDE% -<noautolink> +~~~ +%~~ DBQUERY{ +~~~ "TopicType=~'\bBlogEntry\b' AND +~~~ SubjectCategory=~'\b%CAT%\b' AND +~~~ State='enabled' AND +~~~ BlogAuthor='%AUTHOR%' +~~~ " +~~~ limit="5" skip="%SKIP%" +~~~ order="created" reverse="on" web="%WEB%" +~~~ format="%INCLUDE{"RenderFullTeaser" section="format" NAME="$topic"}%" +~~~ }% <!-- -%~~ CALC{"$SET(postings, +%~~ CALC{" +~~~ $SET(nrPostings, *~~ %~~ DBQUERY{ ~~~ "TopicType=~'\bBlogEntry\b' AND @@ -24,32 +34,19 @@ ~~~ State='enabled' AND ~~~ BlogAuthor='%AUTHOR%' ~~~ " -~~~ limit="%LIMIT%" separator=", " order="created" reverse="on" +~~~ format="none" header="$count" separator="none" ~~~ web="%WEB%" -~~~ }% -~~~ )$IF($LISTSIZE($GET(postings))==0,$SET(postings,none))"}% +~~~ }%)"}% --> -</noautolink> -%~~ DBQUERY{ -~~~ web="%WEB%" -~~~ topics="%CALC{"$GET(postings)"}%" -~~~ limit="%FULL%" order="created" reverse="on" hidenull="on" -~~~ format="%INCLUDE{"RenderFullTeaser" section="format" NAME="$topic"}%" -~~~ }% -%~~ DBQUERY{ -~~~ web="%WEB%" -~~~ topics="%CALC{"$GET(postings)"}%" -~~~ skip="%FULL%" limit="%LIMIT%" order="created" reverse="on" hidenull="on" -~~~ header="---+ Earlier Postings$n" -~~~ format="%INCLUDE{"RenderBlogTeaser" section="format" NAME="$topic"}%" -~~~ }% +~~~ %INCLUDE{"RenderFrontPageNavigation" SKIP="%SKIP%" MAX="%CALC{"$GET(nrPostings)"}%"}% ~~~ %INCLUDE{"RenderBlogAuthorSwitch"}% +~~~ %STOPINCLUDE% </verbatim> ---++ Test <div class="alt"> -%INCLUDE{"%TOPIC%" LIMIT="2" FULL="1" CAT="BlogDev" AUTHOR=".*"}% +%INCLUDE{"%TOPIC%" SKIP="0" CAT="BlogDev" AUTHOR=".*"}% </div> %INCLUDE{"RenderFunctionCallers"}% @@ -63,4 +60,4 @@ %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 set of teasers where the first n are rendered verbosly"}% +%META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="Render a set of BlogEntries"}% Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentComments.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentComments.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentComments.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,14 +1,16 @@ -%META:TOPICINFO{author="TWikiContributor" date="1131360010" format="1.1" version="1.1"}% +%META:TOPICINFO{author="TWikiContributor" date="1131560391" format="1.1" version="1.1"}% %META:TOPICPARENT{name="TopicFunction"}% ---+ Function: %TOPIC% %FORMFIELD{"TopicDescription"}% ---++ Parameters * LIMIT: maximal number of comments to list + * CAT: restrict scope to the given SubjectCategory ---++ Implementation <verbatim> %STARTINCLUDE%%~~ RECENTCOMMENTS{ +~~~ category="%CAT%" ~~~ format=" * [[$web.$topic][$headline]] *~~ <span class=\"blogCommentCount\">$count</span><br/> ~~~ <span class=\"blogSideBarCommenter\"> @@ -30,7 +32,7 @@ ---++ Test <div class="alt"> -%INCLUDE{"%TOPIC%" LIMIT="10"}% +%INCLUDE{"%TOPIC%" LIMIT="10" CAT="BlogDev"}% </div> %INCLUDE{"RenderFunctionCallers"}% Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentPostings.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentPostings.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/RenderRecentPostings.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1129823869" format="1.1" version="1.1"}% +%META:TOPICINFO{author="TWikiContributor" date="1131560463" format="1.1" version="1.1"}% %META:TOPICPARENT{name="TopicFunction"}% ---+ Function: %TOPIC% %FORMFIELD{"TopicDescription"}% @@ -11,13 +11,16 @@ <verbatim> %STARTINCLUDE% <div class="blogSideBarSection blogSideBarLatest"> ----+ Latest %IFDEFINED{"%CAT%" then=" in %CAT%"}%%REDDOT{"%TOPIC%"}% +---+ Latest%REDDOT{"%TOPIC%"}% %~~ DBQUERY{"TopicType=~'\bBlogEntry\b' AND ~~~ State='enabled' ~~~ %IFDEFINED{"%CAT%" then="AND SubjectCategory=~'\b%CAT%\b'"}% ~~~ " ~~~ order="createdate" reverse="on" limit="%LIMIT%" ~~~ format=" * [[$topic][$formfield(Headline)]]" +~~~ footer="<style type=\"text/css\">.blogSideBarLatest { +~~~ $percntCALC{\"$dollarIF($count==0,display:none)\"}$percnt +~~~ </style>" ~~~ }% </div> %STOPINCLUDE% Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/SubjectCategoryTemplate.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/SubjectCategoryTemplate.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/SubjectCategoryTemplate.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -3,18 +3,19 @@ %NOP{ * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup }% -%INCLUDE{"RenderBlogEntriesInCategory" NAME="%TOPIC%"}% -%INCLUDE{"RenderBlogLinksInCategory" NAME="%TOPIC%"}% -<style type="text/css">.natTopicForm {display:none}</style> +%INCLUDE{"RenderBlogEntriesInCategory" NAME="%TOPIC%" SKIP="%URLPARAM{"skip" default=" 0"}%"}% <!-- * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAuthorGroup * Set WHITEBOARD = off - * Set SIDEBAR = Default - * Set SIDEBARARGS = %TOPIC% + * Set SIDEBAR = Category --> +<style type="text/css"> + .natTopicForm {display:none} +</style> + %META:FORM{name="TopicForm"}% %META:FIELD{name="TopicType" attributes="M" title="TopicType" value="TopicTemplate"}% %META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="Template to create SubjectCategories"}% Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebHome.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebHome.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebHome.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,13 +1,18 @@ -%META:TOPICINFO{author="TWikiContributor" date="1131355080" format="1.1" version="1.1"}% -%INCLUDE{"RenderFrontPage" LIMIT="10" FULL="5" CAT=".*" AUTHOR=".*"}% -<style type="text/css">.natTopicForm {display:none}</style> +%META:TOPICINFO{author="TWikiContributor" date="1131556405" format="1.1" version="1.1"}% +%INCLUDE{"RenderFrontPage" SKIP="%URLPARAM{"skip" default=" 0"}%" CAT=".*" AUTHOR=".*"}% + <!-- * Set ALLOWTOPICCHANGE = BlogAdminGroup * Set PAGETITLE = %FORMFIELD{"TopicDescription"}% * Set WHITEBOARD = off --> +<style type="text/css"> + .natTopicForm {display:none} +</style> + + %META:FORM{name="TopicForm"}% %META:FIELD{name="TopicType" attributes="M" title="TopicType" value="FrontPage"}% %META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="%25SITEMAPUSETO%25"}% Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebSideBar.txt =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebSideBar.txt 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/data/_blog/WebSideBar.txt 2005-11-10 18:07:41 UTC (rev 7423) @@ -1,4 +1,4 @@ -%META:TOPICINFO{author="TWikiContributor" date="1130399853" format="1.1" version="1.1"}% +%META:TOPICINFO{author="MichaelDaum" date="1131566032" format="1.1" version="1.28"}% ---+ %TOPIC% %FORMFIELD{"TopicDescription"}% @@ -15,6 +15,7 @@ display:none; } </style> +</div> %STOPINCLUDE% </div> Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin/MANIFEST =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin/MANIFEST 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin/MANIFEST 2005-11-10 18:07:41 UTC (rev 7423) @@ -49,6 +49,8 @@ data/_blog/RenderDocNavigation.txt data/_blog/RenderBlogLinksInCategory.txt data/_blog/RenderFrontPage.txt +data/_blog/RenderFrontPageNavigation.txt +data/_blog/RenderFrontTeaser.txt data/_blog/RenderFullTeaser.txt data/_blog/RenderFunctionCallers.txt data/_blog/RenderNewBlogEntryButton.txt Modified: twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin.pm =================================================================== --- twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin.pm 2005-11-10 17:44:09 UTC (rev 7422) +++ twiki/branches/DEVELOP/twikiplugins/BlogPlugin/lib/TWiki/Plugins/BlogPlugin.pm 2005-11-10 18:07:41 UTC (rev 7423) @@ -23,7 +23,7 @@ ); $VERSION = '$Rev$'; -$RELEASE = '0.04'; +$RELEASE = '0.05'; use Time::Local; use TWiki::Contrib::DBCacheContrib; @@ -140,7 +140,7 @@ my $theHeader = $params->{header} || ''; my $theFooter = $params->{footer} || ''; my $theLimit = $params->{limit} || ''; - my $theSkip = $params->{skip} || ''; + my $theSkip = $params->{skip} || 0; my $theHideNull = $params->{hidenull} || 'off'; $theTopics = $params->{topics} || $params->{topic}; $theWeb = $params->{web} || $theWeb; @@ -162,12 +162,14 @@ @topicNames = grep(!/$theExclude/, @topicNames) if $theExclude; # normalize - $theSkip =~ s/[^\d]//go; - $theSkip = 0 if $theSkip =~ /^$/o; + $theSkip =~ s/[^-\d]//go; + $theSkip = 0 if $theSkip eq ''; + $theSkip = 0 if $theSkip < 0; $theFormat = '' if $theFormat eq 'none'; $theSep = '' if $theSep eq 'none'; $theLimit =~ s/[^\d]//go; $theLimit = scalar(@topicNames) if $theLimit eq ''; + $theLimit += $theSkip; my ($topicNames, $hits, $msg) = &dbQuery($theSearch, $theWeb, \@topicNames, $theOrder, $theReverse); @@ -184,12 +186,14 @@ my $text = ''; if ($theFormat && $theLimit) { my $index = 0; + my $isFirst = 1; foreach my $topicName (@$topicNames) { $index++; next if $index <= $theSkip; my $root = $hits->{$topicName}; my $format = ''; - $format = $theSep if ($index > 1); + $format = $theSep unless $isFirst; + $isFirst = 0; $format .= $theFormat; $format =~ s/\$formfield\((.*?)\)/getFormField($theWeb, $topicName, $1)/geo; $format =~ s/\$expand\((.*?)\)/expandPath($theWeb, $root, $1)/geo; @@ -438,6 +442,7 @@ my $theAge = $params->{age} || 0; # 5184000 are ca 2 months TODO compute TIMESINCE reversely my $theHeader = $params->{header} || ''; my $theFooter = $params->{footer} || ''; + my $theCategory = $params->{category} || '.*'; $theAge =~ s/[^\d]+//go; $theWeb = $params->{web} || $theWeb; @@ -467,7 +472,7 @@ } } - # check if referer is enabled + # check if referer is enabled and matches the category my $baseRefName = $topicForm->fastget('BaseRef'); next unless $baseRefName; my $baseRefObj = $db{$theWeb}->fastget($baseRefName); @@ -478,6 +483,8 @@ my $state = $baseRefForm->fastget('State'); next unless $state; next unless $state eq 'enabled'; + my $category = $baseRefForm->fastget('SubjectCategory'); + next unless $category =~ /$theCategory/; # found $blogComments{$topicName}{obj} = $topicObj; @@ -622,7 +629,7 @@ my ($theWeb, $theTopic, $theDepth, $theRelatedTopics) = @_; writeDebug("getRelatedEntries($theWeb, $theTopic, $theDepth) called"); - $theRelatedTopics->{$theTopic} = 1; + $theRelatedTopics->{$theTopic} = $theDepth; writeDebug("already got " . join(",", sort keys %$theRelatedTopics)); $theDepth = 1 unless defined $theDepth; return $theRelatedTopics unless $theDepth; @@ -635,16 +642,18 @@ } else { foreach my $related (split(/, /, $relatedTopics)) { next if $theRelatedTopics && $theRelatedTopics->{$related}; - $relatedTopics{$related} = 1; + my $state = &getFormField($theWeb, $related, 'State'); + next unless $state eq 'enabled'; + $relatedTopics{$related} = $theDepth; writeDebug("found related $related"); } } # get related topics that refer to us - my ($revRelatedTopics) = &dbQuery('Related=~\'\b' . $theTopic . '\b\'', $theWeb); + my ($revRelatedTopics) = &dbQuery('Related=~\'\b' . $theTopic . '\b\' AND State=\'enabled\'', $theWeb); foreach my $related (@$revRelatedTopics) { next if $theRelatedTopics && $theRelatedTopics->{$related}; - $relatedTopics{$related} = 1; + $relatedTopics{$related} = $theDepth; writeDebug("found rev related $related"); } @@ -652,12 +661,7 @@ writeDebug("get trans related of $theTopic"); foreach my $related (keys %relatedTopics) { next if $theRelatedTopics && $theRelatedTopics->{$related}; - my $transRelatedTopics = &getRelatedEntries($theWeb, $related, $theDepth - 1, $theRelatedTopics); - if ($transRelatedTopics) { - foreach my $transRelated (keys %$transRelatedTopics) { - $theRelatedTopics->{$transRelated} = 1; - } - } + &getRelatedEntries($theWeb, $related, $theDepth - 1, $theRelatedTopics); } writeDebug("theRelatedTopics=" . join(",", sort keys %$theRelatedTopics) . " ... $theTopic in depth $theDepth"); @@ -673,6 +677,7 @@ $theTopic = $params->{_DEFAULT} || return ''; my $theFormat = $params->{format} || '$topic'; my $theHeader = $params->{header} || ''; + my $theFooter = $params->{footer} || ''; my $theSeparator = $params->{separator} || '$n'; my $theDepth = $params->{depth} || 2; $theWeb = $params->{web} || $theWeb; @@ -680,21 +685,26 @@ &initDB($theWeb); # get direct related - my $relatedTopics = &getRelatedEntries($theWeb, $theTopic, $theDepth); + my %relatedTopics; + &getRelatedEntries($theWeb, $theTopic, $theDepth, \%relatedTopics); + delete $relatedTopics{$theTopic}; + foreach my $key (keys %relatedTopics) { + $relatedTopics{$key} = $theDepth - $relatedTopics{$key}; + #print STDERR "DEBUG: $theTopic has relative $key in depth $relatedTopics{$key}\n"; + } + return '' unless scalar(keys %relatedTopics); + my @relatedTopics = sort {$relatedTopics{$a} <=> $relatedTopics{$b}} keys %relatedTopics; - # sort related topics by creation date - ($relatedTopics) = &dbQuery("State='enabled' AND name !='$theTopic'", - $theWeb, [keys %{$relatedTopics}], 'created', 'on'); - return '' if !$relatedTopics || !@$relatedTopics; - # rendere result my $result = $theHeader; my $isFirst = 1; - foreach my $related (@$relatedTopics) { + foreach my $related (@relatedTopics) { writeDebug("found related=$related"); my $text = $theFormat; $text =~ s/\$topic/$related/go; + $text =~ s/\$web/$theWeb/go; + $text =~ s/\$depth/$relatedTopics{$related}/go; # render meta data of related topics if ($text =~ /\$headline/) { @@ -710,6 +720,7 @@ $result .= $text; writeDebug("result=$result"); } + $result .= $theFooter; # subst standards $result =~ s/\$n/\n/go; |