MyBB Community Forums

Full Version: BibleGateway Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am after a plugin that automatically converts any message text that references a Bible passage in standard notation to a link to that part of the Bible. Links are opened in a new window, with the bible text being displayed using Bible Gateway

The user may also specify the translation they wish to read these links in, using an extra option in their profile. Standard abbreviations can be used, e.g. Matt 3:5-7, and it is case insensitive.

PhpBB had this plugin in version 2 of their software but seems to have lost it in the upgrade to version 3.

I found a MyBB forum that has this feature: http://www.the-house-of-prayer.net/forum...php?tid=41

so was hoping it was available for download somewhere. I searched the MODs here but couldn't find it.

Thanks for any help.
How about asking the admins of this forum how they did it? Maybe they're willing to share...
it seems like the admin of this site just created a mycode. Just create a mycode...
for instance...

\[bible\](.*?)\[/bible\]

replace with...
<a href="http://www.biblegateway.com/passage/?search=$1&version=9">$1</a>

That should work. Smile
it seriously should? really Big Grin I'm gonna try it!

now how does this MyCode work? what do I have to do?
(2008-12-31, 05:40 PM)MCII-Totality Wrote: [ -> ]it seriously should? really Big Grin I'm gonna try it!

now how does this MyCode work? what do I have to do?

Do you know how to get to the MyCode page in the AdminCP?
If you have the latest version of Mybb, you can go to the Configuration tab. And mycode will be in the left menu.

In the mycode panel, you can click the "Add MyCode" button to the right.

Give it a title such as "Bible MyCode".

You don't need the short description unless you want to.

copy this code (exactly, the slashes escape the ['s and ]'s):
\[bible\](.*?)\[/bible\]
into the Regular Expression field.

For the Replacement Field:
<a href="http://www.biblegateway.com/passage/?search=$1&version=9">$1</a> 

Enabled: Yes

Parse Order: not necessary

Save the mycode, now in posts they can use it like this
[bible]Genesis 1:1[/bible]
It will result like this:
Genesis 1:1
Thank you so much. This is fabulous.
What they're doing on their site is not a mycode in the classical sense (i.e. not [bible][/bible]), but actually a regexp that tries to detect words that could refer to a bible passage and auto linking them to the bible.

so it's like ((Genesis|and|List|of|other|possible|names|here)( [0-9]+(:[0-9]+|)|)) -> a href search $1

with a complicated regexp that matches all sorts of bible search strings.

not a very clean solution, as it either matches too little or too much.

if your users are willing to use a [bible] tag for such links, that's the much better solution
wow Big Grin Thanks for this! I needed it
(2009-01-01, 12:30 AM)frostschutz Wrote: [ -> ]What they're doing on their site is not a mycode in the classical sense (i.e. not [bible][/bible]), but actually a regexp that tries to detect words that could refer to a bible passage and auto linking them to the bible.

so it's like ((Genesis|and|List|of|other|possible|names|here)( [0-9]+(:[0-9]+|)|)) -> a href search $1

with a complicated regexp that matches all sorts of bible search strings.

not a very clean solution, as it either matches too little or too much.

if your users are willing to use a [bible] tag for such links, that's the much better solution

Thanks for the info. The regexp does sound complicated. The MyCode option works well. I just have to encourage my members to use it.
what's your board? I may join Big Grin
Pages: 1 2