Revision [18785]
This is an old revision of SpectreMoo made by SpectreMoo on 2008-01-28 00:12:36.
SpectreMoo
Other Interests:
I've installed Wikka to augment our company intranet, and in the process I've made a number of both superficial and functional changes to the code. Many of the changes I've made work only within my company intranet environment (auto-linking of java class names to our javadocs, for instance), but I've tried to post general changes here -- for instance, the SpellcheckHack.- Biologically inspired computing (Genetic Programming, Neural Nets, etc.)
- Astronomy; mostly reading, I'm no amateur astronomer
- Physics
The biggest request I have from my users these days is better table markup to display structured information; right now we're using double-quote escaped HTML. There's been some work done on better tables here, but I'm also investigating migrating another wiki engine's (maybe media wiki's) table markup to Wikka. I'll post here it if I can make it happen.
I anticipate that in the next year or two we'll see functional, robust WYSIWYG editors for wikis which will make them even more accessible to common folk, and that will be a good day -- especially for users supporting wiki use in a corporate environment such as myself.
Thank you for a great wiki engine!
Fortune Action
First off: the latest iteration of my {{fortune}} action:
<?php
$location = "SOME DEFAULT"; // for example: http://www.textfiles.com/humor/TAGLINES/random.txt
if (!$vars["location"])
{
$lines = file ($location);
}
else
{
$location = $vars["location"];
if ("http" == substr ($location, 0, 4))
{
$lines = file ($location);
}
else if ($this->IsWikiName ($location))
{
if (!$this->ExistsPage ($location))
{
echo "<em>The specified page does not exist.</em>";
return;
}
$page = $this->LoadPage ($location);
if ($page)
{
$line = 0;
$pagelines = explode ("\n", $page["body"]);
for ($i = 0; $i < count ($pagelines); $i++)
{
if (preg_match ("/[ ~]*-(.*)/",$pagelines[$i],$matches))
{
$lines[$line++] = $matches[1];
}
}
}
}
}
echo $lines[array_rand ($lines)];
?>
$location = "SOME DEFAULT"; // for example: http://www.textfiles.com/humor/TAGLINES/random.txt
if (!$vars["location"])
{
$lines = file ($location);
}
else
{
$location = $vars["location"];
if ("http" == substr ($location, 0, 4))
{
$lines = file ($location);
}
else if ($this->IsWikiName ($location))
{
if (!$this->ExistsPage ($location))
{
echo "<em>The specified page does not exist.</em>";
return;
}
$page = $this->LoadPage ($location);
if ($page)
{
$line = 0;
$pagelines = explode ("\n", $page["body"]);
for ($i = 0; $i < count ($pagelines); $i++)
{
if (preg_match ("/[ ~]*-(.*)/",$pagelines[$i],$matches))
{
$lines[$line++] = $matches[1];
}
}
}
}
}
echo $lines[array_rand ($lines)];
?>
To use, save as fortune.php in the actions directory.
Usage: {{fortune location="URL|WikiPage"}}
- URLs need to point to one line quotes which end in newlines, as in the example URL included in the source.
- Wiki pages are parsed for lines starting with a bullet point (~- and its variants), which I've used as a source of random wiki tips.
Moved spellchecking to SpellcheckHack.
CategoryUsers