Wiki source code of News

Version 43.3 by Vincent Massol on 2009/09/25

Show last authors
1 $context.setCacheDuration(300)
2 1 News
3
4 Find below all the recent news from the site blog and from the list of pages that have been changed recently.
5
6 #includeMacros("Main.Macros")
7 #set($wikinames = ["xwiki", "code", "enterprise", "manager", "watch", "platform", "dev", "workspaces", "xeclipse"])
8 <div>
9 <div id="webhomeblogdisplay" style="float:left; width: 50%;">
10 <div style="padding-right:20px;">
11 <h2 class="heading-1-1-1">Blog <a href="$xwiki.getURL("Blog.GlobalBlogRss", "view", "xpage=plain")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" alt="rss icon"/></a></h2>
12 #includeMacros("Blog.BlogCode")
13 #set ($blogDoc = $xwiki.getDocument("Blog.WebHome"))
14 #if($context.action != 'inline')
15 #getBlogEntries($blogDoc $entries)
16 #displayBlog($entries 'index' true true)
17 #displayNavigationLinks($blogDoc)
18 #end
19 </div>
20 </div>
21 <div id="webhomeNewsdisplay" style="float:left; width: 50%;">
22 <div style="padding-left: 20px;">
23 <h2 class="heading-1-1-1">Recent Pages Changed <a href="$xwiki.getURL("Main.WebRss", "view", "xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" alt="rss icon"/></a></h2>
24 #if(!$xwiki.hasMinorEdit() || $request.getParameter("showminor"))
25 #set ($sql = "where 1=1 and doc.comment <> 'Created user' and doc.name not like 'WatchListJob%' order by doc.date desc")
26 #else
27 #set ($sql = ", XWikiRCSNodeInfo as ni where doc.id=ni.id.docId and ni.id.version2=1 and doc.comment <> 'Created user' and doc.name not like 'WatchListJob%' group by doc.web, doc.name order by max(ni.date) desc")
28 #end
29 #set($showdata = 1)
30 #if(!$nb)
31 #set($nb = 30)
32 #end
33 #set($formatDate = "yyyy MMMM dd, HH:mm")
34 #getDocumentsModifs($list $sql $wikinames $nb)
35 <ul>
36 #foreach ($bentrydoc in $list)
37 #set($troubi ="non")
38 #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName))
39 #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
40 #set($comment = $cclass.newObject())
41 #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0)
42 #set($comments = $bentrydoc.getComments())
43 #else
44 #set($comments = $bentrydoc.getComments(false))
45 #end
46 #set($createur = $xwiki.getUserName($bentrydoc.author))
47 <li>
48 #if($comments.size()>0)
49 #set($i = 0)
50 #set($cobj = $comments.get($i))
51 #set($comment = $bentrydoc.display("comment", "view", $cobj))
52 #set($date = $cobj.getXWikiObject().get("date").value)
53 #if($date)
54 #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss"))
55 #end
56 #if($bentrydoc)
57 #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") )
58 #end
59 #if($date1.equals($date2) )
60 [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em>
61 #set($troubi ="oui")
62 #set($desc = $cobj.getXWikiObject().get("comment").value)
63 #else
64 [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName]
65 #end
66 #else
67 #set($comment = "")
68 [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName.replaceAll("@","%40")]
69 #end
70 $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")
71 #if($troubi =="oui")
72 #set($createur = $xwiki.getUserName($cobj.author))
73 #end
74 #if ($createur == "XWikiGuest")
75 Guest
76 #else
77 $createur
78 #end
79 </li>
80 #end
81 #end
82 </ul>
83 #if($xwiki.hasMinorEdit())
84 #if($request.getParameter("showminor"))
85 <a href="$xwiki.getURL($tdoc.getFullName(), "view", "")">Hide minor edits</a>
86 #else
87 <a href="$xwiki.getURL($tdoc.getFullName(), "view", "showminor")">Show minor edits</a>
88 #end
89
90
91 #end
92 <h2 class="heading-1-1-1">Recent Users Added</h2>
93 #set ($sql = "where 1=1 and doc.comment = 'Created user' order by doc.date desc")
94 #set($showdata = 1)
95 #set($nb = 10)
96 #set($formatDate = "yyyy MMMM dd, HH:mm")
97 #getDocumentsModifs($list $sql $wikinames $nb)
98 <ul>
99 #foreach ($bentrydoc in $list)
100 #set($troubi ="non")
101 #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName))
102 #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
103 #set($comment = $cclass.newObject())
104 #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0)
105 #set($comments = $bentrydoc.getComments())
106 #else
107 #set($comments = $bentrydoc.getComments(false))
108 #end
109 #set($createur = $xwiki.getUserName($bentrydoc.author))
110 <li>
111 #if($comments.size()>0)
112 #set($i = 0)
113 #set($cobj = $comments.get($i))
114 #set($comment = $bentrydoc.display("comment", "view", $cobj))
115 #set($date = $cobj.getXWikiObject().get("date").value)
116 #if($date)
117 #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss"))
118 #end
119 #if($bentrydoc)
120 #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") )
121 #end
122 #if($date1.equals($date2) )
123 [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em>
124 #set($troubi ="oui")
125 #set($desc = $cobj.getXWikiObject().get("comment").value)
126 #else
127 [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName]
128 #end
129 #else
130 #set($comment = "")
131 [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName.replaceAll("@","%40")]
132 #end
133 $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")
134 #if($troubi =="oui")
135 #set($createur = $xwiki.getUserName($cobj.author))
136 #end
137 #if ($createur == "XWikiGuest")
138 Guest
139 #else
140 $createur
141 #end
142 </li>
143 #end
144 #end
145 </ul>
146 </div>
147 </div>
148 <div style="clear:both; margin-bottom: 40px;"><!-- --></div>
149 </div>

Get Connected