CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 5 CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 5
 

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]

Main Menu

CpmFetch 1.4 On... Displaying data and images from CPG on your website

Started by vuud, July 08, 2005, 06:43:10 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

sublime

vuud,

I apologize if I am off-topic, but I have the following problem and would really appreciate some help:

I get the following error on my second instance of calling cpmfetch on my home page:


Fatal error: Call to undefined function: cpm_viewrandomtopratedmediafrom() in /home/ramoswa/public_html/waramos/home.php on line 242


My first call of cpmfetch works and is as follows:


<?php
include_once("/home/ramoswa/www/waramos/cpmfetch/coppermine.php");
$objCpm = new cpm('/');
$objCpm->cpm_viewRandomMediaFromAlbum(1,1,57,array("tablestyle" => "randphoto","imagestyle" => "randphoto"));
$objCpm->cpm_close();
?>



I'm having trouble with the second call to cpmfetch on my home page. The code is as follows:

<?php
require_once("/home/ramoswa/www/waramos/cpmfetch/coppermine.php");
$objCpm = new cpm('/');
$objCpm->cpm_viewRandomTopRatedMediaFrom("","1","1",array("tablestyle" => "randphoto","imagestyle" => "randphoto"));
$objCpm->cpm_close();
?>


I'm trying to get different random photos according to specific needs on one page. The first php code works to bring up a random photo from a specific album. The second one is trying to call a random photo of the toprated from all albums.  It seems that I cannot get a second random image using anything else but the
"viewwRandomMediaFromAlbum" function. Anything else I try, I get a "Call to Undefined Function" error.

You can view the page by going to:
http://www.waramos.com/test.php to see what I'm talking about.

Thanks!!  

~Sub

cannedfool

hey can anyone help me

im running coppermine and smf (latest on both) and am trying to use the latest cpmfetch, when i run the test file i get mysql errors in the cpmfetch_deo.php file

see  http://www.uhcc.co.uk/cpmfetch/cftest.php

hope some1 can help

vuud

Quote from: sublime on July 26, 2005, 08:03:29 PM
vuud,

I apologize if I am off-topic, but I have the following problem and would really appreciate some help:

I get the following error on my second instance of calling cpmfetch on my home page:


Fatal error: Call to undefined function: cpm_viewrandomtopratedmediafrom() in /home/ramoswa/public_html/waramos/home.php on line 242


My first call of cpmfetch works and is as follows:


<?php
include_once("/home/ramoswa/www/waramos/cpmfetch/coppermine.php");
$objCpm = new cpm('/');
$objCpm->cpm_viewRandomMediaFromAlbum(1,1,57,array("tablestyle" => "randphoto","imagestyle" => "randphoto"));
$objCpm->cpm_close();
?>



I'm having trouble with the second call to cpmfetch on my home page. The code is as follows:

<?php
require_once("/home/ramoswa/www/waramos/cpmfetch/coppermine.php");
$objCpm = new cpm('/');
$objCpm->cpm_viewRandomTopRatedMediaFrom("","1","1",array("tablestyle" => "randphoto","imagestyle" => "randphoto"));
$objCpm->cpm_close();
?>


I'm trying to get different random photos according to specific needs on one page. The first php code works to bring up a random photo from a specific album. The second one is trying to call a random photo of the toprated from all albums.  It seems that I cannot get a second random image using anything else but the
"viewwRandomMediaFromAlbum" function. Anything else I try, I get a "Call to Undefined Function" error.

You can view the page by going to:
http://www.waramos.com/test.php to see what I'm talking about.

Thanks!! 

~Sub

Off topic?  No way - its more on topic than some posts! 

First off, don't open and close twice...  In all of my pages I have the open at the top and the close at the bottom.  Then I stick in calls throughout the page as needed.

So...

At the top of the page:
<?php
require_once("/home/ramoswa/www/waramos/cpmfetch/coppermine.php");
$objCpm = new cpm('/');
?>




At the the bottom of the page:

<?php
$objCpm
->cpm_close();
?>



The reason is that you are establishing the database connection twice!  Connecting is the most time consuming of all operations on a server.  Putting cpmfetch's open at the top starts the code, but it does not make a DB connection until you call for photos... then it keeps it till you close.  So having them is no harm really.

Otherwise, download the latest version 1.4.something and try that.  All your includes will now point to cpmfetch.php and NOT coppermine.php

Make those changes and let me know if it fixes the problem



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

Quote from: cannedfool on July 27, 2005, 01:13:49 AM
hey can anyone help me

