Wiki source code of News

Version 33.3 by Sergiu Dumitriu on 2009/01/05

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 #set($nbstart = $request.nbstart)
13 #set($category = "")
14 #set($nbitems = "4")
15 #includeTopic("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' and doc.name not like 'WatchListJob%' 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' and doc.name not like 'WatchListJob%' 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
87
88 #end
89 <h2 class="heading-1-1-1">Recent Users Added</h2>
90 #set ($sql = "where 1=1 and doc.comment = 'Created user' order by doc.date desc")
91 #set($showdata = 1)
92 #set($nb = 10)
93 #set($formatDate = "yyyy MMMM dd, HH:mm")
94 #getDocumentsModifs($list $sql $wikinames $nb)
95 <ul>
96 #foreach ($bentrydoc in $list)
97 #set($troubi ="non")
98 #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName))
99 #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
100 #set($comment = $cclass.newObject())
101 #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0)
102 #set($comments = $bentrydoc.getComments())
103 #else
104 #set($comments = $bentrydoc.getComments(false))
105 #end
106 #set($createur = $xwiki.getUserName($bentrydoc.author))
107 <li>
108 #if($comments.size()>0)
109 #set($i = 0)
110 #set($cobj = $comments.get($i))
111 #set($comment = $bentrydoc.display("comment", "view", $cobj))
112 #set($date = $cobj.getXWikiObject().get("date").value)
113 #if($date)
114 #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss"))
115 #end
116 #if($bentrydoc)
117 #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") )
118 #end
119 #if($date1.equals($date2) )
120 [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em>
121 #set($troubi ="oui")
122 #set($desc = $cobj.getXWikiObject().get("comment").value)
123 #else
124 [$bentrydoc.name in $bentrydoc.web>$bentrydoc.prefixedFullName]
125 #end
126 #else
127 #set($comment = "")
128 [$bentrydoc.name in $bentrydoc.web>$bentrydoc.prefixedFullName.replaceAll("@","%40")]
129 #end
130 $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")
131 #if($troubi =="oui")
132 #set($createur = $xwiki.getUserName($cobj.author))
133 #end
134 #if ($createur == "XWikiGuest")
135 Guest
136 #else
137 $createur
138 #end
139 </li>
140 #end
141 #end
142 </ul>
143 </div>
144 </div>
145 <div style="clear:both; margin-bottom: 40px;"><!-- --></div>
146 </div>

Get Connected