Open main menu
Blue Glass Arrow.svg MediaWiki logo.png
This page should be moved to MediaWiki.org.
Please do not move the page by hand. It will be imported by a MediaWiki.org administrator with the full edit history. In the meantime, you may continue to edit the page as normal.

SituationEdit

You are using the MoonEdit program (Tom Dobrowolski's multi-platform collaborative text editor) to colloboratively edit texts with other users and would like to save them into the Wiki for future reference. You used the 'svsavetxt command in your MoonEdit client to make the server save the session as plain text in the current working directory.

<ting></ting> TagEdit

In the Wiki you can now use <ting>filename</ting> inside a wiki page, and the content of the file will be included into the wiki page. Note that often the MoonEdit files dont have a file extension.They should be plain text and not in the .me format.

Its called 'Ting' because that term is being used on the TingWiki, more on [1]. TingWiki lives inside S23-Wiki where i installed this extension.

Tings have been the councils of the old vikings.

Ting (MoonEdit) ExtensionEdit

<?php
# "Ting" (MoonEdit) Mediawiki extension v0.1
# includes plain text files saved by a [[MoonEdit]] server
# by mutante 12.03.2005

$wgExtensionFunctions[] = "wfTingExtension";

function wfTingExtension() {
global $wgParser;
$wgParser->setHook( "ting", "renderTing" );
}

function renderTing( $input ) {

$input = mysql_escape_string($input);


$file = "/var/www/moonedit/$input";
if (file_exists($file)) { $content = file($file); }

foreach($content as $key => $value) {
   $output.="$value<br>";
  }

return $output;

}

?>