I tested applying: http://drupal.org/node/274953#comment-5538322

Then added an entry to hopefully pick up the abbreviation for Matthew as follows:

   if ($verse) {
       $verse = strtok($verse,',& ');
   }

   // Some descriptors for Bible books may be unknown to the websites providing the text.
   // Replace these if necessary. To add such replacements, add new entries to this array
   $book_replace = array('Phi' => 'Phil');
   $book_replace = array('Matt' => 'Matthew');
   if (isset($book_replace[$book])) $book=$book_replace[$book];

   switch ($translation) {
        case 'ESV':

It did not pick up the (Matt. 12:33) reference on a development version of this production page, which I have altered the production version spelling out Matthew completely so that the mod will pick it up.

http://christians-in-recovery.org/BibleStudies_Hope_NatureAndBasisOfAssu...

Since the Matt. abbreviation did not work, I did not try putting in an entry for the abbreviation for Song of Solomon which was "(Song of Sol. 6:13)". I fully spelled out that one as well on the production site.

Comments

muriqui’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
StatusFileSize
new818 bytes

Hmm... Two problems with that approach:

  1. Your second $book_replace assignment clobbers the first.
  2. $book_replace seems like the wrong place to be adding a new abbreviation.

The $book_replace array introduced in #274953: Philippians abbreviation on Bible Gateway handles an abbreviation that is already in the regex, but not recognized by the online Bible (i.e. Bible Gateway doesn't recognize Phi as an abbreviation for Philippians, so $book_replace changes any matches on Phi to Phil before the link is generated). That's not necessary for this issue because all of the supported Bible sites recognize both Matt and Mat as Matthew. So, I think all that's needed is to add Matt to the regex.

The attached patch should fix it for D7... I did D7 first because 274953 has already been applied to the 7.x-1.x branch, and this patch should come after that one. Once that patch is applied to 6.x-1.x, it would be a simple matter to backport this one for D6 as well.

muriqui’s picture

Status: Active » Needs review
jamesoakley’s picture

Status: Needs review » Fixed

That does work. But I've changed it slightly. "|Mat?t|..." is tidier than "|Mat|Matt|...", and is the way the other variable abbreviations are done.

Committed. Thank you.

mdlueck’s picture

On the topic of abbreviations, from my OP, may (Song of Sol. 6:13) format be supported as well? Nothing jumped out at me in the $abbrev_regex code as the correct way to handle a book name consisting of several space deliminated words. I have seen that apprev for the book other places than just our website.

jamesoakley’s picture

Title: Abbreviation for Matthew not picked up » Abbreviations for Song of Solomon not picked up
Status: Fixed » Active
jamesoakley’s picture

Status: Active » Needs review
StatusFileSize
new1.41 KB
new1.42 KB

These patches won't apply unless you download a -dev release that includes the Commit labelled "Strip trailing dots from book names".

First one for Drupal 7, then a back-port to D6.

mdlueck’s picture

Tested on D6 applying the patch to the -dev version. Perfect success. (Song of Sol. 6:13) is a correct / working link. Thank you! :-)

jamesoakley’s picture

Status: Needs review » Fixed

Thanks for testing. That's committed to both branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.