im running coppermine and smf (latest on both) and am trying to use the latest cpmfetch, when i run the test file i get mysql errors in the cpmfetch_deo.php file

see  http://www.uhcc.co.uk/cpmfetch/cftest.php

hope some1 can help

Thank you for posting an example page... I appreciate it. 

Okay, the problem is in your version of php... its a bit older, but within what CPG supports, so I want mine to do the same.  I may have the issues worked out - or at least a stab at them

Try downloading development version 1.5.3 from my web site
http://cpmfetch.fistfullofcode.com

Let me know how that works out.  Even if you plan on upgrading PHP, please try this first.  If it bombs, let me know and I will check it again - but it will be progress.  I am almost sure of that.

Thanks

Vuud





Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

cannedfool

worked  m8 thanks alot.

not sure if they are meant to but my images look grainy..

http://www.uhcc.co.uk/cpmfetch/cftest.php

thanks :)

edit: it looks fine on my site (http://www.uhcc.co.uk/home.php - bottom right)

sublime

vuud,

You are the man!!  ;D

It works like a champ now! Thank you so much for your time and help with this!!

~Sub

sublime

vuud,

One other thing, I'm using the code you gave me to try and pull a random photo from my toprated.  It seems to be randomly choosing an image (Rated or NOT) from my entire gallery.  I am using Coppermine 1.4.1 and the latest cpmfetch.

Here's the code I'm using:


<?php
$objCpm
->cpm_viewRandomTopRatedMediaFrom("",1,1,array("tablestyle" => "randphoto","imagestyle" => "randphoto"));
 
?>



You can go to my site at www.waramos.com/home.php to see what I'm talking about. The random photos in question is the one next to the "Your Opinion Counts!" section on the front page.

Any ideas? Thanks again!

~Sub

vuud

Quote from: cannedfool on July 27, 2005, 03:43:10 PM
worked  m8 thanks alot.

not sure if they are meant to but my images look grainy..

http://www.uhcc.co.uk/cpmfetch/cftest.php

thanks :)

edit: it looks fine on my site (http://www.uhcc.co.uk/home.php - bottom right)


Ick...   Yeah, I have the test page resize to 150 wide for neatness (they are all the same).  So, its just the browser scaling up an image.  Everything is normal. 

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

Quote from: sublime on July 27, 2005, 05:30:37 PM
vuud,

One other thing, I'm using the code you gave me to try and pull a random photo from my toprated.  It seems to be randomly choosing an image (Rated or NOT) from my entire gallery.  I am using Coppermine 1.4.1 and the latest cpmfetch.

Here's the code I'm using:


<?php
$objCpm
->cpm_viewRandomTopRatedMediaFrom("",1,1,array("tablestyle" => "randphoto","imagestyle" => "randphoto"));
 
?>



You can go to my site at www.waramos.com/home.php to see what I'm talking about. The random photos in question is the one next to the "Your Opinion Counts!" section on the front page.

Any ideas? Thanks again!

~Sub


This feature was pretty tricky to implement... and even now, even after having the hand of vuud code it... it still is strange.  What happens is that cpmfetch does this when you call that feature.

1) Gets the total count for the area (album or category) you selected
2) Decides on a percentage to grab (25% is coded in there right now)
3) Grabs 25% of the entries in order of rating.
4) Randomly selects from that group

So you can see how if you have only a few images in there with ratings, say 5 out of 100, it would cause a problem.  The code will grab 25 out of the 100.

Your best bet may be to lower the threshold by editing cpmfetch_dao.php

Somewhere around line 50 (depending on the version you are running)

var $topPercentForMostViewed = 25;

Change the 25 to 5 or something

I will code into the next release an easier way to change it.  Having people edit the source is not a good thing.

Let me know if that answers your issue...  The random from top rated was a very icky thing. 

Vuud




Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Anna

I'm new to this and I am a tad bit confused.

How can I display the list of albums from a certain category?

vuud

Quote from: Anna on July 27, 2005, 10:54:14 PM
I'm new to this and I am a tad bit confused.

How can I display the list of albums from a certain category?

Interesting... that one has never come up before.

I don't think there is a way to list the albums in the a group of categories.  Be a neat feature though

CpmFetch has been mostly for retrieving stats and images.  I can probably add that to one of the upcoming dev releases maybe



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Rodinou

I'm crying, nothing works with me.

Fed up with this app' : great for all, but not for me :)

Keep up the work :)

vuud

