I've read through all of the documents that I could find, and I've even tried codes that others have, but I cannot get $source to work.
I want to be able to display pics from certain categories/albums, but every time I try the code, I always get the last album.
The last version that I tried was:
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$options = array('imagestyle' => 'cpm', 'imagewidth' => '70', 'tablestyle' => 'auto');
$objCpm->cpm_viewLastAddedMedia(1,4,$source="cat=9:album=96",$options);
$objCpm->cpm_close();
?>
But, of course, none of the docs for the new version have a code that shows you how to do it. And if they do, they make it pretty hard to find.
Quote from: jlove on April 02, 2007, 05:25:37 AM
I've read through all of the documents that I could find, and I've even tried codes that others have, but I cannot get $source to work.
I want to be able to display pics from certain categories/albums, but every time I try the code, I always get the last album.
The last version that I tried was:
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$options = array('imagestyle' => 'cpm', 'imagewidth' => '70', 'tablestyle' => 'auto');
$objCpm->cpm_viewLastAddedMedia(1,4,$source="cat=9:album=96",$options);
$objCpm->cpm_close();
?>
But, of course, none of the docs for the new version have a code that shows you how to do it. And if they do, they make it pretty hard to find.
yeah, the docs for the new version are not terribly organized yet. But they do show the source parameter as the first entry. This is behaviour that has changed since the older version. Also, you just pass the string, not source=
$objCpm->cpm_viewLastAddedMedia("cat=9:album=96",1,4,$options);
Should work for you.
The beta draft docs, here:
http://forum.coppermine-gallery.net/index.php?topic=41984.msg199145#msg199145
Have a nice walk through that may help you acclimate to it.
Vuud
I don't know, it still didn't work.
Does it matter that it's a second time that I'm calling it on my page? (I've done it before, so I didn't think that would be a problem.)
Quote from: jlove on April 02, 2007, 09:12:01 PM
I don't know, it still didn't work.
Does it matter that it's a second time that I'm calling it on my page? (I've done it before, so I didn't think that would be a problem.)
Depends what you mean.
Can you copy and paste the code here?
And is it the same error?
This code:
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$options = array('imagestyle' => 'cpm', 'imagewidth' => '70', 'tablestyle' => 'auto');
$objCpm->cpm_viewLastAddedMedia("cat=9:album=96",1,4,$options);
$objCpm->cpm_close();
?>
I also tried with the absolute path.
All I get is an empty table
<table >
Nothingness
</table>
That's what it looks like.
Quote from: jlove on April 03, 2007, 07:58:46 AM
This code:
<?php
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpmfetch/cpmfetch_config.php");
$options = array('imagestyle' => 'cpm', 'imagewidth' => '70', 'tablestyle' => 'auto');
$objCpm->cpm_viewLastAddedMedia("cat=9:album=96",1,4,$options);
$objCpm->cpm_close();
?>
I also tried with the absolute path.
All I get is an empty table
<table >
Nothingness
</table>
That's what it looks like.
Can you post or PM me a link to your gallery?
That looks right...
I sent a PM.
Quote from: jlove on April 04, 2007, 12:20:16 AM
I sent a PM.
Ah crap, sorry I missed something above when i was changing you
This:
$objCpm->cpm_viewLastAddedMedia("cat=9:album=96",1,4,$options);
Should be:
$objCpm->cpm_viewLastAddedMediaFrom("cat=9:album=96",1,4,$options);
Ok, it works now. Thanks. :)