Blog

AJAX WordPress Bloxpress add Weather Plugin Box

After playing around with the existing boxes in BloxPress  you might want to add other Plugins into their own boxes.

Here´s an example on how to add a new box to the bloxpress template with the Weather Plugin. Let´s start right away:

1. get the Weather plugin and install it into your WordPress Blog

2. Configure the Weather Plugin to your needs .. can also be done later

3.  go into your themes/bloxpress/blox/plugins/ folder and copy one of the existing plugin-box-files. For me the weighted.php did it. This is only so that you have the standart includes on top of the file. I renamed the copied file to weather.php

4. now open the file and edit the stuff beneath line 6. What you put in here, depends on the plugin you are using. In most plugins you´ll find some lines of code you have to put into your template or sidebar. I put in this:

—————- 

<?php if (function_exists(‘WeatherIcon’)) { ?>
   
        <?php bp_title(‘My Weather’,TRUE,TRUE); ?>
            <ul>
              <?php WeatherIcon(‘station=EDDK&before=<li>&after=</li>’); ?>
            </ul>
        <?php bp_footer(”); ?>
       
    <?php } else { ?>
   
        <?php bp_title(‘My Weather’,TRUE,TRUE); ?>
            <ul>
                <li>
                    Sorry. The Weather Plugin isn’t active at the moment.
                </li>
            </ul>
        <?php bp_footer(”); ?>
       
    <?php } ?>

 —————-

 Be aware of the WeatherIcon(‘station=EDDK&… function call. You will have to adapt that one at least to your City .

5.  Now we have to tell the bloxpress system that this box exists. therefore go into:
themes/bloxpress/blox/bp-blox_definitions.php and put in a new line into the plugin block:

$blox['weather']     = $pluginblox_folder."weather.php";

From now on the Weather box will appear in the Frontend Dropdownbox where you can add new boxes.

6. To have the Weather box appear in the default layout you have to tell the System a little bit more.
so open the file: themes/bloxpress/presets/bp-default.php and insert the line:

$layout[$title][$columns[0]][] = $blox['weather'];

You´ll have to see where you want to insert it. You can change the Colum (for me it is the left colum) and depending on the line you put it, it´ll be higher or lower in you left sidebox.

7. That´s it, from now on you´ll have a box with your current weather … well isn´t it nice that you don´t have to open the windows anymore to look if the weather is good enough to get yourself a beer :-)

 

———-

Links to further Artikels concerning Bloxpress:

Bloxpress Documentation 1

How to add a new Pluginbox into Bloxpress (ex. with Weather plugin) 

How to add a third column into the Bloxpress default Template

 

Work

Archive