Quote from: Rodinou on July 28, 2005, 01:09:57 AM
I'm crying, nothing works with me.

Fed up with this app' : great for all, but not for me :)

Keep up the work :)

Sorry to hear that... my last post regarding your problem and asking for you to PM me an email address I can send a test version too went unanswered.  I tried to support you, but if you want out... less for me to worry about. 

I think you may win something as the first person we did not get working with it... mostly because you would not help me help you probably.



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Joachim Müller

don't worry, look at Rod's karma: it's not your fault nor the fault of cpmFetch, but a classical PEBCAK case imo. ;D

vuud

Quote from: GauGau on July 28, 2005, 06:12:39 AM
don't worry, look at Rod's karma: it's not your fault nor the fault of cpmFetch, but a classical PEBCAK case imo. ;D

Too bad, your thumbnail prefix solution was probably it...  The dirindex thing threw me off, but I traced it through and thats a symptom of it.
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

sublime

vuud,

Tried to change the value of var $topPercentForMostViewed = 25;
to a lower number (started at 5) and still no effect.  

I guess I should just waited until more of my photos are rated?

Thanks again vuud! cmpfetch is awesome!!   8)

vuud

Quote from: sublime on July 28, 2005, 03:37:21 PM
vuud,

Tried to change the value of var $topPercentForMostViewed = 25;
to a lower number (started at 5) and still no effect. 

I guess I should just waited until more of my photos are rated?

Thanks again vuud! cmpfetch is awesome!!   8)


Depending on how may photos versus how many rated the 5 may need to be lower.  At 5 it basically means that if you have a 100 photos, it will use the top 5 (5% of 100 is 5) rated ones to randomly pick from.

Of course the whole thing could be screwed up anyway...  :)




Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Rodinou

Quote from: GauGau on July 28, 2005, 06:12:39 AM
don't worry, look at Rod's karma: it's not your fault nor the fault of cpmFetch, but a classical PEBCAK case imo. ;D

Thanx Gaugau :)

What's a pity you have in your hands a great app, and use it very bad.

Like someone who has the money to drive a ferrari, but rather a 2CV.

Rodinou

Anyway ...

for many dev', it's more important to dev inutile plugin rather have a tableless CPG : it's true : PunBB, Nucleus, DotClear, and all "NEW APPs" have understood the power of CSS and XHTML, not you ... ok ok ... it's more important to integrate very loud functions to read flash, it's important to sort images by date (used by ... 1 ? 2 ? 3 ? 10 persons), it's not important to reduce requests, so important you have to buy a dedicated server ... yes. I'm proud to have my negative Karma : because you have a very old vision of the WEB. It's not my fault. I have given you a 90% tableless interface, but you were not interested ... in five years, maybe Coppermine will be the only app' on the web using table, clicking 10 pages to see only One picture ... no soucy !!! My problem is I'm designer, not coder ...

To vuud, I think like Gaugau you think me very dumb ... but I KNOW I have changed the prefix (thumb_ > tn_) ... but it doesnt' work. I'm not english, but I KNOW read it. Anyway to answer of this suggestion

Quote
I'm new to this and I am a tad bit confused.

How can I display the list of albums from a certain category?


Interesting... that one has never come up before.

I don't think there is a way to list the albums in the a group of categories.  Be a neat feature though

CpmFetch has been mostly for retrieving stats and images.  I can probably add that to one of the upcoming dev releases maybe

Imagine you have several pubs ... each pub has xxxx albums. Displaying each "good" album of each pub could be a cool idea. Or of course, displaying all the category "pub" when you are on the pub's page.

vuud


First off, if you have a problem with CPG take it to one of the other forums, this is not the place for the your vision does not match mine so it sucks discussion.  I am sorely tempted to delete you post from here because it does actually no good whatsoever.  Thats all I am gonna say on that topic.  There are boards here for that sort of thing.  Further posts along those lines in this section will be deleted

As for this:

Quote from: Rodinou on July 28, 2005, 09:31:25 PM
To vuud, I think like Gaugau you think me very dumb ... but I KNOW I have changed the prefix (thumb_ > tn_) ... but it doesnt' work. I'm not english, but I KNOW read it.

Well thanks for letting me know just after you post negative remarks about my code.  Great.  Wonderful.  Endearing.  I don't think your dumb, you just did not 1) Let us know you tried the thumbnails and 2) Did not follow my request for an email address to send a new version too.

Okay, you changed the thumbnail prefix, I will look up the cftest.php you submitted before.and see what else I can do...




Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco