Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: QueenKnitter on April 28, 2007, 04:17:25 PM

Title: QueenKnitter:BibleGateway
Post by: QueenKnitter on April 28, 2007, 04:17:25 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=717)

Adds a Bible Gateway button to the bbcode bar that will link to Bible Gateway for Scripture references in ESV. Many thanks to Karlbenson and his Wikipedia BBCode.
Title: Re: QueenKnitter:BibleGateway
Post by: ham1299 on July 01, 2007, 10:49:28 PM
OK. So how exactly does this work? I installed it and tested it, but when I click on the link, it doesn't take me to the Scripture - just to Bible Gateway, where I'm told my search results aren't valid! ??? Is there a specific way to enter scripture in order to get the link to work properly?
Title: Re: QueenKnitter:BibleGateway
Post by: tophe on December 31, 2007, 05:23:16 PM
Well.. How does this thing work?
It gives me an idea how to make a good mod, but I can't really use this one.. What does it do and how?
Title: Re: QueenKnitter:BibleGateway
Post by: Guiness on March 16, 2008, 09:40:33 AM
The text isn't parsed to the bible= tag which is why the thing doesn't work.
Looks like we have to manually correct the tag by typing text after the bible=
When you click the tag icon on a highlighted text you get

[bible=] text [/bible]


instead of

[bible=text] text [/bible]


eg this code will work and fetch Genesis 1 if you paste it
[bible=Genesis 1]Genesis 1[/bible]


The problem in the mod code is with the &search=$1 in the link, the $1 isn't getting parsed to the link which is why we get empty searches.

array(
'tag' => 'bible',
'type' => 'unparsed_content',
'content' => '<a [b]href="http://www.biblegateway.com/passage/?version=47;&search=$1" [/b]target="_blank" style="border-bottom:1px dashed #FF0000;text-decoration:none">$1</a><sup><span style="font-size:7pt;color:red;">Bible</span></sup>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
                'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_content' => '$1',
),


I tried everything to get it to work and no luck, :(