Topic: Making my own BBCode

Hello everyone!
I would like to create my own code. I would like user's on my website to have this tag [verse]Mateo 2:1[/verse] and whatever they put between it will make it a link to Biblegateway link the link below:
http://www.biblegateway.com/passage/?search=Mateo 2:1&version=60

I don't know what to edit or where to go. Im a newbie in php and javascript but if you guide me where to go and what to change I will be able to make it work. Thanks in advance for your help.

Another example of what I mean.

bbcode
[verse]Juan 3:16[/verse]

Will generate this link
<a href="http://www.biblegateway.com/passage/?search=Juan 3:16&version=60">Juan 3:16</a>

All that will need to be changed is the result after '?search=' and before '&version=60'
Thanks for your help....

Re: Making my own BBCode

Open include/parser.php and find the arrays `$pattern` and `$replace` inside the `do_bbcode` function; You'll need to add an item to each of these arrays.

Find?

'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');

?replace with:

'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
'#\[verse\](.*?)\[/verse\]#');

Find?

'<span style="color: $1">$2</span>');

?replace with:

'<span style="color: $1">$2</span>',
'<a href="http://www.biblegateway.com/passage/?search=$1&version=60">$1</a>');

Re: Making my own BBCode

WOW THANK YOU!!! big_smile big_smile
Thank you very much it works GREAT!!!...