forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Shade on April 27, 2007, 07:08:15 pm

Title: newest + best voted + most viewed pictures
Post by: Shade on April 27, 2007, 07:08:15 pm
Hello,

First i want to say, that my english is not so good. ;-)

My Question: How i can put 1 row with 4 newest Pics + 1 row with 4 best voted Pics + 1 row with 4 most viewed Pics + 1 row with 4 random Pics in one page?
Like this:
new new new new
view view view view
vote vote vote vote
random random random random

I look forward to hear from you ( ??? ::))
Title: Re: newest + best voted + most viewed pictures
Post by: vuud on April 27, 2007, 08:01:33 pm
Hello,

First i want to say, that my english is not so good. ;-)

My Question: How i can put 1 row with 4 newest Pics + 1 row with 4 best voted Pics + 1 row with 4 most viewed Pics + 1 row with 4 random Pics in one page?
Like this:
new new new new
view view view view
vote vote vote vote
random random random random

I look forward to hear from you ( ??? ::))


Just do 4 calls...   one to each of them...



Title: Re: newest + best voted + most viewed pictures
Post by: Shade on April 27, 2007, 08:23:25 pm
Why?
Is that so heavy? I have seen functions for this (best voted, most viewed)....but i only dont know how to make the code.

(Or maybe i dont understand you!?)
Title: Re: newest + best voted + most viewed pictures
Post by: Shade on April 27, 2007, 08:26:19 pm
Sry for Doublepost  :(


I have this code:
<?php
  include "././gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("././gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();
?>

But thats only for the last added pictures.
How i can edit the code that the most viewed pictures and the best voted (and radnom pictures) are showed there too?

Shade  :-[
Title: Re: newest + best voted + most viewed pictures
Post by: vuud on April 27, 2007, 09:56:54 pm
Code: [Select]
<?php
include "././gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("././gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_view...(1,4);
$objCpm->cpm_view...(1,4);
$objCpm->cpm_view....(1,4);
$objCpm->cpm_close();
?>



Replace the ... with the functions you want.

It will be light... there is only one database connection being made.

Vuud
Title: Re: newest + best voted + most viewed pictures
Post by: Shade on April 27, 2007, 10:35:08 pm
Hi,

That:
<?php
include "././gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("././gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_viewTopRatedMediaFrom(1,4);
$objCpm->cpm_viewRandomMostViewedMediaFrom(1,4);
$objCpm->cpm_viewRandomMediaFrom(1,4);
$objCpm->cpm_close();
?>

....doesnt work!  ??? What have i maked wrong?
And what is cpm_viewRandomMostViewedMediaFrom? Why RandomMostViewed... ? What does it mean? I want only the 4 most viewed picture.
(Im missing a help or example for that.)

Shade
Title: Re: newest + best voted + most viewed pictures
Post by: vuud on April 28, 2007, 01:48:36 am
Hi,

That:
<?php
include "././gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("././gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_viewTopRatedMediaFrom(1,4);
$objCpm->cpm_viewRandomMostViewedMediaFrom(1,4);
$objCpm->cpm_viewRandomMediaFrom(1,4);
$objCpm->cpm_close();
?>

....doesnt work!  ??? What have i maked wrong?
And what is cpm_viewRandomMostViewedMediaFrom? Why RandomMostViewed... ? What does it mean? I want only the 4 most viewed picture.
(Im missing a help or example for that.)

Shade



$objCpm->cpm_viewTopRatedMediaFrom("",1,4);
$objCpm->cpm_viewRandomMostViewedMediaFrom("",1,4);
$objCpm->cpm_viewRandomMediaFrom("",1,4);

cpm_viewRandomMostViewedMediaFrom is because my thought is that you can have a lot that are viewed the same amount.  Since I was lucky enough to write it, it reflects my thought process.  :D



Title: Re: newest + best voted + most viewed pictures
Post by: Shade on April 28, 2007, 08:38:31 am
Ah Thank you very much, it works!  :D