coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Gephri on September 04, 2007, 09:53:54 AM

Title: To get View & Votes on 2nd site
Post by: Gephri on September 04, 2007, 09:53:54 AM
I've got CPM working with CPG on my site and am also able to view random gallery images on a second site of mine by using gallery/cpmfetch/cfig_random.php

On the second site, along with each image shown, I would like to show its Total Views and Total Votes.

Is that possible?
If so, can you please instruct.

Thanks
Title: Re: To get View & Votes on 2nd site
Post by: therightpic on September 05, 2007, 04:00:43 PM
Have you looked at the CpmFetch manual?  Because this is one of the easiest things to get working.

<?php
  include_once "your path here";
  $statsCpm = new cpm("your path here");
      echo "Here are some of the ";
  $statsCpm->cpm_listMediaCountFrom("");
      echo " free photos and images in our gallery";
?>

If you are looking for more info I would check out the manual. 

Title: Re: To get View & Votes on 2nd site
Post by: Gephri on September 05, 2007, 05:22:25 PM
I'm actually looking for a way to show -on a remote site from the gallery -- a random gallery image WITH the view and votes stats below it...

The code below does successfully pull in the random gallery image on my remote site with php pages, but doesn't get the stats:
<a href="http://www.MYGALLERYSITE.com/gallery/index.php" onMouseOver="wiwo('Click to see more  in the Gallery !');return true;" onMouseOut="wiwo();"><IMG src="http://www.MYGALLERYSITE.com/gallery/cpmfetch/cfig_random.php" border="0" title="Click to see more in the Gallery !" class="cpm_brdr"></a>


Any thoughts?
Title: Re: To get View & Votes on 2nd site
Post by: therightpic on September 05, 2007, 06:04:49 PM
Sorry, I missed what you wanted.  Look at this:

http://cpmfetch.fistfullofcode.com/features/index.php

At the bottom of this page is a printout of an array that shows a ton of different things you can get from one image.  You should be able to use these to get what you want to print out.
Title: Re: To get View & Votes on 2nd site
Post by: Gephri on September 05, 2007, 07:58:02 PM
I'm unable to figure this one out.  I'd like to pull an image and its number of view and votes from my gallery on one site into a php page on another site.
I can get the picture to come across using the IMG call and the cfig_random.php file (see code above).
But I can't pull in the stats too.
I've looked into the cfig_random.php and cfimageget.php files and the documentation - cant put it all together.

If someone can show me how to pull at least one stat - I can take it from there.

Thanks!
Title: Re: To get View & Votes on 2nd site
Post by: Gephri on September 13, 2007, 01:10:07 AM
Has anyone been able to pull in any stats using the IMG call
Title: Re: To get View & Votes on 2nd site
Post by: therightpic on September 13, 2007, 05:04:20 AM
I don't know about the image call but this works for me:

<?php
  include_once "../cpg1.4.11/cpmfetch/cpmfetch.php";
  $newCpm = new cpm("../cpg1.4.11/cpmfetch/cpmfetch_config.php");
$options = array("subtitle" => "Votes : {{pVotes}} Views: {{pHits}}");
$newCpm->cpm_viewRandomMediaFrom("album=13",1,1, $options);

?>


It prints out an image that has a label beneath it that shows the number of votes and views (I think, not sure if pHits is views or not?
Title: Re: To get View & Votes on 2nd site
Post by: Gephri on September 13, 2007, 07:42:32 AM
thanks for the reply - but actually was trying to pull "hits" and "votes" from one domain to another.

the standard CPMFetch php doesn't do that.

anyone know how to do that?
Title: Re: To get View & Votes on 2nd site
Post by: Gephri on September 21, 2007, 05:22:57 PM
I'd like to pull an image and its number of views and votes from my gallery (on one site) into a php page and/or html page on another site.

I can get the picture to come across using the IMG call and the cfig_random.php file (see code above).

But I can't pull in the stats too.

I've looked into the cfig_random.php and cfimageget.php files and the documentation - cant put it all together.

Any ideas?