Extension:BibliaVulgata

The BibliaVulgata extension is designed to easily insert links to the latin text of the Bible available at Vulsearch (Biblia Vulgata Clementina).

Installation
Add this line at the end of your LocalSettings.php file: include('extensions/BibliaVulgata.php');

Create a file extensions/BibliaVulgata.php containing the following code:

<?php
 * 1) Biblia Latina Vulgata
 * 2) Version: 1.0
 * 3) Links a Bible reference to the text of the Vulgata Clementina at Vulsearch
 * 4) Tag :
 * 5)   ref
 * 6) Example :
 * 7)   Job 7:1
 * 8)   Job 7:1
 * 9) The use of the standard Vulsearch abreviations for book names is mandatory in the tage;
 * 10) a list is available here :
 * 11) http://vulsearch.sourceforge.net/abbrev-o.html
 * 1) The use of the standard Vulsearch abreviations for book names is mandatory in the tage;
 * 2) a list is available here :
 * 3) http://vulsearch.sourceforge.net/abbrev-o.html

$wgExtensionFunctions[] = 'wfBibliaVulgata'; $wgExtensionCredits['parserhook'][] = array(       'name' => 'Biblia Latina Vulgata',        'description' => 'Links Bible References to Vulsearch (Vulgata Clementina)',        'author' => 'Marjorie Burghart',        'url' => 'http://meta.wikimedia.org/wiki/BibliaVulgata' );

// Matches an abreviation with the full name of a book ; // We do not make use of this name in this extension, but it might be of interest // in a future version $bookTitle['Gn'] = 'Genesis'; $bookTitle['Ex'] = 'Exodus'; $bookTitle['Lv'] = 'Leviticus'; $bookTitle['Nm'] = 'Numeri'; $bookTitle['Dt'] = 'Deuteronomium'; $bookTitle['Jos'] = 'Josue'; $bookTitle['Jdc'] = 'Judicum'; $bookTitle['Rt'] = 'Ruth'; $bookTitle['1Rg'] = 'Regum I'; $bookTitle['2Rg'] = 'Regum II'; $bookTitle['3Rg'] = 'Regum III'; $bookTitle['4Rg'] = 'Regum IV'; $bookTitle['1Par'] = 'Paralipomenon I'; $bookTitle['2Par'] = 'Paralipomenon II'; $bookTitle['Esr'] = 'Esdræ'; $bookTitle['Neh'] = 'Nehemiæ'; $bookTitle['Tob'] = 'Tobiæ'; $bookTitle['Jdt'] = 'Judith'; $bookTitle['Est'] = 'Esther'; $bookTitle['Job'] = 'Job'; $bookTitle['Ps'] = 'Psalmi'; $bookTitle['Pr'] = 'Proverbia'; $bookTitle['Ecl'] = 'Ecclesiastes'; $bookTitle['Ct'] = 'Canticum Canticorum'; $bookTitle['Sap'] = 'Sapientia'; $bookTitle['Sir'] = 'Ecclesiasticus'; $bookTitle['Is'] = 'Isaias'; $bookTitle['Jr'] = 'Jeremias'; $bookTitle['Lam'] = 'Lamentationes'; $bookTitle['Bar'] = 'Baruch'; $bookTitle['Ez'] = 'Ezechiel'; $bookTitle['Dn'] = 'Daniel'; $bookTitle['Os'] = 'Osee'; $bookTitle['Joel'] = 'Joel'; $bookTitle['Am'] = 'Amos'; $bookTitle['Abd'] = 'Abdias'; $bookTitle['Jon'] = 'Jonas'; $bookTitle['Mch'] = 'Michæa'; $bookTitle['Nah'] = 'Nahum'; $bookTitle['Hab'] = 'Habacuc'; $bookTitle['Soph'] = 'Sophonias'; $bookTitle['Agg'] = 'Aggæus'; $bookTitle['Zach'] = 'Zacharias'; $bookTitle['Mal'] = 'Malachias'; $bookTitle['1Mcc'] = 'Machabæorum I'; $bookTitle['2Mcc'] = 'Machabæorum II'; $bookTitle['Mt'] = 'Matthæus'; $bookTitle['Mc'] = 'Marcus'; $bookTitle['Lc'] = 'Lucas'; $bookTitle['Jo'] = 'Joannes'; $bookTitle['Act'] = 'Actus Apostolorum'; $bookTitle['Rom'] = 'ad Romanos'; $bookTitle['1Cor'] = 'ad Corinthios I'; $bookTitle['2Cor'] = 'ad Corinthios II'; $bookTitle['Gal'] = 'ad Galatas'; $bookTitle['Eph'] = 'ad Ephesios'; $bookTitle['Phlp'] = 'ad Philippenses'; $bookTitle['Col'] = 'ad Colossenses'; $bookTitle['1Thes'] = 'ad Thessalonicenses I'; $bookTitle['2Thes'] = 'ad Thessalonicenses II'; $bookTitle['1Tim'] = 'ad Timotheum I'; $bookTitle['2Tim'] = 'ad Timotheum II'; $bookTitle['Tit'] = 'ad Titum'; $bookTitle['Phlm'] = 'ad Philemonem'; $bookTitle['Hbr'] = 'ad Hebræos'; $bookTitle['Jac'] = 'Jacobi'; $bookTitle['1Ptr'] = 'Petri I'; $bookTitle['2Ptr'] = 'Petri II'; $bookTitle['1Jo'] = 'Joannis I'; $bookTitle['2Jo'] = 'Joannis II'; $bookTitle['3Jo'] = 'Joannis III'; $bookTitle['Jud'] = 'Judæ'; $bookTitle['Apc'] = 'Apocalypsis';

function wfBibliaVulgata { global $wgParser; $wgParser->setHook('bible', 'linkVulsearch'); }

function linkVulsearch($input, $args) { global $bookTitle; // explode the input to isolate the distinct parts of the reference $refa = explode(' ', $input); $book = $refa[0]; // check if the book is a regular Vulsearch abreviation if (!array_key_exists($book,$bookTitle)) { $abbr = 0; } else { $abbr = 1; }	       $refb = explode(':', $refa[1]); if (sizeof($refb) > 0) $chapter = $refb[0]; else $chapter = 1; // Vulsearch doesn't support the reference to a span of text, you have to link to the first verse $refc = explode('-', $refb[1]); $verse = $refc[0]; // if the first word of in the  element is not a regular Vulsearch abreviation for book names, // inserts a link to Vulsearch first page if ($abbr != 0) { $output = " ".$input." "; } 				else { $output = " $input"; }       return $output; } ?>
 * 1) The callback function for converting the input text to HTML output

Usage
Example :  Militia est vita hominis super terram Job 7:1 

Vulsearch will open in a new window by default, but if you would rather it opened in the same window add the flag 'thiswindow'.

Example :  Militia est vita hominis super terram Job 7:1 

Please note that BibliaVulgata uses the same syntax as Extension:BibleRef

Credits
Created by Marjorie Burghart (marjorie dot burghart at ehess dot fr)