4 This block prints out a short paragraph of the pages that were
5 linked from the "News" page. This is much like the page_wikinews,
6 but gets the list of to-be-printed pages from another one instead of
7 using the list of newest pages.
9 It respects following $ewiki_config[] entries:
10 ["newsblock_links"] - use which pages` links ("News")
11 ["newsblock_num"] - how many new articles to be shown
12 ["newsblock_len"] - string length of the excerpts
13 (or just customize the defaults below)
17 if (true) #-- this is not a function here
20 global $ewiki_plugins, $ewiki_config;
23 ($n_get = $ewiki_config["newsblock_links"]) || ($n_get = "News");
24 ($n_num = $ewiki_config["newsblock_num"]) || ($n_num = 10);
25 ($n_len = $ewiki_config["newsblock_len"]) || ($n_len = 196);
27 #-- fetch all page entries from DB, for sorting on creation time
28 $links = ewiki_db::GET($n_get);
29 $links = explode("\n", trim($links["refs"]));
32 $links = array_slice($links, 0, $n_num);
36 foreach ($links as $uu=>$id) {
38 if ($row = ewiki_db::GET($id)) {
40 $text = substr($row["content"], 0, $n_len);
41 $text = trim(strip_tags(strtr($text, "\r\n\t", " ")));
42 $text = str_replace("[internal://", "[ internal://", $text);
44 # $text .= " [...[read more | $id]]\n";
52 #-- pass thru renderer
54 $o = ewiki_format($o);
55 echo('<div class="block-news">' . $o . '</div>');