First you will need to make sure you have a Mediawiki package at version 1.7.0 or higher and PHP version 5. To check the version of your wiki go its Special:Version page. Detailed installation instructions for Mediawiki can be found here.
Basic Installation
Step 1. Getting the Code
First checkout the code from the exhibit-mediawiki-extension project in the Simile subversion repository.
svn checkout http://simile.mit.edu/repository/exhibit-mediawiki-extension/trunk wibbit
(You can also download the code file by file from that URL.)
The two important files are includes/Exhibit_Main.php and scripts/Exhibit_Create.js.
Step 2. Putting the Code into MediaWiki
Place the files in your wiki's extensions folder. To keep it organized it is best to create an ExhibitExtension (or similar) folder within the extensions and put it there. You may also maintain the directory structure that you checked out from svn. For example, the two files above could be found at [mediawikiname]/extensions/ExhibitExtension/includes/Exhibit_Main.php and [mediawikiname]/extensions/ExhibitExtension/scripts/Exhibit_Create.js.
Step 3. Hooking Things Up
Change the LocalSettings.php file in your wiki's root directory (that would be the [mediawikiname] one above), so that it knows to load the Exhibit extension. Do this by adding the following at the bottom of the file (above the closing ?>, though.):
include_once 'extensions/ExhibitExtension/includes/Exhibit_Main.php';
Be sure to adjust the path to reflect where you've put that file.
Depending where you put Exhibit_Create.js you may have to change Exhibit_Main.php so it can properly load it. By default, Exhibit_Main.php looks for the other file in extensions/ExhibitExtension/scripts/Exhibit_Create.js.
If this is not where yours is, you'll have to change the wfExhibitAddHTMLHeader() function. Specifically, look for the line
$WExhibitScript = '<script type="text/javascript" src="'. $wgScriptPath . '/extensions/Exhibit/scripts/Exhibit_Create.js"></script>';
There is one final change to be made. In [mediawikiname]/includes/OutputPage.php at the bottom of the output() function (located around line 590), make it like this:
if ($this->mArticleBodyOnly) {
$this->out($this->mBodytext);
} else {
wfProfileIn( 'Output-skin' );
smwfAddHTMLHeader( $this );
wfExhibitAddHTMLHeader( $this );
$sk->outputPage( $this );
wfProfileOut( 'Output-skin' );
}
The surrounding lines are given for context. Only add the bold line. Yours may not be exactly like mine.
And that's it! Your extension should now be installed and working! See the Wibbit Use Page for details on how to use it.
Adding more Features
Map View
If you would like to display maps in your Wibbit, you only need to do two more installation steps.
First, you need to register for a key from Google Maps. Google Maps requires that you register for a key in order to embed Google Maps on your web site. Go to Google Maps API - Sign Up and enter the URL of your site (for this site, it would be http://simile.mit.edu/). What you'll get is a long cryptic looking nonsense string which is your Google Maps key, e.g.,
ABQIAAAA5JLLfCE9c7HAtg25QM2KCRSInwI2_sNfg0jsO21_IrKvxRltZxRh2I8AzcAlossU2kGrVtsZsdfDDA
Now just search for the string #CHANGETHIS: in Exhibit_Main.php. You should be able to find a line of code that looks like this:
$gmapkey = 'ABQIAAAANowuNonWJ4d9uRGbydnrrhQtmVvwtG6TMOLiwecD59_rvdOkHxSVnf2RHe6KLnOHOyWLgmqJEUyQQg';
Change the long string here to the string that Google Maps just gave you, and that's all you have to do! Go enjoy your maps!
Table Editor Geocoding
If you haven't noticed, this extension adds a new button to the edit page toolbar that allows you to edit tables. There's a "Get Lat/Lng" button in this table to help you convert human-friendly addresses into Exhibit-friendly latitude/longitude pairs.
In order to access the Google Maps scripts, our code needs to be able to access a Special page on your wiki (this page is included in this extension). To do this, we just need you to change a URL in Exhibit_Main.php. Search for #CHANGETHIS: again, and inside the $toolbar variable, change wikiURL to match the URL to the root directory of your wiki.
For details on how to use the table editor, go here.
Troubleshooting
<exhibit> tags show up in the article
This means that LocalSettings.php isn't properly loading the Exhibit_Main.php file. Make sure that at the bottom of LocalSettings.php the path of your include correctly points to Exhibit_Main.php. For example, my Exhibit_Main.php is here:
exhibited/extensions/ExhibitExtension/includes/Exhibit_Main.php
Therefore, the bottom of my LocalSettings.php file should look like this:
require_once("extensions/ExhibitExtension/includes/Exhibit_Main.php");
?>
Notice how the paths agree.
My Exhibit isn't loading
If the <exhibit> tags are properly removed but not replaced by the exhibit, then this could be one of three problems.
First, check to make sure your wiki is up to at least version 1.7.0. You can do this by going to your wiki's main page, and then replacing Main_Page with Special:Version. If your wiki package is too old, consider upgrading.
If that's not it, view the source of the problematic page. Search to see if the exhibit script was added to the head like it was supposed to be. There should be the following script tags somewhere:
<script type="text/javascript" src="http://simile.mit.edu/repository/exhibit/branches/2.0/src/webapp/api/exhibit-api.js?autoCreate=false"> </script>
<script>SimileAjax.History.enabled = false;</script>
<script type="text/javascript" src="/[mediawikiname]/extensions/ ExhibitExtension/scripts/Exhibit_Create.js"> </script>
If none of them are there, then it probably means there's a problem with your OutputPage.php file. Look above and make sure you added wfExhibitAddHTMLHeader( $this ); to the right place.
If, on the other hand, the scripts are there, check to make sure they're correct. Most likely, the third one isn't correctly loading the Exhibit_Create.js file. Make sure the path corresponds with where you installed Exhibit_Create.js. If there's a discrepancy, you can change this in Exhibit_Main.php. See above for where exactly to make the change.
Go back to Main Wibbit Page.

