Wiki source code of News

Version 34.1 by Jean-Vincent Drean on 2009/08/06

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

Get Connected