Wiki source code of News
Version 48.1 by Jean-Vincent Drean on 2010/03/02
Show last authors
author | version | line-number | content |
---|---|---|---|
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 | #set($wikinames = ["xwiki", "code", "enterprise", "manager", "watch", "platform", "dev", "workspaces", "xeclipse"]) | ||
7 | <div> | ||
8 | <div id="webhomeblogdisplay" style="float:left; width: 50%;"> | ||
9 | <div style="padding-right:20px;"> | ||
10 | <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> | ||
11 | #includeForm("Blog.BlogSheet") | ||
12 | </div> | ||
13 | </div> | ||
14 | <div id="webhomeNewsdisplay" style="float:left; width: 50%;"> | ||
15 | <div style="padding-left: 20px;"> | ||
16 | <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> | ||
17 | #if(!$xwiki.hasMinorEdit() || $request.getParameter("showminor")) | ||
18 | #set ($sql = "where 1=1 and doc.comment <> 'Created user' and doc.name not like 'WatchListJob%' order by doc.date desc") | ||
19 | #else | ||
20 | #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") | ||
21 | #end | ||
22 | #set($showdata = 1) | ||
23 | #if(!$nb) | ||
24 | #set($nb = 30) | ||
25 | #end | ||
26 | #set($formatDate = "yyyy MMMM dd, HH:mm") | ||
27 | #getDocumentsModifs($list $sql $wikinames $nb) | ||
28 | <ul> | ||
29 | #foreach ($bentrydoc in $list) | ||
30 | #set($troubi ="non") | ||
31 | #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName)) | ||
32 | #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass()) | ||
33 | #set($comment = $cclass.newObject()) | ||
34 | #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0) | ||
35 | #set($comments = $bentrydoc.getComments()) | ||
36 | #else | ||
37 | #set($comments = $bentrydoc.getComments(false)) | ||
38 | #end | ||
39 | #set($createur = $xwiki.getUserName($bentrydoc.author)) | ||
40 | <li> | ||
41 | #if($comments.size()>0) | ||
42 | #set($i = 0) | ||
43 | #set($cobj = $comments.get($i)) | ||
44 | #set($comment = $bentrydoc.display("comment", "view", $cobj)) | ||
45 | #set($date = $cobj.getXWikiObject().get("date").value) | ||
46 | #if($date) | ||
47 | #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss")) | ||
48 | #end | ||
49 | #if($bentrydoc) | ||
50 | #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") ) | ||
51 | #end | ||
52 | #if($date1.equals($date2) ) | ||
53 | [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em> | ||
54 | #set($troubi ="oui") | ||
55 | #set($desc = $cobj.getXWikiObject().get("comment").value) | ||
56 | #else | ||
57 | [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName] | ||
58 | #end | ||
59 | #else | ||
60 | #set($comment = "") | ||
61 | [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName.replaceAll("@","%40")] | ||
62 | #end | ||
63 | $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm") | ||
64 | #if($troubi =="oui") | ||
65 | #set($createur = $xwiki.getUserName($cobj.author)) | ||
66 | #end | ||
67 | #if ($createur == "XWikiGuest") | ||
68 | Guest | ||
69 | #else | ||
70 | $createur | ||
71 | #end | ||
72 | </li> | ||
73 | #end | ||
74 | #end | ||
75 | </ul> | ||
76 | #if($xwiki.hasMinorEdit()) | ||
77 | #if($request.getParameter("showminor")) | ||
78 | <a href="$xwiki.getURL($tdoc.getFullName(), "view", "")">Hide minor edits</a> | ||
79 | #else | ||
80 | <a href="$xwiki.getURL($tdoc.getFullName(), "view", "showminor")">Show minor edits</a> | ||
81 | #end | ||
82 | |||
83 | |||
84 | #end | ||
85 | <h2 class="heading-1-1-1">Recent Users Added</h2> | ||
86 | #set ($sql = "where 1=1 and doc.comment = 'Created user' order by doc.date desc") | ||
87 | #set($showdata = 1) | ||
88 | #set($nb = 10) | ||
89 | #set($formatDate = "yyyy MMMM dd, HH:mm") | ||
90 | #getDocumentsModifs($list $sql $wikinames $nb) | ||
91 | <ul> | ||
92 | #foreach ($bentrydoc in $list) | ||
93 | #set($troubi ="non") | ||
94 | #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName)) | ||
95 | #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass()) | ||
96 | #set($comment = $cclass.newObject()) | ||
97 | #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0) | ||
98 | #set($comments = $bentrydoc.getComments()) | ||
99 | #else | ||
100 | #set($comments = $bentrydoc.getComments(false)) | ||
101 | #end | ||
102 | #set($createur = $xwiki.getUserName($bentrydoc.author)) | ||
103 | <li> | ||
104 | #if($comments.size()>0) | ||
105 | #set($i = 0) | ||
106 | #set($cobj = $comments.get($i)) | ||
107 | #set($comment = $bentrydoc.display("comment", "view", $cobj)) | ||
108 | #set($date = $cobj.getXWikiObject().get("date").value) | ||
109 | #if($date) | ||
110 | #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss")) | ||
111 | #end | ||
112 | #if($bentrydoc) | ||
113 | #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") ) | ||
114 | #end | ||
115 | #if($date1.equals($date2) ) | ||
116 | [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em> | ||
117 | #set($troubi ="oui") | ||
118 | #set($desc = $cobj.getXWikiObject().get("comment").value) | ||
119 | #else | ||
120 | [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName] | ||
121 | #end | ||
122 | #else | ||
123 | #set($comment = "") | ||
124 | [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName.replaceAll("@","%40")] | ||
125 | #end | ||
126 | $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm") | ||
127 | #if($troubi =="oui") | ||
128 | #set($createur = $xwiki.getUserName($cobj.author)) | ||
129 | #end | ||
130 | #if ($createur == "XWikiGuest") | ||
131 | Guest | ||
132 | #else | ||
133 | $createur | ||
134 | #end | ||
135 | </li> | ||
136 | #end | ||
137 | #end | ||
138 | </ul> | ||
139 | </div> | ||
140 | </div> | ||
141 | <div style="clear:both; margin-bottom: 40px;"><!-- --></div> | ||
142 | </div> |