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: CPMFetch - problems fetching other lists.  (Read 10496 times)

0 Members and 1 Guest are viewing this topic.

Dankriss

  • Coppermine regular visitor
  • **
  • Country: gb
  • Offline Offline
  • Gender: Female
  • Posts: 97
    • Nikmania
CPMFetch - problems fetching other lists.
« on: July 16, 2016, 09:14:39 pm »

Hi guys


I have installed and got it working on a test site but I can only pull latest images... I have added other commands but it is not pulling them...


Code: [Select]
<?php


  
include_once "./cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastUpdatedAlbumsFrom(14$options);
$objCpm->cpm_viewLastCommentedImages(14$options);
$objCpm->cpm_viewLastAddedMedia(14$options);
  
$objCpm->cpm_viewRandomMediaFrom("cat=1",14$options);
  
$objCpm->cpm_close(); 
?>


And here is a link to the test site... http://nikmania.me.uk/copperminetest/welcome.php


This is my first time using PHP as well... good with html and css not so good with PHP.. :D


Kriss :)
Logged
Good with HTML and CSS but no good with script... so please bear with me.. :)

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: CPMFetch - problems fetching other lists.
« Reply #1 on: July 20, 2016, 02:10:19 pm »

$objCpm->cpm_viewLastUpdatedAlbumsFrom(1, 4, $options);

It doesn't work, as you haven't provided all required parameters:
Code: [Select]
function cpm_viewLastUpdatedAlbumsFrom($source, $rows, $columns, $options="") {
It needs to be something like
Code: [Select]
$objCpm->cpm_viewLastUpdatedAlbumsFrom("cat=2", 1, 4, $options);

$objCpm->cpm_viewLastCommentedImages(1, 4, $options);
$objCpm->cpm_viewRandomMediaFrom("cat=1",1, 4, $options);

You have no comments in your gallery and also category "1" (which is the ID of the user galleries category) doesn't contain any images. So what exactly should be displayed?
Logged

Dankriss

  • Coppermine regular visitor
  • **
  • Country: gb
  • Offline Offline
  • Gender: Female
  • Posts: 97
    • Nikmania
Re: CPMFetch - problems fetching other lists.
« Reply #2 on: July 20, 2016, 04:12:43 pm »




Ok so I needed to tell it what catergory to take from...thank you.... comments and last viewed were in there already from the copy and paste I did from the help page.


Thanks I will now go and play with it...sorry for being so stupid... :)


Kriss :)
Logged
Good with HTML and CSS but no good with script... so please bear with me.. :)
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.