Download here.

This WordPress plugin supplies a set of template tags to allow you display images from a Coppermine Gallery.

Tags are provided to display the following:

  • A configurable list of albums
  • Grid of images from a selected album
  • A latest images block to display a configurable number of images that were last uploaded.

This plugin leverages Lightbox2 v2.04 to display the full size version of the images. As this software was not created by me it has not been included within this package. It can be downloaded from http://www.huddletogether.com/projects/lightbox2/#download

The plug-in supplies a settings page which allows the user to enter the Coppermine database details and the display settings. 

The gallery on this site uses this plugin, as does the latest images block on the front page.

Installation

Installing this plugin is simple:

  1.  Unzip ‘id-coppermine-plugin.zip’ in to the ‘/wp-content/plugins/’ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. In the ‘Settings’ menu select ‘ID Coppermine’.
  4. Under the ‘General Settings’ section enter the full url to the root of your Coppermine installation i.e. http://www.yoursite.com/copperminedirectory and the Coppermine username of the user for whom to display the images for. NOTE: there should not be a trailing slash in the url.
  5. Under the ‘Coppermine Database Settings’ section enter the Coppermine web server and database details. These details will not be validated so you will only find out if they are incorrect when you try to view a page using one of the template tags. This allows you to be able to change the details at any point.
  6. In the ‘Display Settings’ section you can set the number of column and rows to display when rendering the gallery, and wether to display the image title and to list the albums.
  7. In the ‘Latest Images Settings’ section you can specify the number of images to display when rendering the latest images section.
  8. Download Lightbox2 from http://www.huddletogether.com/projects/lightbox2/#download and extract to the same directory as your blog homepage.

Usage

  1. Inside the folder of your selected theme create a file called ‘gallery.php’.

  2. Open this file using notepad or your favourite text editor and paste the following: 
    <?php
    /*
    Template Name: Gallery
    */
    
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    get_header(); ?>
    
    <div id="gallery" role="main">
    
    <?php
     id_coppermine_render_album_list();
     id_coppermine_render_gallery();
     id_coppermine_render_page_nav();
    ?>
    </div>
    
    <?php get_footer(); ?>
  3. Save the file.
  4. In the admin menu under ‘Pages’ select ‘Add New’
  5. Call the page ‘Gallery’
  6. Do not enter anything into the body/text area of the page.
  7. Under ‘Template’, select ‘Gallery’ from the drop down.

  8. Click publish.

If you change your theme you will need to remember to copy the ‘gallery.php’ file from your original theme directory to your new one.

Donations

Although this plugin is provided free if charge if you would like to make a donation then you can use PayPal.


