Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1738
bibleExt.php
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 8:06 PM
2014-11-21 20:06:17 (UTC+0)
Size
743 B
Referenced Files
None
Subscribers
None
bibleExt.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1323
Default Alt Text
bibleExt.php (743 B)
Attached To
Mode
T3104: Linking to the Bible and other texts with chapter:verse cross referencing.
Attached
Detach File
Event Timeline
Log In to Comment