To get View & Votes on 2nd site To get View & Votes on 2nd site
 

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

To get View & Votes on 2nd site

Started by Gephri, September 04, 2007, 09:53:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gephri

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

therightpic

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. 


Gephri

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?

therightpic

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.

Gephri

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!

Gephri

Has anyone been able to pull in any stats using the IMG call

therightpic

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?

Gephri

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?

Gephri

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?