Title: Buy a Brick
Author: lagally
Published: <strong>December 20, 2011</strong>
Last modified: February 9, 2012

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/buy-a-brick.svg)

# Buy a Brick

 By [lagally](https://profiles.wordpress.org/lagally/)

[Download](https://downloads.wordpress.org/plugin/buy-a-brick.1.1.zip)

 * [Details](https://test.wordpress.org/plugins/buy-a-brick/#description)
 * [Reviews](https://test.wordpress.org/plugins/buy-a-brick/#reviews)
 *  [Installation](https://test.wordpress.org/plugins/buy-a-brick/#installation)
 * [Development](https://test.wordpress.org/plugins/buy-a-brick/#developers)

 [Support](https://wordpress.org/support/plugin/buy-a-brick/)

## Description

This plugin loads an XML file specifying different “bricks” used to make up a fundraising
image map and generates a dynamic CSS image map based on the XML file for use as
a fundraising meter within pages, posts, and more.

Features:

 * Loads XML file and displays it as a form within the Administrator panel for editing
 * Saves edited XML file
 * Parses XML file to generate dynamic image map, with opaque squares representing“
   bricks” that are not yet purchased and transparent squares representing “bricks”
   that have been purchased.
 * Each brick has a hover button popup that directs the user to a donation page,
   shopping cart, etc.
 * Completely customizable background image, XML file, popup image, and more

For support and further information about the Buy-a-Brick plugin see the plugins
homepage at [http://www.ghtech.org/tools/plugins.html](http://www.gthech.org/tools/plugins.html).
**
Plugin Official Site** If you have questions about installation or use of this plugin,
please visit the [official plugin site](http://www.ghtech.org/tools/plugins.html).

## Screenshots

[⌊Plugin settings page⌉⌊Plugin settings page⌉[

Plugin settings page

[⌊XML Editor screen⌉⌊XML Editor screen⌉[

XML Editor screen

[⌊Fundraising image map showing purchased and unpurchased bricks⌉⌊Fundraising image
map showing purchased and unpurchased bricks⌉[

Fundraising image map showing purchased and unpurchased bricks

## Installation

 1. Create and upload the sprite image, popup image, and XML file for use with the 
    plugin. See the [official plugin site](http://www.ghtech.org/tools/plugins.html)
    for details on how to do this, especially if you will be linking to Paypal from
    your image map.
 2. Edit the `brickstatic.css` file to match your WordPress theme or fundraising page.
    Replace the existing CSS file in the .zip file with the file you edited.
 3. Install and activate the Buy-a-brick plugin as normal.
 4. Select the Buy-a-Brick Settings under the Options admin menu and fill out the form
    with the correct information.
 5. Install, activate, and configure [exec-PHP](https://wordpress.org/extend/plugins/exec-php/)
    or another plugin that allows the execution of PHP code in WordPress posts and 
    pages.
 6. Edit the header.php file for the WordPress theme you are using. Add the following
    lines somewhere above the `</head>` tag:
 7. <link type="text/css" href="” rel=”stylesheet” media=”screen”>

where `[PAGE_SLUG]` is the slug of the page you wish the image map to appear on.
You can also use any of the other conditional tags in WordPress if you want the 
image map to appear elsewhere in the site (with a specific page template, in a post,
etc.). See the [official plugin page](http://www.gthech.org/tools/plugins.html) 
for more details.

 1. In the page, post, etc. where you want the image map to appear, add the following
    code:

## FAQ

  How do I create the image sprite to use in the plugin?

The sprite has two parts: the bottom half should be the image you want to appear
when bricks are purchased, with an identical version of the image directly above
it with opacity applied to darken it for bricks that are not yet purchased.

  What is the format of the XML file?

    ```
     <bricks> 

    <item id="item-id-1" product_name="message-that-appears-in-popup-1" link_brick="url-that-popup-links-to" width="width-of-this-brick-in-px" height="height-of-this-brick-in-px" top=
    upper-bound-of-this-brick-in-px" left="left-location-of-this-brick-in-px" type="2-if-purchased-1-otherwise" raised="total-raised-so-far-first-item-only" />

    </bricks>
    ```

An example XML file:

    ```
    <?xml version="1.0" encoding="utf-8"?> 

     <bricks> 

    <item id="mc1" product_name="Purchase your Brick now $5000" link_brick="http://www.somesite.org/store/products-page/bricks/bricks4" width="99" height="49" top="0" left="0" type="1" raised="$3.700.00"/>

    <item id="mc2" product_name="Mr. Testing Bricks" link_brick="http://www.somesite.org/store/products-page/bricks/bricks4" width="99" height="49" top="0" left="100" type="2" />

    <item id="mc3" product_name="Purchase your Brick now $5000" link_brick="http://www.somesite.org/store/products-page/bricks/bricks4" width="99" height="49" top="50" left="0" type="1" /> 

    <item id="mc4" product_name="Mrs. Testing Bricks" link_brick="http://www.somesite.org/store/products-page/bricks/bricks4" width="99" height="49" top="0" left="200" type="2" />

    </bricks>
    ```

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Buy a Brick” is open source software. The following people have contributed to 
this plugin.

Contributors

 *   [ lagally ](https://profiles.wordpress.org/lagally/)

[Translate “Buy a Brick” into your language.](https://translate.wordpress.org/projects/wp-plugins/buy-a-brick)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/buy-a-brick/), check
out the [SVN repository](https://plugins.svn.wordpress.org/buy-a-brick/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/buy-a-brick/) by
[RSS](https://plugins.trac.wordpress.org/log/buy-a-brick/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1

 * Revised settings to allow for five fundraising levels and specification of completely
   different URLs to link to from each level. This is for compatibility with Paypal
   buttons.

#### 1.0.5

 * Updated plugin to handle Paypal donation or purchase link within image map.

#### 1.0

 * First stable version

## Meta

 *  Version **1.1**
 *  Last updated **15 years ago**
 *  Active installations **10+**
 *  WordPress version ** 2.7.0 or higher **
 *  Tested up to **3.3.2**
 *  Language
 * [English (US)](https://wordpress.org/plugins/buy-a-brick/)
 * Tags
 * [charities](https://test.wordpress.org/plugins/tags/charities/)[charity](https://test.wordpress.org/plugins/tags/charity/)
   [donate](https://test.wordpress.org/plugins/tags/donate/)[donate goals](https://test.wordpress.org/plugins/tags/donate-goals/)
   [donate meter](https://test.wordpress.org/plugins/tags/donate-meter/)
 *  [Advanced View](https://test.wordpress.org/plugins/buy-a-brick/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/buy-a-brick/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/buy-a-brick/reviews/)

## Contributors

 *   [ lagally ](https://profiles.wordpress.org/lagally/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/buy-a-brick/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](http://www.ghtech.org/tools/plugins.html)