title = "Bible Search"; $page->description = "Search and compare various translations of the bible."; $page->content = << This search form can take most formats of verses, such as 'Psalms 23', 'Mark 1:1', 'John 2:5-9' or 'Luke 1:1-4,6,9-10'. It can also take most commonly used abbreviations, such as '1 c 2:3' or 'jn 2'.

EOF; $translations = array( 'kjv' => 'King James Version', 'niv' => 'New International Version', 'nrsv' => 'New Revised Standard Version', 'amp' => 'Amplified Bible', 'cev' => 'Contemporary English Version', 'esv' => 'English Standard Version', 'mkjv' => 'Modern King James Version', 'msg' => 'The Message', 'nasb' => 'New American Standard Bible', 'nkjv' => 'New King James Version', 'nlt' => 'New Living Translation', ); if ( $_GET['translation'] ) { $translation = $_GET['translation']; } else { $translation = 'niv'; } require_once('Form.class'); $form = new Form(); $form->text('Enter Bible Verse','verse',$_GET['verse']); $form->select('Select Translation','translation',$translations,$translation); $form->submit('submit','Search'); $form->reset('Clear'); $page->content .= $form->render(); if ( isset($_GET['verse']) && $_GET['verse'] != '' ) { require_once('Bible.class'); $bible = new Bible(); if ( $bible->setTranslation($translation) ) { $page->content .= "

".$translations[ $translation ]."

\n"; $page->content .= $bible->parseVerse($_GET['verse']); } else { $page->content .= "

Unknown Translation

\n"; $page->content .= "

Unknown translation: ".$translation."

\n"; } unset($bible); } $page->display(); ?>