How to Install CpmFetch

Please note that Cherry Gem Design is not the creator of CpmFetch and is not responsible for any problem due to CpmFetch that may occur on your site. Cherry Gem Design simply offers a tutorial to help you install it. This tutorial has been tested on several sites. Please do not redistribute.

  • How to Install CpmFetch – Step 01

-> What is CpmFetch? Follow THIS LINK to know everything about this PHP object.

First, you need to download the package.

The best download source at the moment is forum.coppermine-gallery.net. Link: * copperminefetch-2.0.1.zip

  • How to Install CpmFetch – Step 02

After, you will need to unpack the file you have downloaded (with a software like winRAR).

The extracted directory will look similar to this:

/cpmfetch
/docs
COPYING
README
releasenote_2.0.0

The “cpmfetch” directory is the only part that you are required to install on your site. Please, re-pack the “cpmfetch” directory into a .zip file.

  • How to Install CpmFetch – Step 03

Connect to your FTP or Cpanel and go at the root of your Coppermine folder.

Upload your cpmfetch.zip file at the root of your Coppermine folder and unpack it.

All the files must be found now under a cpmfetch folder.

  • How to Install CpmFetch – Step 04

Before launching the installation of CpmFetch, you will need to follow these steps.

  1. Make the ./cpmfetch/cpmfetch_config.php file writeable by the web server.*
  2. Make the ./cpmfetch/tmp folderwriteable by the web server.*
  3. Make the ./cpmfetch/tmp/feed.xml writeable by the web server.*
  4. Make the ./cpmfetch/install.php writeable by the web server.*

*writeable by the web server: Do to this, you need to change the permissions of the file/folder by right-clicking on it and select “Change Permissions” from the list. This will bring up the “Change Permissions” window. Then, you just need to adjust the settings to 755.

  • How to Install CpmFetch – Step 05

Now, we are going to install the program.

To run the installer program, connect to it with your web browser at: http://www.yourdomain.com/yourcopperminefoldername/cpmfetch/install.php

If it’s working, when it finishes it will show you some photos from your gallery. It will also show you a code that you will be inserting into your pages.

Example code:

<?php include "./portfolio/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./portfolio/cpmfetch/cpmfetch_config.php"); 
$objCpm->cpm_viewLastAddedMedia(3,8); 
$objCpm->cpm_close();
?>

Congratulations! You’ve installed and configured CpmFetch and are ready to use it!

IMPORTANT: You can use the example code below, but be sure to update the link.
If your gallery can be found at yoursitename.com/gallery, please update the “./portfolio/cpmfetch/cpmfetch.php” to “./gallery/cpmfetch/cpmfetch.php”.

  • How to Install CpmFetch – Step 06

You can now add the latest images of your Gallery into your WordPress site!

  1. If you want to latest images to appear under your header, and you’re not into html/code, you can ask me to design a special theme (like this).
  2. Maybe easier, you can also add your latest images in your sidebars. You just need to download and install PHP Code Widget plugin. Then it’s very simple, you can add it as a normal widget and just paste the CpmFetch code.
  • Customize your CpmFetch code

About the CpmFetch code, If you want to customize it:

<?php include "./portfolio/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./portfolio/cpmfetch/cpmfetch_config.php"); 
$objCpm->cpm_viewLastAddedMedia(3,8); 
$objCpm->cpm_close();
?>

Change the number of images per rows, per columns with the third line.

$objCpm->cpm_viewLastAddedMedia(3,8);

3: Is for the number of rows.
8: Is for the number of columns.

If you want a total of 16 pictures shown in 4 rows of 4 colums, then you want:

$objCpm->cpm_viewLastAddedMedia(4,4);

And your final CpmFetch code will be:

<?php include "./portfolio/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./portfolio/cpmfetch/cpmfetch_config.php"); 
$objCpm->cpm_viewLastAddedMedia(4,4); 
$objCpm->cpm_close();
?>
Important Note

To work, your Coppermine folder must been in the same folder as your WordPress folder. Let me explain:

WORKING:

WordPress installed at: yourfansitename.com
Coppermine installed at: yourfansitename.com/gallery

OR

WordPress installed at: yourfansite.com/main
Coppermine installed at: yourfansite.com/main/gallery

NOT WORKING:

WordPress installed at: yourfansitename.com/main
Coppermine installed at: yourfansitename.com/gallery

You can find more information and a full documentation at this link.