Wiki source code of News

Version 39.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 #includeMacros("Blog.BlogCode")
13 #printBlog($xwiki.getDocument("Blog.WebHome"))
14 </div>
15 </div>
16 <div id="webhomeNewsdisplay" style="float:left; width: 50%;">
17 <div style="padding-left: 20px;">
18 <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>
19 #if(!$xwiki.hasMinorEdit() || $request.getParameter("showminor"))
20 #set ($sql = "where 1=1 and doc.comment <> 'Created user' and doc.name not like 'WatchListJob%' order by doc.date desc")
21 #else
22 #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")
23 #end
24 #set($showdata = 1)
25 #if(!$nb)
26 #set($nb = 30)
27 #end
28 #set($formatDate = "yyyy MMMM dd, HH:mm")
29 #getDocumentsModifs($list $sql $wikinames $nb)
30 <ul>
31 #foreach ($bentrydoc in $list)
32 #set($troubi ="non")
33 #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName))
34 #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
35 #set($comment = $cclass.newObject())
36 #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0)
37 #set($comments = $bentrydoc.getComments())
38 #else
39 #set($comments = $bentrydoc.getComments(false))
40 #end
41 #set($createur = $xwiki.getUserName($bentrydoc.author))
42 <li>
43 #if($comments.size()>0)
44 #set($i = 0)
45 #set($cobj = $comments.get($i))
46 #set($comment = $bentrydoc.display("comment", "view", $cobj))
47 #set($date = $cobj.getXWikiObject().get("date").value)
48 #if($date)
49 #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss"))
50 #end
51 #if($bentrydoc)
52 #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") )
53 #end
54 #if($date1.equals($date2) )
55 [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em>
56 #set($troubi ="oui")
57 #set($desc = $cobj.getXWikiObject().get("comment").value)
58 #else
59 [$bentrydoc.name in $bentrydoc.web>$bentrydoc.prefixedFullName]
60 #end
61 #else
62 #set($comment = "")
63 [$bentrydoc.name in $bentrydoc.web>$bentrydoc.prefixedFullName.replaceAll("@","%40")]
64 #end
65 $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")
66 #if($troubi =="oui")
67 #set($createur = $xwiki.getUserName($cobj.author))
68 #end
69 #if ($createur == "XWikiGuest")
70 Guest
71 #else
72 $createur
73 #end
74 </li>
75 #end
76 #end
77 </ul>
78 #if($xwiki.hasMinorEdit())
79 #if($request.getParameter("showminor"))
80 <a href="$xwiki.getURL($tdoc.getFullName(), "view", "")">Hide minor edits</a>
81 #else
82 <a href="$xwiki.getURL($tdoc.getFullName(), "view", "showminor")">Show minor edits</a>
83 #end
84
85
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