3 A plugin call like <?plugin FarInclude http://example.org/doc.htm ?>
4 rapes the text/html body from the given URL and inserts this into
5 the current page. You could also specify (Perl-) regular expressions
6 to break the wanted content out with (case-insensitive):
7 <?plugin FarInclude url=... start="<b><i>" end="<\/b>" ?>
8 Where quotation marks must be escaped with backslashes, if you need
9 them, and the borders won't be included of course.
11 This can be used in conjuction with WikiFeatures:SnippetPublishing
12 and ewikis htm/ action -> "http://erfurtwiki.sf.net/htm/SandBox".
16 $ewiki_plugins["mpi"]["farinclude"] = "ewiki_mpi_farinclude";
17 function ewiki_mpi_farinclude($action, &$args, &$iii, &$s) {
23 or ($url = $args["href"])
24 or ($url = $args["src"])
26 if (!$url || (strpos($url, "http") !== 0)) {
31 ini_set("user_agent", "mpi_FarInclude/1.2 $ewiki_config[ua]");
32 if (function_exists("ewiki_http")) {
33 $html = ewiki_http("GET", $url);
36 $html = @implode("", @file($url));
43 if ($l = strpos(strtolower($html), "<body")) {
44 $html = substr($html, strpos($html, ">", $l) + 1);
46 if ($l = strpos(strtolower($html), "</body")) {
47 $html = substr($html, 0, $l);
51 if (($a = $args["start"]) and ($z = $args["end"])) {
52 if (preg_match("\007$a(.+?)$z\007ims", $html, $uu)) {
58 $html = "\n<!-- the following was raped from \"$url\" -->\n$html\n<!-- end of FarInclude'd stuff -->\n";