Unzip this file. It will create a directory (folder) called “bmlt-basic”.

Inside this directory are a bunch of files prefaced with “sample_XXX.” These are examples of how to create various BMLT displays, and will not be necessary to install on your server. However, the “index.php” file is initially the most important file, as it contains exact instructions for implementing the BMLT in your site. If you run it, you will get a simple default implementation on a blank page. (NOTE: Since these are PHP files, you can’t just drag them into your browser. You need to actually install them onto a Web server, then run them on that server).

You need to make sure that the “bmlt-basic” directory is in the same directory as the PHP page that you will be modifying to implement the BMLT.

You will also need to set up the “config-bmlt-basic.inc.php” file. That file is extremely well documented about what you need to change.

View the “index.php” file to see exactly what you need to do to set up the Basic Client.

The Code Listing

The following is the code listing for the “index.php” file:

<?php
/********************************************************************************************
* EXAMPLE OF THE MOST BASIC IMPLEMENTATION OF THE BASIC BMLT SATELLITE *
* *
* Find out more at: http://bmlt.magshare.org *
* *
* This file demonstrates how to integrate the default interactive search into any PHP file. *
* You do not need a content management system (like WordPress or Joomla). You just need to *
* include the 'bmlt-basic' directory, and all its contents, into the same directory as *
* this file. You will edit the 'config-bmlt-basic.inc.php' file to establish the settings. *
* The 'config-bmlt-basic.inc.php' file must be in the same directory as this file. *
* *
* REQUIREMENTS: *
* This needs to run on a server that supports PHP 5.0 or greater. *
* You do NOT need MySQL or PDO. Just a PHP 5 server is sufficient. *
* This file needs to be a PHP file (not an HTML file). *
* *
* First, you need to edit the config-bmlt-basic.inc.php to set up the environment. *
* Once that is done, then proceed with the 3 steps below. *
********************************************************************************************/
/********************************************************************************************
* STEP ONE: INCLUDE THE CLASS FILE. *
* *
* You should do "require_once" or "include_once", just as a standard practice (It is not *
* actually necessary in this case, but you should get in the habit). *
* This needs to be done first up; BEFORE the start of HTML. Notice that this is all in a *
* PHP section. This will create a variable, called "$basic_bmlt_object", which will hold *
* an instance of our class. *
********************************************************************************************/
require_once ( dirname ( __FILE__ ).'/bmlt-basic/bmlt_basic.class.php' );
/********************************************************************************************
* Now, you can start the standard HTML. PHP is mixed in with classic HTML. You declare PHP *
* sections by using <?php...?> blocks. These cause the Webserver to execute the PHP at that *
* point. You will never see the PHP in your actual page output. *
********************************************************************************************/
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Demonstration of Standalone BMLT Satellite</title>
<!-- ***********************************************************************************
* STEP TWO: GENERATE THE HEAD CONTENT *
* *
* You should decide what shortcode you will use (our example uses the standard *
* '[[BMLT]]' default interactive search. You can see what other choices you have *
* by visiting this page: https://bmlt.magshare.net/shortcodes/ *
* Call the $basic_bmlt_object->output_head() function, with your shortcode as *
* the parameter. *
*********************************************************************************** -->
<?php $basic_bmlt_object->output_head('[[BMLT]]'); ?>
<!-- *********************************************************************************** -->
</head>
<body>
<!-- ***********************************************************************************
* STEP THREE: GENERATE THE BODY CONTENT *
* *
* This is almost exactly like STEP ONE, except that you are now calling the *
* $basic_bmlt_object->output_body() function. It does not need the shortcode. *
* *
*********************************************************************************** -->
<?php $basic_bmlt_object->output_body(); ?>
<!-- *********************************************************************************** -->
</body>
</html>

If you take all the formatting, comments and header stuff out of the above file, you get something like this (We don’t need to specify the shortcode to get the default implementation):