Wiki source code of News

Version 41.1 by Jean-Vincent Drean on 2009/08/07

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

Get Connected