cpmFetch - Only 2 Items from the Array Showing? cpmFetch - Only 2 Items from the Array Showing?
 

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]

Main Menu

cpmFetch - Only 2 Items from the Array Showing?

Started by joeyhavlock, July 21, 2007, 12:12:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

joeyhavlock

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

joeyhavlock

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