Wiki source code of News

Version 30.3 by Vincent Massol on 2008/04/28

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

Get Connected