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

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

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