Page MenuHomePhabricator

bibleExt.php

Authored By
bzimport
Nov 21 2014, 8:06 PM
Size
743 B
Referenced Files
None
Subscribers
None

bibleExt.php

<?php
# To activate the extension, include it from your LocalSettings.php
# with: include("extensions/bibleExt.php");
$wgExtensionFunctions[] = "wfBibleExtension";
function wfBibleExtension() {
global $wgParser;
# register the extension with the WikiText parser
$wgParser->setHook( "bible", "renderBible" );
}
# The callback function for converting the input text to HTML output
function renderBible( $input ) {
sscanf($input, "%s %d:%d", $book, $chapter,$verse);
$book=trim($book);
$book=strtr($book," ","_")
$output="<a href='http://wikisource.org/wiki/Bible%2C_English%2C_King_James%2C_$book#Chapter_$chapter' title='$input'>$input</a>";
return $output;
}
?>

File Metadata

Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1323
Default Alt Text
bibleExt.php (743 B)

Event Timeline