Share:

  • Google Bookmarks
  • Facebook
  • MySpace
  • Twitter
  • del.icio.us
  • Digg
  • Mixx
  • LinkedIn
  1. haber Said,

    Works great, thank you

  2. steve Said,

    I get a “You do not have sufficient permissions to access this page.” when trying to configure the plugin. Any ideas what I am doing wrong?

  3. Daniel Said,

    Like what steve, i’m getting a heap of mysql errors

  4. Daniel Said,

    I’m having the same issue as steve, but i’m also getting this

    “Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘danielrv’@'lXXX’ (using password: NO) in /home/danielrv/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 51

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘danielrv’@'XXX’ (using password: NO) in /home/danielrv/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 51

    Warning: Invalid argument supplied for foreach() in /home/danielrv/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 412

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘danielrv’@'lXXX’ (using password: NO) in /home/XXX/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 51

    Fatal error: Cannot access empty property in /home/XXX/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 213″

    any Ideas?

  5. m0gb0y74 Said,

    This means that you have supplied incorrect credentials for the MySQL login.

    The simplest way to make sure the values that are in the ID Coppermine configuration are to open up the config.inc.php file that resides in the includes directory of your Coppermine installation. This should look like the following:


    // Coppermine configuration file

    // MySQL configuration
    $CONFIG['dbserver'] = 'aaaa'; // Your database server
    $CONFIG['dbuser'] = 'bbbb'; // Your mysql username
    $CONFIG['dbpass'] = 'cccc'; // Your mysql password
    $CONFIG['dbname'] = 'dddd'; // Your mysql database name

    // MySQL TABLE NAMES PREFIX
    $CONFIG['TABLE_PREFIX'] = 'eeee';

    The values from this file map to the plugin Coppermine Database Settings as follows:

    Server name: aaaa
    Database: dddd
    Username: bbbb
    Password: cccc
    Table Prefix: eeee

    Everything should work fine after this. If the coppermine database is on a different server than your wordpress installation then you may need to change the server name value and provide access to MySQL from the remote server. This is something that you will have to consult with your hosting provider to carry out (if possible).

    James :-)

  6. Daniel Said,

    Hello James,

    My other issue is, I can’t put the details in, because as steve said, I’m getting “You do not have sufficient permissions to access this page.”. Is it possable to hand code the details into the php file?

  7. Daniel Said,

    Ok, got the database details sorted out, but now i’m getting this” Warning: Invalid argument supplied for foreach() in /home/danielrv/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 406″ any Ideas?

  8. m0gb0y74 Said,

    Have you set the number of columns and rows in the Display Settings section?

  9. Daniel Said,

    I think I found the issue, there a typo in the plugin. I don’t have it on me right now, but I will email you the updated version that work for me.

    Daniel

  10. Adam Said,

    I’m getting the same “You do not have sufficient permissions to access this page” error. Any chance you could post your fix Daniel?

    thanks

  11. m0gb0y74 Said,

    Which page are you having the problem with? Is it the Settings page?

    What version of WordPress and Coppermine are your running?

  12. Johnny Smoke Said,

    Same problem. After entering the server info on the admin page, when I hit save I get a “You do not have sufficient permissions to access this page” error.

    WP 2.85
    Coppermine 1.4.21

  13. Adam Said,

    Yeah, it’s the settings page. I think I’ve tracked it down. There were 4 lines in id-coppermine-plugin.php where an incorrect path was specified. I searched for /id-coppermine-plugin/ and replaced it with /id-coppermine/

    Wordpress v2.8.5. Coppermine v1.4.8

  14. m0gb0y74 Said,

    Doh, I didn’t realise that the WordPress plugin system would rename the plugin folder. A new version is on its way. Worked on all my installs as I copied the files into a folder that I named myself.

  15. Adam Said,

    Ah! That would do it. I’ll look out for the new ver.

    Thanks!

  16. Stephanie Said,

    After following all the install instructions I get the following error when opening the Gallery page.

    ” Warning: Invalid argument supplied for foreach() in /home/thericha/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 358
    Warning: Invalid argument supplied for foreach() in /home/thericha/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 426 ”

    Any suggestions?

  17. m0gb0y74 Said,

    This error is occuring when it tries to access album data. This can be caused by one of three things – an incorrect value in the ‘coppermine username’, ‘coppermine albums’, or the ‘table prefix’ settings. If you are using the ‘coppermine albums’ settings this must be the coppermine album id values and not the album names i.e. 1, 6, 7 etc.

  18. Stephanie Said,

    I redid all my settings, saw where 1 was wrong, but am still getting:

    “Warning: Invalid argument supplied for foreach() in /home/thericha/public_html/wp-content/plugins/id-coppermine/id-coppermine-template.php on line 426″

  19. Stephanie Said,

    Ok, think I got it working. I Had to put something in the coppermine albums and it worked. If I leave it blank I get the error…hmm.

  20. Stephanie Said,

    Well maybe not…any ideas?

  21. m0gb0y74 Said,

    Have you set the ‘coppermine username’ value? This needs to be the username that you log into Coppermine as and not the database username that Coppermine uses to log into the database.

  22. Jack Said,

    I finished all installation steps, add gallery.php to “wp-content/themes”. However, I don’t understand “selected ‘Gallery’ as the template option”. I got stuck on the stage “created a page called Gallery with no content and selected ‘Gallery’ as the template option”. someone help me?

  23. Jack Said,

    after browsing the web and testing, I should add gallery.php to the activated theme directory “wp-content/themes/Premium_2_column_l16″, and I found the theme lists :)

  24. Jack Said,

    I modify id-coppermine-plugin.php like Adam said, and copy “css” “js” to plugins/id-coppermine.
    It seemed everything was done, but click the “Gallery” page, nothing happen. any idea ?

  25. m0gb0y74 Said,

    I’ve updated the instructions and added some images to hopefully make it clearer what you need to do.

Add A Comment

Subscribe to Infinite Dreamers