Extension:CopperminePhotoGallery

Detailed description
This extension allows you to insert pictures from your Coppermine Photo Gallery (CPG) into a mediawiki page. You can choose all three different sizes created by CPG. If you click on a thumbnails the large image will open in a new window (JavaScript). PHP5 and "mysqli" (see MySQL improved extension) are required.

Installation
OPTIONAL: You might take a look at Installing an extension, if you never installed an extension before.


 * 1) Download CopperminePhotoGallery.zip
 * 2) Extract it to your directory, e.g. "mediawiki-1.13.x/extensions"
 * 3) Edit your "LocalSettings.php" (see below)

Copy the following line at the end of your "LocalSettings.php":

Afterwards continue with your MySQL settings.

MySQL and other settings
Your CPG installation should contain a file like inlcude/config.inc.php with all your MySQL settings. Please copy your values to "cpg.php".

You must set these constants, otherwise this extension will not work. "cpg.php" connects the database to get the needed values.

Your next step should be to change "CPG_URI". Your CPG probably is installed in a subdirectory (e.g. "cpg"). You should find "albums" in this directory.

There is a CPG demo. The right "CPG_URI" for this demo would be:

http://coppermine-gallery.net/demo/cpg14x/albums/

"CPG_URI" is needed to display your thumbnails and images. This extension will not work without it.

These are default settings, which should work right away. If you change those values in CPG, you must change them here as well.

Get help
First of all you can use help to get help. This will display all albums and all pictures, which are stored in your CPG database.

If you have further questions, please post them here (discussion).

Usage
To get help and general informations about your CPG, please use help

If your know the subdirectory to your album and which pictures you want to show, please use pic1.jpg;pic2.jpg;pic3.jpg

Please remember "subdir_to_your_album" is not the complete path. Example: Your CPG_URI is " http://www.yourdomain.tld/cpg/albums/ " and your images are stored in "beach". All images would be accessible with a browser in " http://www.yourdomain.tld/cpg/albums/beach/ ", but your album ("subdir_to_your_album") would be just "beach".

There is also the option "size". It has two possible values:
 * big
 * normal



That way you are able to choose if you want to use thumbnails or larger versions of your images.

Note: The &lt;img&gt; tag embeds an image in an HTML page. The &lt;img&gt; tag has three required attributes in this extension:
 * src,
 * alt and
 * title.

Take a look a the code:

$select_pictures = 'SELECT pid, filepath, filename, title, caption FROM '. CPG_PREFIX. 'pictures WHERE filename IN(' . $search_string . ') ORDER BY aid, pid';

(...)

$output .= ''. "\n";

All these attributes are filled with values from the database, not the extension.

Code
I tried to comment my code. If you have any questions or need more comments on a special line, please let me know.