Advanced search  

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

Pages: 1 2 3 4 [5] 6 7 8 9 ... 54   Go Down

Author Topic: CpmFetch 1.4 On... Displaying data and images from CPG on your website  (Read 964992 times)

0 Members and 2 Guests are viewing this topic.

sublime

  • Coppermine newbie
  • Offline Offline
  • Posts: 8

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:

Code: [Select]
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:

Code: [Select]
<?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:

Code: [Select]
<?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
« Last Edit: July 26, 2005, 08:37:06 pm by sublime »
Logged

cannedfool

  • Coppermine newbie
  • Offline Offline
  • Posts: 10

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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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:

Code: [Select]
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:

Code: [Select]
<?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:

Code: [Select]
<?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:
Code: [Select]
<?php
require_once("/home/ramoswa/www/waramos/cpmfetch/coppermine.php");
$objCpm = new cpm('/');
?>



At the the bottom of the page:
Code: [Select]
<?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



Logged
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

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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





Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 10

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)
« Last Edit: July 27, 2005, 04:04:54 pm by cannedfool »
Logged

sublime

  • Coppermine newbie
  • Offline Offline
  • Posts: 8

vuud,

You are the man!!  ;D

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

~Sub
Logged

sublime

  • Coppermine newbie
  • Offline Offline
  • Posts: 8

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:

Code: [Select]
<?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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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. 

Logged
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

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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:

Code: [Select]
<?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




Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23

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

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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



Logged
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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net

I'm crying, nothing works with me.

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

Keep up the work :)

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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.



Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 8

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)
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code

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...  :)




Logged
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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net

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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net

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

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code


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:

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...




Logged
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
Pages: 1 2 3 4 [5] 6 7 8 9 ... 54   Go Up
 

Page created in 0.034 seconds with 19 queries.