Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Can't get $source to work for 1.9.12  (Read 5712 times)

0 Members and 1 Guest are viewing this topic.

jlove

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Can't get $source to work for 1.9.12
« 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.
« Last Edit: April 04, 2007, 07:43:19 pm by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Can't get $source to work for 1.9.12
« Reply #1 on: April 02, 2007, 05:45:36 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



Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

jlove

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: Can't get $source to work for 1.9.12
« Reply #2 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.)
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Can't get $source to work for 1.9.12
« Reply #3 on: April 02, 2007, 10:21:24 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?
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

jlove

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: Can't get $source to work for 1.9.12
« Reply #4 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.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Can't get $source to work for 1.9.12
« Reply #5 on: April 03, 2007, 04:40:11 pm »

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...
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

jlove

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: Can't get $source to work for 1.9.12
« Reply #6 on: April 04, 2007, 12:20:16 am »

I sent a PM.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Can't get $source to work for 1.9.12
« Reply #7 on: April 04, 2007, 04:49:48 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);



Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

jlove

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 41
Re: Can't get $source to work for 1.9.12
« Reply #8 on: April 04, 2007, 02:38:31 pm »

Ok, it works now. Thanks.  :)
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 20 queries.