Wiki source code of recentModificationsUpdater

Version 1.1 by Holger Dick on 2009/07/24 22:44

Show last authors
1 #set($recentlyCreated = $xwiki.searchDocuments("where space not like 'XWiki' and space not like 'Scheduler' and space not like 'Stats' order by doc.date desc", 5, 0))
2 #set($recentMods = $xwiki.getDocument("XWiki.recentModifications"))
3 #set($somestring = "<table class='stats' cellspacing='0' cellpadding='0'>")
4 #if($recentlyCreated.size() > 0)
5 #foreach($docname in $recentlyCreated)
6 #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
7 #set($userdoc = $xwiki.getDocument("${rdoc.getAuthor()}")) $userdoc.use("XWiki.XWikiUsers")
8 #set($name = $rdoc.displayTitle)
9 #if($name.length() >= 20)
10 #set($names= "${name.substring(0, 18)}")
11 #set($names= $names.concat('...'))
12 #else
13 #set($names= $name)
14 #end
15 #set($somestring = "$somestring" + "<tr><td style='border-width: 0px 0px 1px 0px; border-style: dashed; border-color: white;'><a href='$rdoc.getURL('view')'>$names</a></td><td style='border-width: 0px 0px 1px 0px; border-style: dashed; border-color: white;'>#if($userdoc.attachmentList.size()>0) #set($attach = $userdoc.attachmentList.get(0)) <img src='$userdoc.getAttachmentURL($attach.filename,'download', 'height=25')' height='25'/>#end</td></tr>")
16 #end
17 #set($somestring = "$somestring" + "</table>")
18 #else
19 #set($somestring = 'No Recent Updates :(')
20 #end
21 $recentMods.setContent("$somestring")
22 $recentMods.save()