Coloring Contest Add-on

This add-on is used to allow users to post a colored in picture to a coloring contest.

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 Contest Add-on

The contest 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 comment, and agree to the contest terms.  The picture and information are placed in a queue for moderation.

2. Moderating Images

When an image and information are posted, you will receive an email with a link to moderate the image. You can edit the details before accepting the entry, or you can delete the image and information. You can also see a view the images that are in the queue, the accepted entries, and the trash.

You can also download a CSV file which lists all the entries and which folder they are in.  This is useful if you want to use the email addresses to contact all entrants.

3. Judging the Contest / Winning entries

The add-on doesn't actually do this part.  There are too many possible ways you may want to deal with and use the competition entries.  When the competition has closed you should look at the entries and make a decision.  You have all the images and information, and it is up to you how you want to proceed.

Step 1: Download and install the add-on

  1. Download the Contest add-on (contest.zip) and extract the files.
    The files should go into their own "contest" folder under the main "mcb" directory.
  2. Open "contsettings.php" in a text editor.
  3. In CONTEST_EMAIL, replace "your email here" with the email address you want entries to go to.
    define('CONTEST_EMAIL', This email address is being protected from spambots. You need JavaScript enabled to view it.');
  4. In CONTEST_SECRET, replace the default string with one of your choosing. Eg...
    define('CONTEST_SECRET', 'hJ51O_pL8s');
  5. In CONTEST_TITLE, replace Example Coloring Book: Coloring Contest with your desired title. E.g...
    define('CONTEST_TITLE', 'Summer Coloring Contest');
  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. Edit the "terms.html" file, to provide details of the contest and specify your terms and conditions.
  9. There are also other files that you may want to change. Check the Files and Directories section below.
  10. Upload the entire "contest" folder (including subfolders) to the mcb folder on your site.

Step 2: Add a button for the Coloring Contest

  1. Open config/config.xml.
  2. Edit or create a button as in the following example...
    <button id="custom3" visible="true" tip="Enter Coloring Contest"
    message="Sending to Coloring Contest" icon="contest"
    preload="./mcb/contest/preload.html"
    url="./mcb/contest/contentry.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 Contest add-on.

The url 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/contest/contentry.php"

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

Step 3: Handle the entries as they arrive

Once you have set the contest up, people will be able to enter the contest.  You will receive emails that let you handle the entries as they come in.

Notes

The Contest 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 /contest/queue folder, when moderated it goes to the /contest/entry folder, and if deleted it goes to /contest/trash.

Files and Directories

The following table lists directories and files in the contest add-on. 

Files marked with "MAKE CHANGES" are ones that you can, and probably should change.

Those marked "Advanced" should only be edited if you REALLY know what you are doing.

Those that are blank are ones you can easily change, but probably don't need to.

File/DirectoryDescriptionUsage notes
entry Directory containing all the currently accepted entries.
queue

Directory containing all the entries that need to be moderated.

trash

Directory containing all the currently entries that have been flagged as non-winners.

_READ_ME.txt

Text file with version information, and other notes about the add-on.

Read it!

contdata.php

PHP Class that handles storing and retrieving entry information.
Currently stores information in XML files.

Advanced
contentry.php

Main script that shows posted image and entry form, and handles entry.

Advanced
contest.css

Styles used by the contest HTML pages.

contsettings.php Main settings for contest. See comments in code for details. MAKE CHANGES
contview.php Shows entries in various folders, and allows viewing and moving. Advanced
entered.php Message that is shown after a contest entry has been accepted.

 

entry.php Message that is shown with an accepted entry in the moderation area.
entering.php Message that is shown on the competition entry form.

 

index.html Placeholder to stop basic snooping.
form.css Form styles.
form.php Functions to assist in form creation. Advanced
postcontest.php Message that is shown once a contest has ended. Can include the PHP constant DATE_RANGE to show the period that the contest ran.
precontest.php

Message that is shown before a contest has started. Can include the PHP constant DATE_RANGE to show the period that the contest will run.

preload.html Page shown while image is being sent to server.
progress.gif Animated gif shown during loading.
queue.html

Message that is shown with a queued entry in the moderation area.

terms.css Style for terms and conditions.
terms.php Terms and conditions.

MAKE CHANGES

trash.html

Message that is shown with a trashed entry in the moderation area.

util.php Utility functions.

Advanced