Hi

The attached patch to the scipturefilter.inc file provides some 'improvements' that I have made:
1) Make use of the thickbox module to display the scripture without opening a new browser window (you must have thickbox installed: http://drupal.org/project/thickbox)
2) Link to the http://read.thepositiveword.com bible site (written by me!). This site has an uncluttered quote page so is quicker to load, but only provides Public domain bibles.
3) Create and use a getBibleGatewayId function that passes the ID to biblegateway as per http://www.biblegateway.com/usage/linking/versionslist.php
4) Removed the TNIV as biblegateway handles this and handles references better.
5) Display biblegateway passages using the print interface (less cluttered and loads quicker).

My personal preference is for the KJV, so the patch changes line 4 but you can change that back to NIV or something else if you want. Anyway, hope you find this useful, I may have more patches on the way soon...

God Bless and Kind Regards

Matt

Comments

matt b’s picture

Title: thickbox and read.thepositiveword.com integration » filter improvements, thickbox and read.thepositiveword.com integration
StatusFileSize
new6.74 KB

I have also improved the filter so that it detects the word 'chapter' (or chap ch ch.), the word 'verse' (or verses v vs), and works with & so that there is an increased likelihood of correctly detecting and linking scriptural references. Updated patch attached.

Steve Simms’s picture

Status: Needs review » Needs work

1) Make use of the thickbox module to display the scripture without opening a new browser window (you must have thickbox installed: http://drupal.org/project/thickbox)

I like this idea. Do you think you could update it so that it only adds the class if thickbox is installed, and works as before, otherwise?

2) Link to the http://read.thepositiveword.com bible site (written by me!). This site has an uncluttered quote page so is quicker to load, but only provides Public domain bibles.

I'll probably stick with BibleGateway for the official release, since that's more or less the canonical Bible site these days, and has pretty much all the current Bible translations available, so you get a consistent interface.

3) Create and use a getBibleGatewayId function that passes the ID to biblegateway as per http://www.biblegateway.com/usage/linking/versionslist.php

I like this as well. What do you think about getting all of the Bible-definition-related code in one place? Currently, there's $translation_regex, the scripturizeLinkReference function, and the section in scripturefilter.module, all of which need to be updated whenever a new Bible gets added. This has been bothering me for a while.

I'd rather see all of that in some sort of configuration file or function, with the rest of the code being more generic. That should make it easier to maintain.

Out of curiosity, where did you come across this link? I'm not seeing any other section on BibleGateway that talks about it.

4) Removed the TNIV as biblegateway handles this and handles references better.

That's fine.

5) Display biblegateway passages using the print interface (less cluttered and loads quicker).

I think I'd prefer not to do this -- it makes it harder to look deeper into a given passage, since you lose the contextual buttons (next/prev chapter, etc.).

Also, do you think you could separate the patches out into one issue per patch? That would make it a lot easier to review, test, and approve them, especially if I want to commit certain things but ask for a few changes to others.

Thanks!

matt b’s picture

1) Make use of the thickbox module to display the scripture without opening a new browser window (you must have thickbox installed: http://drupal.org/project/thickbox)

I like this idea. Do you think you could update it so that it only adds the class if thickbox is installed, and works as before, otherwise?

I'm sure this could be done - I intend to revisit the changes I have made, when I have time! However, if you haven't got thickbox installed, all it does is add "&TB_iframe=true&height=400&width=600" to the end of the URL (which thickbox picks up on if it is installed).

2) Link to the http://read.thepositiveword.com bible site (written by me!). This site has an uncluttered quote page so is quicker to load, but only provides Public domain bibles.

I'll probably stick with BibleGateway for the official release, since that's more or less the canonical Bible site these days, and has pretty much all the current Bible translations available, so you get a consistent interface.

I understand, however I'm biased to read.thepositiveword.com because I wrote it! May be (one day) the choice of site providing the bible text for a particular version could be configurable by the user...

Out of curiosity, where did you come across this link? I'm not seeing any other section on BibleGateway that talks about it.

Google, I think!

Also, do you think you could separate the patches out into one issue per patch? That would make it a lot easier to review, test, and approve them, especially if I want to commit certain things but ask for a few changes to others.

At the moment I'm pushed for time, but if and when I can, I will!

What I'd really like is to enhance the filter so that if, for example, the article had the text 'Ephesians 4:4-6 summarizes our faith. Look further down at verse 13, ' - the filter would work on the first reference (Ephesians 4:4-6) as it does today, but also pick up 'verse 13' and link it to Ephesians 4:13. I might look at this in the future.

Matt

matt b’s picture

StatusFileSize
new8.84 KB

I have now made the final 'hack' I need - to pick up partial references and link those, using the volume/book/chapter/translation information from the previously linked reference (requires two passes of the text - I can't think of how to make it more efficient at the moment). Updated scripturefilter.inc (for Drupal 5.x) attached with all my changes.

I will separate into individual patches when I have time.

matt b’s picture

Version: 5.x-1.1 » 6.x-1.0
Status: Needs work » Needs review
StatusFileSize
new2.09 KB

I'm now upgrading my site to drupal 6, so need to re-apply my changes. I'll post up the the changes as individual patches.

Here is the patch for thickbox integration, which I've added a check that thickbox is installed. If you install thickbox after installing scripturefilter with this patch applied then you will need to clear the filter cache so that the scripture links on existing nodes are regenerated.

matt b’s picture

StatusFileSize
new1.71 KB

Attached is the biblegateway version id patch

matt b’s picture

StatusFileSize
new4.63 KB

And now the biggie - improvements to the filter. This uses two passes to pick up partial references and link them as well. Enjoy!

matt b’s picture

StatusFileSize
new1.65 KB

Final one - adds read.thepositiveword.com integration.

bbodenmiller’s picture

@steve: Which of these still need changes before you will commit them? I would like to use many of these features added however I like to use final non-hacked code on my site. So if you can let us know what other changes you would like made I can maybe help (limited coding skills).

matt b’s picture

Suggest you apply the patches (in a test/development installation) and confirm that they work or not.

matt b’s picture

Did any of my patches get committed in the end? I may need a drupal 7 version soon....

jamesoakley’s picture

Status: Needs review » Closed (won't fix)

No - none of them got committed. I think what happened is that the previous maintainer ran out of time to give to the module. There is (nearly) a Drupal 7 version out.

I'm marking this as "won't fix".

Please don't misunderstand that - lots of the features here would be worth having. There are 3 reasons why this particular issue is a "won't fix": (i) 4-5 different new features in one issue and with one patch makes reviewing and committing really difficult to do - we need to have one feature per issue, and then one patch per feature. That way they can be tested and committed independently. (ii) We're now on Drupal 7, and it's over 3 years since the last contribution to this. Thickbox probably becomes ColorBox and so on.

So if Matt B, or anyone, wishes to give some time to some / all of these improvements, I'd be delighted for you to open a new issue for each single feature you want to see, and then we can start reviewing any patches that anyone wants to offer. (I should add that I, too, would prefer to stick to biblegateway.com where possible, so I'm not keen on feature 2 above).