DekiScript - List recent changes

Pagina modificata 14:31, 24 Mar 2009 da wikiadmin | Cronologia

dekiscript_recent_changes.pngMindTouch deki publish recent changes in a feed, but it's complex to display this feed on a wiki page (forum post) if you have the wiki on a secure server (https) with global authentication system.

Solution: create a dekiscript in order to extract last pages edited and display them in a table

Note: this works better with Fiesta Pro skin due to a better table css layout, it is compatible with dekiwiki 8.05 or later because require wiki.getsearch

Instruction: you can modify search results using wiki.getsearch parameters, note that first and last parameters use the power lucene syntax  

http://wiki.developer.mindtouch.com/...s_in_a_page%3f

Solution 1 - Dekiscript

You can use this script in a template and include it anywhere in the wiki with wiki.template()

You can pass a parameter called path in order to restrict the pages listed to a specific section of the wiki

Code

<table block="
var number = (args.number ?? 20);
var msg=(#args.path!=0 ? 'Ultime modifiche nella sezione '..args.path : 'ultime modifiche della wiki');
var path=(#args.path!=0 ? 'path:'..args.path..'/*':'');path;
var result = wiki.getsearch('type:wiki OR type:document OR type:image', number, '-date',path);" width="100%" border="1" cellpadding="4" cellspacing="0" class="feedtable">
<tbody>
<tr>
<td valign="top" colspan="4" bgcolor="#cccccc" style="text-align: center; "><strong>{{msg}}</strong></td>
</tr>
<tr>
<td bgcolor="#cccccc"><strong>Pagina</strong></td>
<td bgcolor="#cccccc"><strong>Data</strong></td>
<td bgcolor="#cccccc"><strong>Autore</strong></td>
<td bgcolor="#cccccc"><strong>Sommario</strong></td>
</tr>
<tr foreach="var pa in result" class="{{__count % 2 == 0 ? 'feedroweven' : 'feedrowodd'}}">
<td if="pa.uri!=nil" style="WORD-BREAK:BREAK-ALL" width="50%">{{pa.id ? web.link(pa.uri, pa.path):web.html("File "..web.link(pa.uri, pa.name).." in "..web.link(pa.page.uri,pa.page.path).."")}}</td>
<td nowrap="" if="pa.uri!=nil"><small>{{date.format(pa.date,"dd/MM/yy - HH:mm")}}</small></td>
<td if="pa.uri!=nil"><small>{{web.link("/Special:Contributions?target="..pa.author.name, pa.author.name)}}</small></td>
<td if="pa.uri!=nil"><small>{{ pa.id? web.link('/index.php?title='..uri.encode(pa.path)..'&amp;action=history',pa.editsummary):''}}</small></td>
</tr>
<tr>
<td valign="top" style="word-break: break-all; text-align: center; " colspan="4"><a title="/Special:Recentchanges" class="internal" href="mks://localhost/Special:Recentchanges">Ultime modifiche di tutta la wiki</a>&nbsp;</td>
</tr>
</tbody>
</table>

                 

Example

ultime modifiche della wiki
Pagina Data Autore Sommario
User:maurizio_brasiello 29/08/10 - 00:57 wikiadmin pagina creata, 16 parole aggiunte
User:Lucky 17/08/10 - 11:46 wikiadmin pagina creata, 16 parole aggiunte
User:nicola 17/08/10 - 09:43 wikiadmin pagina creata, 16 parole aggiunte
User:Claudio 16/08/10 - 22:37 wikiadmin pagina creata, 16 parole aggiunte
Template:XsysMySqlDisplayRecord 24/07/10 - 07:09 wikiadmin 2 parole aggiunte, 2 parole cancellate
Template:XeleMySqlElenco 24/07/10 - 07:08 wikiadmin 2 parole aggiunte, 2 parole cancellate
Applicazioni/Rubrica/Persone/Sabena_-_Gianluca 22/07/10 - 13:41 wikiadmin nessun cambiamento visibile; Nome pagina ripristinato
Template:XsysPrintSection 22/07/10 - 13:39 wikiadmin 4 parole aggiunte, 14 parole cancellate
User:ares 22/07/10 - 12:35 ares nessun cambiamento al testo
http://mindtouch.intertesto.com/@api/deki/files/238/=prova.txt 22/07/10 - 12:33 ares
/content/body/div[1]/div[2]/table/tbody/tr[3]/td[4]/small/span, function 'uri.encode' failed (click for details)
Applicazioni/Rubrica/Stampa_elenco_persone 22/07/10 - 11:23 wikiadmin 1 parole aggiunte, 1 parole cancellate
Web/Xsys/SkinBottom 19/07/10 - 16:22 wikiadmin 1 parole aggiunte, 5 parole cancellate
Applicazioni 19/07/10 - 16:12 wikiadmin 46 parole aggiunte
Web/Xsys/SkinTop 19/07/10 - 16:10 wikiadmin 27 parole aggiunte, 9 parole cancellate
Applicazioni/Statistiche 19/07/10 - 11:21 wikiadmin 11 parole cancellate
Applicazioni/Contwik 19/07/10 - 10:22 wikiadmin 76 parole aggiunte, 104 parole cancellate
http://mindtouch.intertesto.com/@api/deki/files/237/=Picture%2b11.png 19/07/10 - 09:48 wikiadmin
/content/body/div[1]/div[2]/table/tbody/tr[3]/td[4]/small/span, function 'uri.encode' failed (click for details)
User:wikiadmin/Titolo_Pagina 11/07/10 - 14:55 wikiadmin 6 parole aggiunte, 2 parole cancellate
Prova 01/07/10 - 20:23 aleon 211 parole cancellate
User:aleon 01/07/10 - 20:20 wikiadmin pagina creata, 8 parole aggiunte
Ultime modifiche di tutta la wiki 

 

Solution 2 - feed.table or feed.list

It is possible to feed rss url with feed.table or feed.list function 

Code

  feed.list('http://www.intertesto.com/@api/deki/site/feed', 10)

Example

/content/body/div[2]/div[2]/pre, function 'List' failed (click for details)

            

Etichette
Statistiche pagina
448 view(s), 11 edit(s), and 7228 character(s)

Commenti

E' necessario connettersi per inserire un commento.

Aggiungi file

Allegati

Nome FileDimensioneDataAggiunto da 
 dekiscript_recent_changes.png
Nessuna descrizione
16.07 kB14:17, 24 Mar 2009wikiadminAzioni