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: Random Image from each category  (Read 5168 times)

0 Members and 1 Guest are viewing this topic.

SolidSnake2003

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 82
  • Solid Snake/Joshua Harris Fan
    • Legacy Designs
Random Image from each category
« 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();
?>
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Random Image from each category
« Reply #1 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 ?
Logged

Nibbler

  • Guest
Re: Random Image from each category
« Reply #2 on: March 06, 2007, 03:55:19 pm »

You have a syntax error here

Code: [Select]
$source = "cat=3,5;
I'm not sure what that line of code is for.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Random Image from each category
« Reply #3 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...


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



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

« Last Edit: March 07, 2007, 12:53:31 am by 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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Random Image from each category
« Reply #4 on: March 06, 2007, 04:34:59 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
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

SolidSnake2003

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 82
  • Solid Snake/Joshua Harris Fan
    • Legacy Designs
Re: Random Image from each category
« Reply #5 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.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Random Image from each category
« Reply #6 on: March 25, 2007, 12:15:15 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

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
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 16 queries.