Plus one one-line patch by Dori.
# with the correct image locations.
$wgUseWikiHiero = false;
+# Support for inline timelines, see http://members.chello.nl/epzachte/Wikipedia/EasyTimeline/Introduction.htm
+# The Timeline php files must be present in the extension directory and you must have the
+# ploticus tool available, see http://ploticus.sourceforge.net/
+$wgUseTimeline = false;
+
# Profiling / debugging
$wgProfiling = false; # Enable for more detailed by-function times in debug log
$wgProfileLimit = 0.0; # Only record profiling info for pages that took longer than this
if( $GLOBALS['wgUseWikiHiero'] ){
include_once('wikihiero.php');
}
+if( $GLOBALS['wgUseTimeline'] ){
+ include_once('extensions/timeline/Timeline.php');
+}
# PHP Parser
#
/* private */ function doTokenizedParser( $str )
{
global $wgLang; # for language specific parser hook
+ global $wgUploadDirectory, $wgUseTimeline;
$tokenizer=Tokenizer::newFromString( $str );
$tokenStack = array();
$txt = $this->doMagicISBN( $tokenizer );
}
break;
+ case "<timeline>":
+ if ( $wgUseTimeline &&
+ "" != ( $timelinesrc = $tokenizer->readAllUntil("</timeline>") ) )
+ {
+ $txt = renderTimeline( $timelinesrc );
+ } else {
+ $txt=$token["text"];
+ }
+ break;
default:
# Call language specific Hook.
$txt = $wgLang->processToken( $token, $tokenStack );
case MAG_PAGENAME:
return $this->mTitle->getText();
case MAG_NAMESPACE:
- return Namespace::getCanonicalName($this->mTitle->getNamespace());
+ # return Namespace::getCanonicalName($this->mTitle->getNamespace());
+ return $wgLang->getNsText($this->mTitle->getNamespace()); // Patch by Dori
case MAG_CURRENTDAYNAME:
return $wgLang->getWeekdayName( date("w")+1 );
case MAG_CURRENTYEAR:
break 2; // switch + while
}
break;
+ case "&": //extensions like <timeline>, since HTML stripping has already been done,
+ //those look like <timeline>
+ if ( $this->continues( "lt;timeline>" ) )
+ {
+ $queueToken["type"] = "<timeline>";
+ $queueToken["text"] = "<timeline>";
+ $this->mQueuedToken[] = $queueToken;
+ $this->mPos += 16;
+ break 2; // switch + while
+ }
+ break;
} /* switch */
$token["text"].=$ch;
return false;
return ( 0 == strcmp( $prec, substr($this->mText, $this->mPos-$len, $len) ) );
}
+
+ function readAllUntil( $border )
+ {
+ $n = strpos( $this->mText, $border, $this->mPos );
+ if ( $n === false )
+ return "";
+ $ret = substr( $this->mText, $this->mPos, $n - $this->mPos );
+ $this->mPos = $n + strlen( $border ) + 1;
+ return $ret;
+ }
+
}