Random Image from each category Random Image from each category
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Random Image from each category

Started by SolidSnake2003, March 06, 2007, 03:29:54 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

SolidSnake2003

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();
?>

Hein Traag

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 ?

Nibbler

You have a syntax error here

$source = "cat=3,5;

I'm not sure what that line of code is for.

vuud

#3
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

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

vuud

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
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

SolidSnake2003

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.

vuud

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

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