1ba78005ecdccf82ac7a80c6c38114c7f7369daf
[atutor.git] / mods / wiki / plugins / aview / blog.php
1 <?php
2
3 /*
4    prints out a wiki-news style summary of the calendar entries for the current
5    page as an aview plugin.  The most reccent 10 entries are shown by default.
6    
7    The Calendar plugin should be included for page creation and archival browsing.
8    
9    Adapted from:  Wikinews
10    Developed by AndyFundinger 
11    
12 */
13  
14  
15 $ewiki_plugins["view_append"][] = "ewiki_view_append_blog";
16
17 include_once("plugins/page/wikinews.php");
18
19 function ewiki_view_append_blog($id, $data, $action) {
20   global $ewiki_config;
21
22   if(!calendar_exists(false)){
23     return;
24   }
25
26    #-- conf
27    ($n_num = $ewiki_config["wikinews_num"]) || ($n_num = 10);
28    ($n_len = $ewiki_config["wikinews_len"]) || ($n_len = 512);
29    
30    $o='<div class="text-blog">'
31       .ewiki_wikinews_summary($n_num,$n_len,'/^'.$id.EWIKI_NAME_SEP.'\d{8}$/')
32       . '</div>';
33    $o.='<a href="'.ewiki_script("calendarlist", $id).'">View all log entries.</a>';
34
35   return($o);
36 }
37
38
39
40 ?>