Coppermine Badge Widget for WP

* Note: Coppermine table names changed in 1.4, so download the proper version for the Coppermine you are running on your website.

Download for Coppermine Widget for Coppermine

This widget creates a Flickr like badge from your Coppermine Gallery. ( See my personal blog bottom right sidebar for a demonstration. )

1 ) First edit the wp_coppermine.php file. You need to enter the hostname, login, database name, and password for the Coppermine database.

If you do not know this information then ftp to your website, cd into your coppermine directory, cd to the includes directory and download config.inc.php. All this information is in there.

Then if your Coppermine is not installed in /coppermine change this to be what ever directory you installed Coppermine into. Lastly enter the url of your website.

2 ) Upload the coppermine_badge folder to your plugin/widgets directory ** widgets MUST be in this directory to work **

3 ) Activate the plugin

4 ) Go to Presentation->Widgets and add the widget to your sidebar and set your preferences.

40 Comments

  • admin

    I updated the widget so you can adjust the table prefix. The widget has the default prefix for Coppermine 1.4 or Coppermine prior to 1.4 depending on which version you download.

  • AndrewRH

    I didn’t see where you change the table prefix. I ended up editing (version 1.1) of “ttc_coppermine_badge_widget.php”. I searched for “14x” and changed it to “149″ (I originally started using coppermine at version 1.4.9, and that is the table prefix it defaulted to).

  • AndrewRH

    Is there anyway to make the widget go to the specific picture in coppermine, instead of the base URL of the coppermine gallery?

  • AndrewRH

    How do I get the list of coppermine categories / albums like on your page?

  • herself

    It is in the file where you put your user name, password etc. You’ll see a line at bottom for the table prefix. If you don’t see that line - download the plugin again. I fixed this just last week.

  • herself

    No - Coppermine is supposed to fix it in the next version so you can link directly to photos. Right now Coppermine changes the order of the photos every time you upload a photo so the link is always changing.

    Many people have been bugging Coppermine to fix this. It was done to make Coppermine faster.

    I think, but am not sure, it may be possible to make it go to a specific album. I will investigate that when I get a chance.

  • herself

    Back, now.

    In Coppermine you have albums and categories. If you are looking at the photos on my personal blog you are seeing categories on front page, not albums.

    On the houseplants album I don’t have categories, just albums. Albums display with thumbnails -categories do not but I think you can change those settings?

    In ‘admin mode’ go to Config->album list view and you can change how deep and what shows on each page.

  • travelerinside.com

    Hi, I am trying to get the plugin to work but i get this error:

    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/travele5/public_html/wp-content/plugins/coppermine-widget-1.4/ttc_coppermine_badge_widget.php on line 70

    What am i doing wrong here? I’m a newbe at this so i might be entering password or something else wrong…

    Thank you for any help

  • AndrewRH

    Hi again,

    Downloaded the widget for cpg 1.4 just now from top of this page; but it doesn’t have anything changed in it - i.e. the table prefix entry isn’t in the wp_coppermine.php file.
    ~Andrew~

  • AndrewRH

    Hi again, again,

    I set the widget to just show 1 photo. However, the frame around it includes whitespace at the top. Can you make the frame snap to the photo all the way around?
    ~Andrew~
    see it on my site: http://www.Reeves-Hall.net

  • ljmacphee

    Hi Traveler,

    That means nothing was returned from the Coppermine db - double check your username, password, host, table prefix. Table prefix is most likely.

  • ljmacphee

    Hi Andrew,

    Ok, fixed - download new or just check your mail - will email you copy as well.

  • travelerinside.com

    What is “table prefix’?

  • travelerinside.com

    This is a new error:

    Warning: mysql_connect() [function.mysql-connect]: Host ‘box413.bluehost.com’ is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’ in /home/travele5/public_html/wp-content/plugins/coppermine-widget-1.4/ttc_coppermine_badge_widget.php on line 40
    Can not connect to server

  • ljmacphee

    The table prefix information is in the Coppermine login file ( coppermine/include/config.inc.php ) along with user name and other database information.

    That is the same error - something in your file user-name, password, or table prefix is not correct.

  • travelerinside.com

    Hi ljmacphee,

    I think i’m really lost here, i tried doing the above info but i can’t seem to get it to work without a error coming up. Is their a way i can email you and have you set it up on my site…?If not now worries. thanks for your help.

  • travelerinside.com

    Oee i just figured it out. Thanks again.

  • ljmacphee

    Sry - I was out buying a car today. Here in the USA that’s about as much fun as a root canal.

    Will help you - tomorrow or Monday as time allows. I’ll send an email.

  • travelerinside.com

    Hi,

    When you click on my gallery photos on my site you are forwarded to the coppermine theme. How do i get it like your site as it looks like coppermine is within your webpage, not brought to new page with different them like i have. My site: http://www.travelerinside.com

    Thank You

  • ljmacphee

    I converted the WP theme I’m using on this site to work with Coppermine.

    Cutline for Coppermine.

    How are you with CSS?

    There is a link on that page with instructions on how tp convert themes. Your theme looks nice and simple - it should convert easily.

  • travelerinside.com

    Well not sure with css, i’ll try to give it a read. thank you for your help.

  • ljmacphee

    I was going to try to see which theme you are using and download a copy but the nameserver for your site must be down.

    Can you send a copy to the original theme ? If I get a chance I’ll see what I can do. Some are easy some aren’t to convert.

  • travelerinside.com

    Hi,

    The coppermine part of my site is working. you can click on the Gallery link or the badge widget. The coppermin theme i have on is “project vii”. For some reason the widget is not pulling my pictures.

    The theme to my site is:

    http://themes.wordpress.net/?s=Blue+Box+0.1+by+Bob

  • ljmacphee

    Thanks, it’ll probably be the weekend before I have a chance to mess with it. Let me see what I can do then.

    Coppermine needs better themes and I’ve no gift for art so converting WP themes is a way to add in new ones.

  • ljmacphee

    Coppermine Blue-box Theme

  • ljmacphee

    There is another MySQL Injection flaw in Coppermine if you are not at v.1.4.19 Upgrade!

  • nemoprincess

    Hello,
    thank you for your job, but how can I insert pictures in a page?without using widget?
    Thanks

  • ljmacphee

    Sorry, Houston got hit by a hurricane and electricity and internet are scarce.

    Yes, you can put them in a page. I can’t give all the details till I get home to my regular working computer.

    But you can grab the php code out of the widget and put it into a page. You must make a template and then create a page w/ the template that has the php code.

    I’m not sure which directory you need to put the other file in the with the database info.

    If you are comfortable with php go ahead and try.

    If not remind me in a week and I’ll play around with it when we get power, net and return home.

  • nemoprincess

    Hi, thanks for the answer. I ‘ m sorry for the hurricane, but I’ m not very good with php code, so I can’ t insert picture in a page or post. Can you help me please?
    Thanks a lot

  • ljmacphee

    I can, but it’ll be a couple of weeks.

    We’re in SanAntonio there is not much electricity or net access from the hurricane.

    I’ll be home soon but next week is a zoo. It’ll be late next week, or sometime the week after before I have time to play around with it.

  • ljmacphee

    I posted directions here:
    How to add Coppermine photos to any WordPress page

  • nemoprincess

    Thank you very much!
    I’ ll try it!

  • lapdog1971

    Non-Profit web site when using the widget/plugin the widget area where the photos are displayed extends into the widget box below it, i hate asking for help but… i know it’s in code because when you look at the source of the webpage the coppermin badge does not have the ending “” like all the other widgets someone please look teamrandy.com thanks

  • ljmacphee

    Hi, I looked at TeamRandy in Firefox and Safari and it looked ok.

    Did you fix it or should I have a more serious look tomorrow when I’m more awake?

  • lapdog1971

    LOL when youre awake right side bottom of sidebar see how the photo, Meta(site admin), and spam blocked are over lapping and the graphic is shifted to the right, I though i had it figured out, it’s in the codding of the photo widget or it’s in the code the widget calls to create the individual box for the photo widget for some reason it doesn’t seem to be completing the code to make the box and just continues on to what box is below it, there is also a missing div command if you look at the page source code. phew

  • ljmacphee

    Do this ( depending on your browser ) view->source and you can see the code output to the browser.

    It looks like there should be one more closing div tag at the end of the coppermine widget.

    I don’t have Coppermine currently set up on a site to test but adding
    echo “</div>”;

    at line 93 or 94 just above //clean up mysql_close(); should fix it.

    in file ttc_coppermine_badge_widget.php

  • lapdog1971

    Inserting the echo crashed the whole website changing the lines to this $link .= ““; added div here
    //end badge output

    //now print badge output to webpage
    echo ” $link”; removed br here added to much space between widgets… it fixed it for the christmas theme but see what it does to all the other themes including the default wordpress theme

  • lapdog1971

    sorry the post edited out the changes i’ll post them to my website so you can see..

  • lapdog1971

    sorry the post edited out the changes i’ll post them to my website so you can see..I temporarily changed my theme to the default wordpress one to show what happends to other themes after the change i/we made it’s really bad in ie but not that bad in firefox.

  • ljmacphee

    Looking at it now, there is a missing close </li> between the end of the Coppermine badge and the start of the next widget in the current theme.

    ( Yes, it’s a pain putting css or html in to a comment )

    I’m sorry, but I just don’t have Coppermine set up anymore on any of my sites to test things and redo them.

    One of the websites got hacked from a Coppermine security flaw. Coppermine has fixed it, but then they had another one shortly after and I just decided it was too much of a risk. Pity I loved the software.

You must be logged in to post a comment.