Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips

Coppermine badge plugin for WordPress




Coppermine WP Plugin

This plugin 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 directory

3 ) Activate the plugin

4 ) In your side bar enter: <?php echo coppermine_gallery() ?>

OR

4 ) Enter : <– copperminegallery –> in your template or in the code section of a post or page.

It is set up to display 5 thumbnails vertically. To change the number of images change the number at the end of this line:

$query = “select filepath, filename, ctime from cpg_pictures order by ctime desc limit 5;”;

If you want a horizontal list remove the

<br> from this line:
echo “\n<br><img src=\”$url/$directory/albums/$path” . “thumb_$name\”>”;

(Widget version of Coppermine Badge)

  •      
  •      
  •      
  •      

  •      
  •      
  •      

21 Responses to 'Coppermine badge plugin for WordPress'

Subscribe to comments with RSS or TrackBack to 'Coppermine badge plugin for WordPress'.

  1. Love the plugin! I have added to to both of my blotsites and it works wonderfully. Thanks for the work. Go Gurrrrl power!

    luv_hikin

    3 Jan 08 at 6:27 pm

  2. lol – Thanks very much!

    admin

    3 Jan 08 at 7:09 pm

  3. I updated the plugin today. ( same download file )

    This fixes some name space clashes and allows you to adjust the Coppermine table prefix. The default prefix is different in Coppermine 1.4 than previous versions.

    admin

    19 Mar 08 at 7:58 am

  4. I clicked on the link at the top of this blog today to download it…but I got a picture of a pier that I was told to walk down…I guess a 404 page.

    “You took a long walk on a short directory. “

    AndrewRH

    25 Mar 08 at 4:12 pm

  5. Thanks – the link is all fixed now.

    herself

    25 Mar 08 at 7:36 pm

  6. very cool. I can’t figure out how to get them to link to my photo galleries instead of my main page though.

    Basically, I want the photo album on the sidebar on http://insider.nwjpb.org to link to http://www.nwjpb.org/photos. I put the main domain in the config file, but it doesn’t work if I change it to something else.

    I also did this on http://www.washingtonpipers.org.

    Love it! Thanks.

    Todd Schiele

    18 Apr 08 at 5:48 pm

  7. Way cool, I love pipes.

    Let me look and see — give me a few minutes

    ljmacphee

    18 Apr 08 at 5:59 pm

  8. Change line #51 in coppermine_gallery
    From:
    $link .= “\n>tr<>td<>a href=\”$url/$coppermine_directory/\”>”;

    $link .= “\n>tr<>td<>a href=\”$url/$coppermine_directory/photos\/\”>”;

    ljmacphee

    18 Apr 08 at 6:04 pm

  9. You rock! Supporting people in software outside yours. Thanks a lot. My proxy just went down, but I’ll check that out tonight!

    Check out NWJPB’s MySpace for video & audio. http://www.myspace.com/nwjpb. Surprising what 7 to 18 year olds can do with good instruction and support. :)

    Todd Schiele

    18 Apr 08 at 6:27 pm

  10. You’re sweet, but it is my plugin I’m having you change a line inside.

    But I’ll be glad to help with any open source stuff when I can.

    ljmacphee

    18 Apr 08 at 9:29 pm

  11. Oh, and thanks for the link to the local pipe band.

    ljmacphee

    18 Apr 08 at 9:29 pm

  12. * One of my Coppermine sites had an attempted attack on it last week. Lots of talk on the Coppermine Forums about this.

    The MySQL server I’m using didn’t have that flaw that would allow the exploit but I found extra files ( *.zip ) on my site that I had not put there.

    Strongly urge you all to upgrade to newest 4.18 which fixes the security hole. The upgrade was totally painless.

    Coppermine exploit info, new version and upgrade info

    ljmacphee

    19 Apr 08 at 9:00 am

  13. Also you should consider add the Bad Behavior Coppermine Plugin to your Coppermine install.

    It stops a dozen or more attempted hacks each and every day.

    ljmacphee

    2 Jun 08 at 3:15 pm

  14. Hi,

    Firstly thanks for your great contribution to the WP community. I am relatively new to WP although I have been blogging since early 2005. I currently use several of your plugins.

    My question…

    The Coppermine Badge is working like a dream – I use it to display multiple single instances of one randomly selected photo from my online album. I would dearly like to display a border or frame around the photo.

    Any tips?

    My blog address is: http://www.trupela.com/blog

    Regards,

    R

    Robert@PNG

    10 Jul 08 at 11:37 pm

  15. You should just be able to change

    to
    or pick some number.

    The $link .= is just straight html.
    .= means add this text to end of existing text.

    Or see line where it says print $link;

    Add print “your_html_code”;
    before and after that line for html you want to print before and after the coppermine table.

    Just print then put ” around your html and a semi colon at the end.

    ljmacphee

    11 Jul 08 at 4:34 pm

  16. Hi,

    Thanks for your prompt response and feedback.

    I changed line in coppermine_gallery.php as follows:

    $link .= ““;

    And it made no difference at all – photo still displaying without a border – I set it to 1000 justo see if it would make any difference. I’m probably aiming for a border of 3 or 5.

    FYI…
    I have inserted: into a Samsarin PHP Widget on one of my sidebars.

    Any assistance would be greatly appreciated.

    R

    Robert@PNG

    11 Jul 08 at 9:51 pm

  17. Sorry,

    The line above did not appear in comments – is as follows:

    “$link .= ““;”

    R

    Robert@PNG

    11 Jul 08 at 9:54 pm

  18. Sorry again,

    How do I display a line of code I want to show you in the comment field?

    R

    Robert@PNG

    11 Jul 08 at 9:55 pm

  19. Sorry – been a long day here. I was in line for an iPhone all day and power was out a few hours at dinner time.

    Can you email me the code?

    Also see http://timestocome.com/wordpress2 and see the coppermine badge in the bottom right sidebar. Is that what you are looking for?

    Let me know will look at it over the weekend.

    ljmacphee

    11 Jul 08 at 10:01 pm

  20. Hi Linda,

    Just sent you an email with requested info.

    R

    Robert@PNG

    11 Jul 08 at 11:11 pm

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

    ljmacphee

    6 Aug 08 at 1:13 pm

Leave a Reply

You must be logged in to post a comment.