General Actions:
Log-in
Register
Wiki:
games
▼
:
Document Index
»
Space:
Blog
▼
:
Document Index
»
Page:
Macros
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Macros
Wiki source code of
Macros
Last modified by
Administrator
on 2007/04/10 14:05
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: #macro(blog $category $nbitems $nbstart) 2: 3: #if(!$maxchars) 4: #set($maxchars = 400) 5: #end 6: 7: <div class="hfeed"> 8: #if(!$category || $category=="") 9: #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' order by doc.creationDate desc") 10: #else 11: #set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='XWiki.ArticleClass' and obj.name<>'XWiki.ArticleClassTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.creationDate desc") 12: ## TODO: feed category 13: #end 14: #set($cdate = "") 15: #set($inbitems = $xwiki.parseInt($nbitems)) 16: #set($inbstart = $xwiki.parseInt($nbstart)) 17: #foreach ($item in $xwiki.searchDocuments($sql, $inbitems, $inbstart)) 18: #set($bentrydoc = $xwiki.getDocument($item)) 19: #if($bentrydoc.fullName == $item) 20: #set($bentryobj = $bentrydoc.getObject("XWiki.ArticleClass")) 21: #set($creationDate = $xwiki.formatDate($bentrydoc.creationDate, "MMMM dd, yyyy")) 22: #if($cdate!=$creationDate) 23: <div class="article_date">$creationDate</div> 24: #set ($cdate = $creationDate) 25: #end 26: <div class="hentry"> 27: <h4 class="heading-1-1-1 entry-title">$bentrydoc.display("title","view", $bentryobj)</h4> 28: <div class="article_content entry-summary"> 29: #set($content = $bentrydoc.display("extract", "view", $bentryobj)) 30: #if($content=="") 31: #set($content = $bentrydoc.display("content", "view", $bentryobj)) 32: #if($content.length()>400) 33: #set($i = $content.lastIndexOf(" ", $maxchars)) 34: #set($i = $i + 1) 35: #set($content = "${content.substring(0,$i)} [...>${bentrydoc.fullName}]") 36: #end 37: #else 38: #set($content = "${content} [...>${bentrydoc.fullName}]") 39: #end 40: $bentrydoc.getRenderedContent($content) 41: </div> ## entry-content 42: <div class="article_footer"> 43: #set($bcategories = $bentryobj.getProperty("category").value) 44: Posted by <address class="author vcard">#userfn($bentrydoc.creator)</address> at <abbr class="published" title="#formatdateISO($bentrydoc.creationDate)">$xwiki.formatDate($bentrydoc.creationDate, "MMM dd, yyyy HH:mm")</abbr>#if($bcategories.size() > 0) in #foreach($bcategory in $bcategories)<a rel="tag" href="$xwiki.getURL("Blog.Category", "view", "category=${bcategory}")">$bcategory</a> #end#end #if($bentrydoc.date != $bentrydoc.creationDate) | Modified by <address class="author vcard">#userfn($bentrydoc.author)</address> at <abbr class="updated" title="#formatdateISO($bentrydoc.date)">$xwiki.formatDate($bentrydoc.date, "MMM dd, yyyy HH:mm")</abbr> #end | [$bentrydoc.comments.size() Comment(s)>${bentrydoc.fullName}?xpage=comments] | <a href="$bentrydoc.getURL("view")" rel="bookmark">Permalink</a> 45: </div> ## article_footer 46: </div> ## hentry 47: #end 48: #end 49: ## 50: ## prev/next links 51: #if(($inbstart != 0) || ($velocityCount==$inbitems)) 52: <div class="pagingLinks"> 53: #if ($inbstart!=0) 54: #set($iprev = $inbstart - $inbitems) 55: <span class="prevPage">[Previous>$doc.name?nbstart=${iprev}]</span> 56: #end 57: #if($velocityCount==$inbitems) 58: #set($inext = $inbstart + $inbitems) 59: <span class="nextPage">[Next>$doc.name?nbstart=${inext}]</span> 60: #end 61: <span class="clear"></span> 62: </div> ## pagingLinks 63: #end 64: </div> ## hfeed 65: #end 66: #blog($category $nbitems $nbstart)
Recent Blog Posts
Wedding Crashers
A New Slipknot
Getting to know you
A Falling Star
The Grand Reveal
Plans for First Flight
Akuma Crushed Beneath the Heel
Caelan Defeats the Snake Form
How Not to Win Friends and Influence People
Ancient Lunars and Frozen Fair Folk
Blog Categories
Games
(60)
Diaspora
(3)
Imperium
(7)
Selene's Flurry
(20)
News
(1)
Other
(0)
Personal
(0)
Blog Archive
2009
(1)
2011
(1)
2012
(1)