×
Create a new article
Write your page title here:
We currently have 3184 articles on s23. Type your article name above or click on one of the titles below and start writing!



s23
3184Articles

MediawikiExtensions/MoonEdit

Situation[edit]

You are using the MoonEdit program (Tom Dobrowolski's multi-platform collaborative text editor) to colloboartively 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> Tag[edit]

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) Extension[edit]

<?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;

}

?>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.