Rue Plumet

But remember this, my brother. See in this some higher plan.


February 15, 2006

CoppermineSC and Coppermine 1.4.x

Filed under: Plugins — Brad @ 9:10 pm

UPDATE: Version 0.4.6 has been released. Please see this entry or my CoppermineSC page for the latest information.

Now that I have all of my Coppermine galleries converted to the new 1.4.3 release, I can safely say that the CoppermineSC plugin should work properly without any changes. The most recent 0.4.3 version of the plugin (originally released for WordPress 1.5.x and Coppermine 1.3.x) also works just fine with WordPress 2.0.1. If you have any problems with the plugin under the new versions of WordPress or Coppermine, please feel free to post a description of your issue in the comments.

Please also note that I still intend to release an updated version of the plugin incorporating various requests I have received from users. However, until that release comes, the current version should work just fine.

27 Comments »

  1. Prueba de coppermine…

    El Tlahuicole desde Ocotelulco.

    Qué es Coppermine?

    Coppermine es una galería de imágenes multiproósito, con muchas características integrada a la web, escrita en PHP. Usa GD o ImageMagick como librería de imágenes y MySQL como base de datos….

    Trackback by Yo, Toledano — March 2, 2006 @ 12:56 pm

  2. I just downloaded & installed Coppermine 1.4.6 and was wondering if you knew if the latest version of your plug-in was compatible with that? I have been trying to use your plug-in on this site (http://umhsmusic.org/blog/) and it appears to not be working. I am also not sure what prefix I should be using for the CPGSC_TABLE_PREFIX line. If it makes any difference at all, the folder where my Coppermine Gallery is in is a folder called gallery. Any help would be greatly appreciated!

    Comment by Cristina — June 8, 2006 @ 12:16 pm

  3. Cristina,
    The setting for the table prefix can make a big difference in whether or not the plugin works. I’m currently running Coppermine 1.4.8 (the latest release) and version 0.4.6 of the CoppermineSC plugin still works just fine (and has worked all along with all of the 1.4.x releases of Coppermine). If things are not working for you, I bet it is the table prefix setting that is causing the problem. To find the table prefix setting for Coppermine, just go to the “include” folder in your Coppermine installation and view the config.inc.php file. There will be entries in there for your database connection settings, and also for the table prefix. Just copy the table prefix value into the CoppermineSC script and you should be all set. If that doesn’t work, just post back here and let me know and we’ll move forward from that point, but I think there is a good chance that it is the table prefix setting that is causing your issues.

    Comment by Brad — June 9, 2006 @ 9:31 pm

  4. First off thanks so much for answering my comment. It’s rare I get answers to questions I have on plug-ins. Anyways, taking what you said, I went into the file you directed me to and found my table prefix was cpg146_. Went back into the plug-in file and inserted it into the script. Now on my page, I wanted it to show the three random thumbnail pictures for my gallery so I inserted this into my sidebar page:

    Saved the file, activated the plug-in and as a result, all that came up on the page was cpg_galrand:4. Was I supposed to insert the prefix with the tags as well? Thanks for the help. :-)

    Comment by Cristina — June 15, 2006 @ 9:32 pm

  5. Awesome plugin. Thank you.

    Question: Is there a way to exclude .mpg files from the random files lists? I have a bunch of .mpg files in my Coppermine galleries and when they pop up through your plugin, they show as a blank space (with my CSS border around it).

    Comment by Brian — June 27, 2006 @ 4:57 pm

  6. Hi again. I answered my question from June 27. I added the following to every query: and pwidth0 and pheight0
    On looking in the database, Movies have a value of zero for these fields. So far so good.

    Comment by Brian — June 29, 2006 @ 1:31 pm

  7. Hi,

    Thanks for this wondeful plugin. I’ve tried several ones but they were too difficult, too many options or not working…
    I installed yours, changed two lines and… off we go.
    The only thind that would be nice (or did I overlook it?) is just a plain list with the album names (with or without a pic) so that I can integrate this in my site instead of typing al the album names.
    Keep the good work going!

    Comment by Rudy Engels — July 3, 2006 @ 11:32 am

  8. Great plugin. It works fine for me with WP 2 and Coppermine 1.4.8 when putting tags in a post.

    However, I am trying to use it within the sidebar like this:

    But I get only blank space… any ideas?

    Thanks!

    Comment by Matt — July 14, 2006 @ 10:56 pm

  9. Ah, I figured out the problem. I was trying to run php code in the text block and apparently that doesn’t work.

    Forgot to mention I was also using the widgets plugin from http://automattic.com/code/widgets/

    So I used a modified text widget from http://ottodestruct.com/blog/2006/04/09/fun-with-widgets/ that allows php to run.

    So now I have coppermineSC showing the most recent images in my WP sidebar just like I wanted. Took me two hours to get the CSS right but that’s OK ;-)

    Thanks again for the coppermineCS plugin!
    Matt.

    Comment by Matt — July 15, 2006 @ 11:52 pm

  10. Hey -

    Great plugin! Was having a bit of trouble connecting it into my coppermine MYSQL tho - it keeps saying it can’t connect. I’m using “localhost” as my DBserver, would this be a problem?

    Comment by Earl Newton — August 19, 2006 @ 11:02 am

  11. Okay I’m a dork - fixed it myself.

    Allow me to double-up on the compliments for this plugin, it’s terrific!!!

    Earl

    Comment by Earl Newton — August 19, 2006 @ 11:09 am

  12. Hi, thanks for putting in so much work with this plugin. I got it to work on my site fairly quickly. But only most most images. Some have a ‘#’ hash-mark in the file (meaning “number” something) and the img src URL that is generated will not work, because the # is left in the name.
    I am at a loss where to put in the code that replaces # with %23 in the URL.

    Cheers

    Comment by Fred — August 26, 2006 @ 6:26 pm

  13. Hi Fred,
    I had the same problems with ‘#’ hash-marks and umlauts in file names. I tried to add these characters to the forbidden characters configuration, but it still failed. So I hacked the coppermine code as follows:

    locate the folder /include
    open the file ‘functions.inc.php’
    look for this line in the function replace_forbidden() :

    [code]$return = str_replace($forbidden_chars[0], ‘_’, $str);[/code]

    then add the following code immediately after that line:
    [code]
    $return = str_replace(’#', ‘_’, $return);
    $return = str_replace(’ä’, ‘ae’, $return);
    $return = str_replace(’Ä’, ‘Ae’, $return);
    $return = str_replace(’ö’, ‘oe’, $return);
    $return = str_replace(’Ö’, ‘Oe’, $return);
    $return = str_replace(’ü’, ‘ue’, $return);
    $return = str_replace(’Ü’, ‘Ue’, $return);
    $return = str_replace(’ß’, ’ss’, $return);
    [/code]

    That fixed the problem for all new uploads. For older ones I went into the actual database tables using phpMyAdmin and replaced the bad characters.
    If coppermine would get the character encodings right, we wouldn’t have these problems….

    Comment by Fred — September 8, 2006 @ 5:03 pm

  14. Hi. I’m having problems with my photos. I’ve changed the table prefix and all that. But still unable to get them link. I check my database, but there’s no problem. Keep on stating that file does not exist?

    Another thing I would like to ask is that, how will I the Album ID? Thanks in advance.

    Comment by Alex — October 10, 2006 @ 12:05 pm

  15. Argh.. Sorry. My bad. I forgotten the file names were case sensitive.. No wonder it wasn’t able to to obtain the file.. Great plugin. Thanks!

    Comment by Alex — October 10, 2006 @ 12:12 pm

  16. I’ve installed the plugin, but when I try to add a picture, I only get the text “[cpg_imagefixthumb:1742]” instead of the picture, what am I doing wrong?

    Comment by Hanna — November 9, 2006 @ 6:34 pm

  17. Turns out CSS support was also there :) Just totally blind. I hacked away at the function I needed to get LightBox working and well, IT WORKS :) So ignore my three posts in terms of requests; just remember the praise. All things considered, the hacks to get LS working nicely were not all that dramatic because of the very nice structure of your plug-in. So thanks again!

    Comment by Thomas — November 12, 2006 @ 1:32 am

  18. Hi,

    thanks for this nice plugin. I just have a problem with normalsized pictures. When using [cpg_albumrandnormalsize:] I always end up with the thumbnail image eg filename thumb_xxx.jpg.

    The define (’CPGSC_NORMAL_PREFIX’, ‘normal_’) is set.

    What am I doing wrong?

    Comment by Jesper Krogh Christensen — November 14, 2006 @ 2:59 pm

  19. 1. Why is it impossible to open the configuration page in my browser (IE or FireFox) ? How test the connection ?

    2. I enter the settings of the database connection with Dreamweaver, but it is impossible to open database with that plugin.

    Error establishing a database connection

    This either means that the username and password information in your CoppermineSC plugin file is incorrect or we can’t contact the database server at ….. This could mean your host’s database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?

    Comment by nyctale — December 19, 2006 @ 10:36 pm

  20. I am using 2.1 and it does not seem to work. It automatcily inserted a link in my first post and them told me that it coudl not log in. Any ideas?

    Comment by Richard Brown — February 18, 2007 @ 4:50 pm

  21. cpg - wp 2.1 integration return optional header (as param).

    look at:
    http://coppermine-gallery.net/forum/index.php?topic=41206.0

    for full text of my issue. basically, I want to rework the calls from SC to include an optional parameter such as a url so that it would be returned as the url that a user would have if they clicked on the image, instead of CPG. It seems that if you are reading a post that displays an image in WP, clicking on that image should give you a url that the poster or site admin designates, not necessarily CPG. CPG is OK as a DB front end for images, but most of my blog users have little interest in CPG.

    I noticed some previous poster had the same issue. It may be that I will write my own php routines to display images from the cpg DB. Easier than changing either SC or CPG. -s

    Comment by seanyoore — February 20, 2007 @ 5:57 pm

  22. Great CPG plugin. It would be nice if you could use the pos attribute (album=173&pos=3) or something like that instead of the image name. Other than that, it’s wonderful!

    Comment by Erik Jacobs — May 11, 2007 @ 11:48 pm

  23. Hello, i just downloaden and installed the plugin using WP2.2 and CPG143. After activating the plugin and returning to the frontpage of WP and get an error. It seems that the plugin can connect on de DB_server but can’t find the DB itself. Names checked etc but everything is ok on that part.

    Any ideas how to fix this problem?

    Thanks.

    Comment by Sjoerd — June 14, 2007 @ 8:51 am

  24. Ok, this Plugin does not work with the latest Coppermine 1.4.11.

    But it seems to work fine with Coppermine 1.4.8 and wordpress 2.2.1

    thanks for this great plugin

    Comment by tomy — July 1, 2007 @ 9:26 pm

  25. Just an update; I found the issue. When mysql_connect() is called more than once with the same host, user, and password then the connection becomes shared. Wordpress makes the DB connection once and then your plugin makes the connection again. In my case it’s to the same host, user, and password so now Wordpress is trying to connect to my Coppermine database and fails. The solution is to change one line of your code (line 1093) as follows: $this->cpgscdbh = @mysql_connect($dbhost, $dbuser, $dbpassword, TRUE); This tells php to create a separate connection and will allow Wordpress to utilize it’s existing connection to its database and CoppermineSC to utilize the connection to the Coppermine DB without clobbering WP’s connection. This won’t happen to everyone but I don’t see the harm in changing your code because the worst that happens is you create one additional mysql connection. Here’s more info: http://us2.php.net/manual/en/function.mysql-connect.php. Hope this helps you and others who use your awesome plugin!

    Comment by Brian — March 27, 2008 @ 2:16 pm

  26. Great plugin! I’ve been using it for some time now, but more recently as I’m in Sydney, Australia for research collaboration and I’ve been using my website to share my experience with friends back home. I noticed an issue when using the tag to post individual images ([cpg_imagenormal:2,myimage.jpg] or cpg_imagethumb). The images will show up in the post correctly, however they only link to the album they were originally from, not the actual picture that the thumbnail represents. It works just fine for posting random images from an album. How can this be fixed? I’m not too familiar with PHP and don’t have alot of time to go over the code.. I’m guessing it’s a simple edit, and I will try to look it over later tonight..

    Thanks in advance for any help..

    Comment by Medix — June 15, 2008 @ 10:45 pm

  27. Scratch my last post..

    Turns out I’m an idiot and didn’t see that my particular problem was easily solved by a slight change to the configuration (just uncomment one line). Works perfectly!

    Thanks again.

    Comment by Medix — June 16, 2008 @ 10:12 pm

RSS feed for comments on this post. | TrackBack URI

Leave a comment