coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: joeyhavlock on July 21, 2007, 12:12:51 AM

Title: cpmFetch - Only 2 Items from the Array Showing?
Post by: joeyhavlock on July 21, 2007, 12:12:51 AM
Hi Vudd, Everyone...

First off, great program, just awesome!

Ok, here's my code:

  <?php
  include_once "../../coppermine/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("../../coppermine/cpmfetch/cpmfetch_config.php");
  $options = array("windowtarget" => "_top", "Subtitle" => "Views: {{pHits}}", "Votestitle" => "Votes: {{pVotes}}" );
  $objCpm->cpm_viewRandomMediaFrom("cat=37",5, 1, $options);
  $objCpm->cpm_close();
?>

I am trying to show the views as well as the votes from my CPG, but the votes array variable does not display.  If I switch the order of the votes and the views, then the votes display fine.  For some reason only the 1st and 2nd array variable are being displayed.  I think I have the code proper, but obviously must not.  Can you shed any light as to why my 3rd variable is not being displayed?

Thanks much!
Joey
Title: Re: cpmFetch - Only 2 Items from the Array Showing?
Post by: joeyhavlock on July 21, 2007, 12:50:45 AM
Ok, maybe I jumped the gun, and sorry I know you folks like people to figure out things for themselves.  I did not realize that you could pass multiple variables to the array items.  I figured out that I just need to include all the subtitle items I wanted along with it not to actually try to initialize a NEW variable for each item.

<?php
  include_once "../../coppermine/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("../../coppermine/cpmfetch/cpmfetch_config.php");
  $options = array("windowtarget" => "_top", "hline" => "<hr>","Subtitle" => "Views: {{pHits}} Votes: {{pVotes}} <br><hr>" );
  $objCpm->cpm_viewRandomMediaFrom("cat=37",5, 1, $options);
  $objCpm->cpm_close();
?>

Anyway, was able to get it all to work, including the <hr> as well, which greatly helps to distinguish what data belongs to what photo...

Thanks again Vuud, your program is freaking awesome!
All the best...
Joey