Integrate into your own website

There are two ways to use MyBlitzortung on your own website.

Standalone

After installation is completed, MyBlitzortung can already be used as it is. Simply enter the path to MyBlitzortung in the browser and it should work. In this form it can also be viewed in a frame on your own website.

Integration with PHP

MyBlitzortung was developed for a seamless integration into existing websites. The different areas (Maps, Statistics…) can be individually accessed through PHP functions. With that, it is possible to hide parts of MyBlitzortung, as not using the specific functions.

MyBlitzortung has been successfully integrated into the following content management systems:

  • WordPress
  • Drupal

As a first step a simple example where only the map view is included:
<?php
include "dateipfad/zu/myblitzortung/blitzortung.php";
?><html>
...
Eigenes HTML oder PHP...
...
<?php
bo_show_map();
?>
...
</html>

General

If possible, you should put the "include" instruction before any output from the script. This may not be possible in all CMS, so the including also can be done later in the script. However, it can cause problems when logging in as a user.

An overview of the PHP functions can be found here:

Graphics

To deliver the graphics, a helper script is required. The URL to this script is specified by the constant BO_FILE in config.php. The easiest way is to use the blitzortung.php from the MyBlitzortung directory. If you want to hide your real MyBlitzortung directory, so you can create your own PHP file, where the file blitzortung.php is included. MyBlitzortung can therefore be installed even outside of your DocumentRoot directory.

Special features for the login

Since the link to the login screen is displayed on every page, MyBlitzortung has to know, under which URL it can reach it. For this, the constant BO_LOGIN_URL is provided in the settings.php. When integrating MyBlitzortung into your website, you have to adjust this value. Either you can leave it on the standalone installation: ?path/to/blitzortung/index.php?bo_page = login'. But it's better, to create a separate file where the function bo_show_login() is called, and specify this URL.

The same procedure has to be done with the other pages, for example, BO_LOGIN_ARCHIVE is the URL to the archive (not all of these URLs are currently used).

Style

The stylesheet file “style.css” in the MyBlitzortungs directory should be integrated into your own HTML file. So you do not need to create you own Stylesheet and you can still change the style with a additional css file.. Important: The MyBlitzortung function has to be put be in a div container with the id “myblitzortung” . The style.css “acts” only in that area and does not change any other styles in your HTML file.

Example

Your own PHP file (myfile.php) looks like this:
<?php
include "dateipfad/zu/myblitzortung/blitzortung.php";
?><html>
<head>
...
<link rel="stylesheet" href="url/zur/myblitzortung/style.css" type="text/css">
<link rel="stylesheet" href="own_style.css" type="text/css">
...
</head>
<body>
...
Beliebiger eigener HTML/PHP code
...
<?php
bo_show_menu();
?>
<div id="myblitzortung">
<?php bo_show_all(); ?>
</div>
Beliebiger eigener HTML/PHP code
...
</body>
</html>

config.php:
define('BO_FILE', '/url/zur/myblitzortung/blitzortung.php');
define('BO_ARCHIVE_URL', 'meinedatei.php?bo_page=archive');
define('BO_LOGIN_URL', 'meinedatei.php?bo_page=login);