2009/7/25 Kathleen Borja <jane88borj(a)yahoo.com>om>:
I'm making my mediawiki-driven senior project for
this semester. It is about
creating a thesaurus for bikol languages. I started editing pages and also
importing pages manually. So far, all the changes work. Now, I'm making the core
function of my project-thesaurus. I implemented a string search algorithm in a
php file(but not yet on the special file), which I will be using in the search
function on the SpecailThesaurus.php file. I'm making a special page on the
/includes directory and also on the /extensions directory named
"SpecialThesaurus.php".
Problems:
-How can I set the action attribute in "form" so that it displays all the
output
on the page $SERVER['PHP_SELF'];
-How can I enable this script "SpecialThesaurus.php" so that it shows after a
user adds/edit a page?
Thanks. (^_^)
On the /extensions directory, the "SpecialThesaurus.php" includes this code:
The code you're quoting uses pretty old conventions, and I'm not sure
it'll still work correctly. What you wanna do is the following:
In extensions/Thesaurus/SpecialThesaurus.php:
class SpecialThesaurus extends SpecialPage
{
function __construct() {
parent::__construct( 'Thesaurus' );
}
function execute( $par ) {
global $wgOut;
$this->setHeaders();
$this->setTitle( 'Some title' );
$wgOut->addHTML( "Example HTML" );
// $par is the subpage parameter, i.e. for
Special:Thesaurus/Foo $par == 'Foo'
// To get the URL to this special page, use
$this->getTitle()->getFullURL()
}
}
In extensions/Thesaurus/Thesaurus.php:
$wgSpecialPages['Thesaurus'] = 'SpecialThesaurus';
$wgAutoloadClasses['SpecialThesaurus'] = dirname(__FILE__) .
'/SpecialThesaurus.php';
Note that the special page itself should also be in
extensions/Thesaurus/ , not in includes/ .
Roan Kattouw (Catrope)