coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: SolidSnake2003 on March 06, 2007, 03:29:54 PM

Title: Random Image from each category
Post by: SolidSnake2003 on March 06, 2007, 03:29:54 PM
I tried to add to the home practice a script that displays a random from each of the categories, this is the script that I am using

<?php
  include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,2,array("imagestyle" => "test1"));
  $source = "cat=3,5;
  $objCpm->cpm_close();
?>
Title: Re: Random Image from each category
Post by: Hein Traag on March 06, 2007, 03:52:31 PM
And your post is about what exactly ? Is this code working and does it do what say it should do or it does not work and you want some help ?
Title: Re: Random Image from each category
Post by: Nibbler on March 06, 2007, 03:55:19 PM
You have a syntax error here

$source = "cat=3,5;

I'm not sure what that line of code is for.
Title: Re: Random Image from each category
Post by: vuud on March 06, 2007, 04:34:27 PM
You really do need to state your problem.  We can infer that it does not work, but you have to remember to make it is as easy as possible to help you.

Your code is messed up...

Quote from: SolidSnake2003 on March 06, 2007, 03:29:54 PM

<?php
  include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,2,array("imagestyle" => "test1"));
  $source = "cat=3,5";
  $objCpm->cpm_close();
?>


Quote from: SolidSnake2003 on March 06, 2007, 03:29:54 PM

<?php
  include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");

// The following two lines specifically.

  $source = "cat=3,5;
  $objCpm->cpm_viewLastAddedMediaFrom($source,1,2,array("imagestyle" => "test1"));



  $objCpm->cpm_close();
?>


I know the documentation is pretty screwy between versions right now - I have a new guide typed up, but have not finished proofreading it.


EDITED BY AUTHOR:  Reflect typo pointed out above in the source line

Title: Re: Random Image from each category
Post by: vuud on March 06, 2007, 04:34:59 PM
Quote from: Hein on March 06, 2007, 03:52:31 PM
And your post is about what exactly ? Is this code working and does it do what say it should do or it does not work and you want some help ?


Its a blog entry!  :D
Title: Re: Random Image from each category
Post by: SolidSnake2003 on March 25, 2007, 12:02:13 AM
sorry if I was wasting somebody's time, I wasnt trying to waste time

The code was working, just not in the way I was wanting, but I got it though :D

Sorry again for wasting time.
Title: Re: Random Image from each category
Post by: vuud on March 25, 2007, 12:15:15 AM
Quote from: SolidSnake2003 on March 25, 2007, 12:02:13 AM
sorry if I was wasting somebody's time, I wasnt trying to waste time

The code was working, just not in the way I was wanting, but I got it though :D

Sorry again for wasting time.


Ah no problem.  The original post just never exactly said what the problem was specifically...   What you were trying to do, but not what was going on.

It's us being funny... we have to laugh, otherwise we'll all lose our minds :D