User:Mlong212

All extensions have been installed on:
 * Product ||  Version
 * MediaWiki  ||   1.12.0
 * PHP  ||   5.2.5 (cgi-fcgi)
 * MySQL  ||   5.0.24-community-nt
 * OS  ||   Windoes Server 2003

Graphviz
Main page: Extension:GraphViz

Required: Graphviz webpage or direct file link
 * version 2.18

Some Windows operating systems may require run-time components of Visual C++ libraries to properly run Graphviz executables. click this link and install Microsoft Visual C++ 2005 Redistributable Package (x86).

Install directions
1.) install graphviz software I installed it to w:\graphviz2.18
 * this path is referenced in the graphviz.php and needs to be changed to your install path

2.) add user rights
 * use file browser and find cmd.exe and give internet users read/execute access
 * give internet users read/execute access to the directory graphviz was installed to

3.) create Graphviz.php
 * save into your mediawiki/extensions folder
 * edit about line 12 ( $wgGraphVizSettings->dotCommand = "w:\\graphviz2.18\\bin\\dot.exe"; ) to reflect your graphviz software installation
 * note the two "\\" between directories

dotCommand = "w:\\graphviz2.18\\bin\\dot.exe";

$wgExtensionFunctions[] = "wfGraphVizExtension";

function wfGraphVizExtension { global $wgParser; $wgParser->setHook( "graphviz", "renderGraphviz" ); #renderGraphviz (5); }

function renderGraphviz( $timelinesrc ) {	global $wgUploadDirectory, $wgUploadPath, $IP, $wgGraphVizSettings, $wgArticlePath, $wgTmpDirectory; $hash = md5( $timelinesrc ); $dest = $wgUploadDirectory."\\graphviz\\"; if ( ! is_dir( $dest ) ) { mkdir( $dest, 0777 ); } if ( ! is_dir( $wgTmpDirectory ) ) { mkdir( $wgTmpDirectory, 0777 ); }

$fname = $dest. $hash; //	echo $fname; if ( ! ( file_exists( $fname.".png" ) || file_exists( $fname.".err" ) ) ) {		$handle = fopen($fname, "w"); fwrite($handle, $timelinesrc); fclose($handle);

$cmdline = wfEscapeShellArg( $wgGraphVizSettings->dotCommand). " -Tpng -o ". wfEscapeShellArg( $fname. ".png"). " " .		 wfEscapeShellArg( $fname ) ;

$cmdlinemap = wfEscapeShellArg( $wgGraphVizSettings->dotCommand). " -Tcmapx -o ". wfEscapeShellArg( $fname. ".map"). " " .		 wfEscapeShellArg( $fname ) ; //		echo $cmdline; //		exit; //		break; //		echo "ADIOS"; $ret = `"{$cmdline}"`; $ret = `"{$cmdlinemap}"`;

unlink($fname);

/* if ( $ret == "" ) { // Message not localized, only relevant during install return "Timeline error: Executable not found. Command line was: {$cmdline} "; }	}

@$err=file_get_contents( $fname.".err" );

if ( $err != "" ) { $txt = "$err "; } else { //echo $fname.".map"; @$map = file_get_contents( $fname.".map" ); //echo "mapa-antes:".$map; $map=preg_replace("##"," ",$map); $map=str_replace(" ","",$map);

//echo "mapa:".$map; if (substr(php_uname, 0, 7) == "Fucker") { $ext = "gif"; } else { $ext = "png"; }

$txt = "{$map} ". ""; }	return $txt; }

?>

4.) edit mediawiki localsettings.php
 * add the following 2 lines:
 * include("extensions/Graphviz.php");
 * $wgGraphVizSettings->dotCommand = "W:\\Graphviz2.18\\bin\\DOT.exe";


 * change the dotcommand path to reflect your graphviz software installation
 * note the two "\\" between directory names

Inkscape
Main page:

Required: [ webpage] or [ direct file link]
 * version