Coloring Book Gallery Add-on

This add-on is used to allow users to post a colored in picture to an online picture gallery on your website.

Disclaimer: All add-ons are provided as samples only, and will require some customisation to suit your site structure.  As such we can only provide basic support with regard to these add-ons.  We cannot problem-solve your website for you.

About the Gallery Add-on

The gallery add-on features 3 main parts...

1. Posting an Image

The posting code allows an image to be posted by a user of the coloring book. They are shown a thumbnail of the picture, and can then enter their details and a description, to be saved along with it. The picture and information are placed in a queue for moderation.

2. Moderating Images

When an image and information is posted, you will receive an email with a link to moderate the image. You can edit the details before posting, or you can delete the image and information. You can also see a list of images that are in the queue.

3. Displaying the Gallery

The fun part! The gallery displays the most recent images (up to a defined limit), as thumbnails with basic info. Clicking the image shows the larger version of the image, and additional details.

Step 1: Download and install the add-on

  1. Download the Gallery add-on ( and extract the files.
    The files should go into their own "gallery" folder under the main "mcb" directory.
  2. Open "galsettings.php" in a text editor.
  3. In MOD_EMAIL, replace <your email here> with the email address you want moderation messages to go to.
    define('MOD_EMAIL', 'gallery@');
  4. In GAL_SECRET, replace the default string with one of your choosing. Eg...
    define('GAL_SECRET', 'h^51O_pL8s');
  5. In GALLERY_TITLE, replace Example Coloring Book: Gallery with your desired title. E.g...
    define('SITE_NAME', 'My Cool Coloring Gallery');
  6. You can also change other settings, labels, etc. Details on these are available as comments in the source code.
  7. Save the file.
  8. Upload the entire "gallery" folder (including subfolders) to the mcb folder on your site.

Step 2: Add a button for posting to the Gallery

  1. Open config/config.xml.
  2. Edit or create a button as in the following example...
    <button id="custom2" visible="true" tip="Post to Gallery"
    message="Sending picture to Gallery" icon="gallery"
    url="./mcb/gallery/galpost.php" post="file" pixels="600"/>
  3. Save the changed config file and upload it to your website.

Note that the post option used is file. This is required for the current version of the Gallery add-on.

The url and preload used here should be relative to the page that the coloring book is on. If your page is at the root level of your domain, then you will need to include "mcb" in the url.
E.g. url="./mcb/gallery/galpost.php"

For more information on custom buttons see the Custom Buttons article.

Step 3: Add the Gallery to your website

Now that it's set up, you'll want to let visitors see the pictures.

  1. Create a page on your website for the gallery to appear on.
  2. Use an iframe to display the gallery. The code will look something like this...
    <iframe src="/mcb/gallery/gallery.php" 
    width="100%" height="100%" frameborder="0"></iframe>
  3. Save your page and upload it to your website.
  4. You will also need to give visitors a way of getting to the gallery, through a link or menu item.


The Gallery add-on saves the colored picture to the "/save" subdirectory, using the "saveimage.php". Be sure you have the latest version, and that "saveimage.php" is in your main "mcb" folder, and that the "/save" subdirectory exists and is writable by PHP.

The pictures that are saved are NOT automatically cleaned up. If you are concerned about disk-space you should clean out the directory from time to time.

When the user fills in details and posts, the picture is then moved to the /gallery/queue folder, when moderated it goes to the /gallery/pic folder, and if deleted it goes to /gallery/trash.