WordPress Coppermine Widget


My WordPress Coppermine plug-in is a widget that shows a number of thumbnails from a Coppermine web gallery in the sidebar of a WordPress blog. Moving the mouse over a thumbnail will display a pop-up of a larger version of the image together with the title and description from the gallery. The pop up will hide a short time after moving the mouse out of the image.


The WordPress plug-in supplies a widget that will display a configurable number of images, in a configurable grid, selected in a configurable way, from a Coppermine Gallery. When the pointer is placed over an image a larger version of the image will be displayed in a pop-up together with any title and description.

The plug-in supplies a settings page which allows the user to enter the Coppermine database details. The widget is a fully compliant WordPress widget and can be configured using a form on the widget’s appearance page.

On the appearance form you can choose to select how many images to display and the shape of grid in which to didsplay them. You can choose whether to select random, or the latest images, from either all of the images or a specific album. You can also enter the text to display as the widget title.


The plug-in is available from the WordPress site at:


Known Issues

The path for the JavaScript and Style Sheet documents is incorrect. This path is provided by wp-cpg-widget.php. The partial string “plugins/wp-cpg-plugin” should be replaced by “plugins/wp-cpg-widget”. This will be fixed ASAP as a point release.Fixed in 1.0.1

Error on activation: "Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in …/wp-content/plugins/wp-cpg-widget/cpg_database.php on line 39"Addressed in 1.0.2

Page not found error when saving database details from the WP Coppermine settings pageFixed in 1.0.2

Warnings from PHP when displaying management pages.Fixed in 1.0.2

The Future

It is intended to add tag support to the plug-in to extend the integration to the inclusion of images in posts and pages. These images will, optionally, also support the pop-up which could either show a larger version of the image or just any title and caption associated with the image. It is also proposed to add support for multiple galleries.


The are now web forums associated with this blog which include an area to discuss the WordPress Coppermine widget. These can be found here.

