Advanced search  

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]

Pages: [1]   Go Down

Author Topic: To get View & Votes on 2nd site  (Read 6097 times)

0 Members and 1 Guest are viewing this topic.

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
To get View & Votes on 2nd site
« 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
Logged

therightpic

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • TheRightPic
Re: To get View & Votes on 2nd site
« Reply #1 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. 

Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: To get View & Votes on 2nd site
« Reply #2 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:
Code: [Select]
<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?
Logged

therightpic

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • TheRightPic
Re: To get View & Votes on 2nd site
« Reply #3 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.
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: To get View & Votes on 2nd site
« Reply #4 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!
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: To get View & Votes on 2nd site
« Reply #5 on: September 13, 2007, 01:10:07 am »

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

therightpic

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • TheRightPic
Re: To get View & Votes on 2nd site
« Reply #6 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?
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: To get View & Votes on 2nd site
« Reply #7 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?
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: To get View & Votes on 2nd site
« Reply #8 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?
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.