I've found a way to do this with php, but I'm not sure how clever I am at explaining it.
The problem I had was that for every page on website where I wanted pictures displayed from a different category or album combination, I needed to create a new cpmfetch page on the coppermine website, and then include or get_file_contents it using php. It got tedious after a while with more than a handful of pages. So this is what I did.
1. Add a /cpmfetch/cpmfetch-new.php file on your coppermine website with display configuration you want on display website.
2. On display website, add a file called images-or-something.php that you will include on any page you want to have images from your coppermine website. If you're familiar with php, then save it in your /includes/ folder if you have one. It should have the following php lines:
$copperminepath = "http://www.yourcopperminewebsite/cpmfetch/cpmfetch-new.php";
$coppermineimages = file_get_contents($copperminepath);
echo $coppermineimages;
3. On pages where you want images displayed, just include the file from #2.
This works for me on my shared server configuration which won't allow me to fopen, include, fread etc from another domain name, even if it's on the same account. I can't guarantee it works in all situations.
If you want variable output depending on the page content, here's what I did.
4. I have the variable $album which I set in php in header of page before html e.g.
$album = 1
$album = 1,2,3 (yes I think it works when you do this).
etc
Now, go back to step 2, add a ? at the end of the path string, then you can add the $album value as a URL variable to pass through to your coppermine site.
$copperminepath = "http://www.yourcopperminewebsite/cpmfetch/cpmfetch-new.php?";
if(isset($album)) {$copperminepath .= 'album='.$album;}
$coppermineimages = file_get_contents($copperminepath);
echo $coppermineimages;
5. In your cpmfetch-new.php file, you need to GET the variables for processing e.g.
if(isset($_GET['album')) {$album=$_GET['album'];}
Then somewhere in your code, you need this line
$objCpm->cpm_viewRandomMediaFromAlbum(1, 2, $album, $cpmoptions);
Which takes 1 row of 2 images from the albums specified by $album, according to your $cpmoptions array for formatting.
This can be extended to categories also, maybe both. And of course some of the coding can be modified to check if variables are set or not, to sanitize them, etc. I'm only trying to give the general idea.
I tried to do this with both albums and cats and the cpm_viewRandomMediaFrom() function but couldn't get it to work, so have used the cpm_viewRandomMediaFromAlbum and ...FromCategory functions separately.
Sorry if you're not familiar with php, I don't know an easy way to explain how to do this then
.