97 Responses to “WordPress Coppermine Widget”

  1. Jimmy Says:

    I would like to disable javascript plugin, as I do?

  2. Gotti Says:

    is it possible to use the plugin in a theme without widgets?

  3. Nicole Says:

    I have the same problem as Melanie, and I did not put index.php or any other file name in the form. I’m pretty sure I did it right. I think the problem is that it doesn’t work with 2.9.2.

  4. K Says:

    Hi cyberspice – I hope you still check these comments…

    Pete Kavanagh said that he was able to edit your code to remove the “normal_” prefix from being added to the images. Can you tell me how I can do the same? The pop-ups don’t work for me because nooe of my coppermine images have the “normal” prefix.

  5. malamute Says:

    i get a Cannot connect to database server.I have installed the plugin thru my wordpress plugins,set the mysql options properly

  6. malamute Says:

    I also deactivated and activated the plugin

  7. malamute Says:

    why were my messages removed? Very strange that is

  8. cyberspice Says:

    I moderate my blog. I get all sorts of spam otherwise. This means your posts go in to a queue so they aren’t published until I click the publish button.

  9. malamute Says:

    woops they wern’t,sorry.i couldn’t see them

  10. cyberspice Says:

    No worries

  11. Semmie Says:


    I love your plugin, but the popup is not working for me 🙁
    So when i go over the image, i can see the popup but the picture is not showing.

    Any idea why this could happen?

    my site: http://www.ultimate-omarion.org


  12. Talent Says:

    How can I get the script to popup/display the fullsize photo image instead of the thumbnail image from the coppermine gallery when users click or mouseover in the wordpress blog sidebar? Email your response to talent302003@yahoo.com


  13. Peter Eekhout Says:


    I have setup the plugin and there where no errors. But when I use the plug-in I get the following error:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘SYSTEM’@’localhost’ (using password: NO) in D:\wamp\www\wp-content\plugins\wp-cpg-widget\cpg_database.php on line 158

    But the setting WP coppermine does not give an error, only the widget.

    I use WP 2.9.2 and Coppermine 1.5.3.RC

    Thank you,

  14. Debbie Says:

    very nice plug in and looks like I can get it to work with coppermine … thank you ..

    again great plug in ..


  15. Chris Tedesco Says:

    I had been using your plugin for several months before my server crashed. I reloaded my site and now your plugin now only displays the image title and caption with no image when the mouse is hovered over the thumbnail. It will only display the “normal” intermediate images, but I do not use them with my coppermine gallery. I had never used intermediate images before,and everything used to work fine. I am on coppermine 1.4.26 and wordpress 2.92. Any help will be much appreciated.

  16. Helen Says:

    Love the plugin, but would love the option of displaying the latest images from a single category on the sidebar, seems like that’s the single missing feature!

  17. Frank Says:

    I would like to use the Coppermine Latest Gallery plugin but I cannot make it work. I have entered all database information as requested into the specified fields but there are no thumbnail images shown. Could you please help me out? Frank

  18. Matt Says:

    Were you ever able to get the plug-in functioning in a page, instead of in a Widget? I saw a few posts back that you were working on that.


  19. cyberspice Says:

    I’ve been very busy during the first half of this year. The plug-in really needs some TLC. So that’s next on my to do list.

  20. James Says:

    Hi, I’m building site slowly and have been recommended the WP Coppermine plugin, problem is, I’ve filled all the settings in and that seems to be fine, however when I try to drag the widget within WP I get a screen full of “Select images…” and I’m unable to, I’ve been messing round with it for a few hours and these settings look correct (any other combination gives a fail on the inital SQL check)

    any thoughts? ta


  21. Mike Stewart Says:

    Same issue as james.
    wp 3.0.1
    Whats the code for getting the widget on a page?

  22. Keith Says:

    Like some others I am getting the following on the wordpress page only-

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘xxxxxx’@’localhost’ (using password: NO) in /home1/xxxxx/public_html/iltt/wp-content/plugins/wp-cpg-widget/cpg_database.php on line 158
    Cannot connect to database server! –

    I have input the password in the settings section and everything took fine

    Any suggestions?

  23. Jess Says:

    I tried setting up this plugin and when I entered my database credentials, I got the following message:

    Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111 in /home/www/xxxxx/html/english/wp-content/plugins/wp-cpg-widget/wp-cpg-plugin.php on line 188
    Failed to connect to database server!

    This probably means that the server name or user name or password are incorrect! The server returned the error displayed below:

    how do I fix this? the database details I entered, are all correct.

  24. cyberspice Says:

    I will have a look at this issue this week. Can you tell me which version of WordPress and which version of MySQL you are using please. Are you able to get shell access to your server. I may have to ask you to try some things.

  25. Nimish Says:

    Guys, having the same error as Michael F and James. When I try to drag the WP Coppermine widget, the screen gets filled with “select images…select images… and so on” . I have upgraded coppermine to 1.58 from 1.42 and the WP is 3.0.1
    Thanks, Nim

  26. Nimish Says:

    ok an update. the “select images…” error when dragging the widget to the sidebar does not occur on Firefox. I had upgraded my IE to 9 and due to some issues had to pull it back to 8, since then IE 8 has been a bit buggy running javascripts specifically… could be due to this. However, the Database settings are not getting updated in the database for some reason even using Firefox??? any clues?

  27. cyberspice Says:

    I’m going to try and reproduce some of these issues this weekend and see if I can get to the bottom of them. At the moment I haven’t a clue why its broken.

  28. ThomasT Says:

    Hi Cyberspice,

    I’ve got the same problem as Sminel.

    Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in /mnt/sites/web/daniel/wordpress/wp-content/plugins/wp-cpg-widget/cpg_database.php on line 158

    I’m using WP3.01 and CP1.4.27 and Firefox3.6.11 . Anyone any idea what could be wrong? Otherwise WP works just fine. I database settings should be right, I took them from the corresponding CP file.

    Cheers, Tom

  29. ThomasT Says:

    Hi Cyberspice,

    I just noticed that although I enter all DB info on the settings page and save, then I add the widget to the sidebar, all info is gone when I go back to the settings page. All fields are empty as if I’d never entered anything.

    Even if I type in all the data, click save, then click on the settings page again, all data is gone and I’m presented with an empty form. I guess this would explain why the widget is unable to connect to the DB cause somehow the data is not stored.

    Where/how do you store this information? Do I need to adjust directory rwx settings somewhere?

    Hope this helps a bit, Tom

  30. cyberspice Says:

    That’s actually really useful. May be somethings changed in 3.01 which affects how that works. And because my system has already stored the data I can’t reproduce the problem. I’m going to set up a test server and try this from scratch.

    Thank you.

  31. Pierre Demeure Says:

    Thanks for this good plugin. It works fine for me, in a WP 3.01
    I noticed that many questions raises about the database server.
    Perhaps that ones who encounter problems could try to do like me : as database server, I simply entered “localhost” …
    The only thing that don’t seems to work on the WP 3.01 is the popup window when mouse is over a picture…

  32. Darryl Says:

    Hey, I tried to use the widget, and its saying Select Images….Selcet Images over and over again. I am using WordPress 3.0.3 and Coppermine 15x

  33. Stef Says:

    I’m trying to activate the Coppermine Plugin for WordPress. So I can have the latest pictures from the gallery up in my wordpress posts. Now for activation they ask me to give the following information:

    Gallery URL
    Database server (The domain name for the Coppermine database server.)
    Database name
    The user name
    The password
    The table prefix

    Now when I fill this all in I get the following message: You do not have sufficient permissions to access this page.
    Although I’m almost sure i filled in the right information.

    Wondering if you can help


  34. Jo Says:

    Are you still continuing to upgrade/develop this plugin? Or does anyone know any other similar working plugin?

  35. Filipe Says:

    Hi there,
    Thanks for the great plugin!
    I just would like to know if there is any way to resize the thumbnail pictures shown on layout without resizing the gallery thumbnails.
    Thanks for you time and I hope you can help me.

  36. Filipe Says:

    Hi again,
    Just fixed it! 🙂
    If anyone wants to know just add on wp-cpg-plugin.css file after this code
    “.wp-cpg-widget img {
    border: 0;”

    the following data:
    “width: ???px;
    height: ???px;”

    by replacing ??? by the real size and removing quotes.


  37. Jack Deth Says:

    I wanted a plugin that would allow me to display all the photos from my Coppermine gallery on a gallery page, not just in the sidebar.

    I tried ID Coppermine Plugin but it’s too buggy. So I thought I’d give this a shot.

    Luckly, I use the Suffusion theme which allows me to add your plugin to an “Ad Hoc Widget Sidebar”. From there, I can embed a code pertaining to the sidebar item into the main page. Then it all appears in the main page instead.

    However, your plugin will only allow me to pick ALL or just one album at a time. When choosing ALL, it also pulls pictures from any private, password protected folders for clients. I don’t want that. I want it to just pull from my public albums. Can you modify this to allow us to select multiple albums? And maybe add navigational buttons to go to the next page of pics, etc?

    One more thing. You are supposed to be able to hover over and image and see a larger version pop up. It didn’t work. I get a tiny little gray box, but nothing in it.


  38. Jack Deth Says:

    I tried the link to you support forum. There’s nothing there but thousands of spam posts for porn. 🙁

  39. Carl D Says:

    Hey cyberspace

    Very cool – I’d love to add this to my site .. but I have widgets disabled. You may have answered this elsewhere and I missed; if so, forgive me .. but is this useable without widgets?




  40. lia Says:

    Awesome plugin. Thanks alot.

    How do I disable the popup? thanks

  41. kakashi Says:


    i like the plugin but it wont let me show random photos.
    latest photos work but not the ramdom option

    is there a fix for that?

    thx, rob van der zwet AKA kakashi

  42. kakashi Says:

    nvm it works

  43. Stella Says:

    Hi! I love this widget! However, it is not working very well on my website right now. The thumbnails look wonky (go to the homepage and see the widget at work in the sidebar) and hovering over the thumbnail no longer displays a larger image. Are you considering updating this widget? I sure hope so! Let me know if I can help in any way.

    Best. Stella
    Byrneholics Online

Leave a Reply