Hi,
I am a real newbie and intend to use cpmFetch to display specific images from Coppermine on a remote Website (MediaWiki). Am I right, that cpmFetch can only display random genrate pictures or the latest images from the coppermine gallery?
Is there a possibility for one every time the same specific image?
Thanks,
Robbi
Quote from: Robbi99 on January 16, 2007, 07:15:42 PM
Hi,
I am a real newbie and intend to use cpmFetch to display specific images from Coppermine on a remote Website (MediaWiki). Am I right, that cpmFetch can only display random genrate pictures or the latest images from the coppermine gallery?
Is there a possibility for one every time the same specific image?
Thanks,
Robbi
I believe there is a way to request a photo by pid (photo id). I will have to check later - but I am pretty sure I added that in.
There's a function
cpm_viewMediaByPid($pid, [array $options=""])
However, any time I try to use it myself it results in the following error
QuoteFatal error: Call to a member function on a non-object in /cpmfetch.php on line 183
(Didn't include full server path on that quote...but you can probably understand why).
I'm pretty sure I'm doing way wrong. But here's the example of the code I'm using.
<?php
require_once('./cpmfetch/cpmfetch.php');
$objCpm = "";
$objCpm = new cpm($PartialUrlToCPG);
$options = array(
"imagelink" => "large",
"windowtarget" => "_blank");
$pid = 1;
$objCpm->cpm_viewMediaByPid($pid,$options);
$objCpm->cpm_close();
?>
oh yeah, I manually set the PID to see if it would work right that way, which I still ended up with the error.
(Why can't I edit my post?)
Oh yeah, running in 1.6.4 (no dev environment running right now for me)
Just messed with something (not sure what) now it says error on line 790 (same file)
Quote from: FlyingMongoose on January 17, 2007, 07:44:10 AM
There's a function
cpm_viewMediaByPid($pid, [array $options=""])
However, any time I try to use it myself it results in the following error
(Didn't include full server path on that quote...but you can probably understand why).
I'm pretty sure I'm doing way wrong. But here's the example of the code I'm using.
<?php
require_once('./cpmfetch/cpmfetch.php');
$objCpm = "";
$objCpm = new cpm($PartialUrlToCPG);
$options = array(
"imagelink" => "large",
"windowtarget" => "_blank");
$pid = 1;
$objCpm->cpm_viewMediaByPid($pid,$options);
$objCpm->cpm_close();
?>
Did you set $PartialUrlToCPG to anything or are you just passing an empty variable? The error you are getting generally means you are not getting the cpmfetch object constructed correctly.
Quote from: FlyingMongoose on January 17, 2007, 07:48:33 AM
Just messed with something (not sure what) now it says error on line 790 (same file)
Oh, thats magical
Quote from: Robbi99 on January 16, 2007, 07:15:42 PM
Hi,
I am a real newbie and intend to use cpmFetch to display specific images from Coppermine on a remote Website (MediaWiki). Am I right, that cpmFetch can only display random genrate pictures or the latest images from the coppermine gallery?
Is there a possibility for one every time the same specific image?
Thanks,
Robbi
Yeah, thats the function
$objCpm->cpm_viewMediaByPid($pid, [array $options=""])
okay changed to
<?php
require_once('./cpmfetch/cpmfetch.php');
$objCpm = "";
$PartialUrlToCPG = "/gallery";
$objCpm = new cpm($PartialUrlToCPG);
$options = array(
"imagelink" => "large",
"windowtarget" => "_blank");
$image = 1;
$objCpm->cpm_viewMediaByPid($image,$options);
$objCpm->cpm_close();
?>
and now the following problem occurs...
QuoteUnknown column 'u.user_id' in 'where clause'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /cpmfetch_dao.php on line 707
I'm on PHP 4.4.2
After much much searching I think I know what I need to do (I'm bridged with PHPBB), so I'm gonna have to go through and make some of the code reflect the PHPBB tables.
Alright so I got rid of the errors.
I've attached my modification to cpmfetch_dao.php (as a .txt file since .php is not allowed to be attached just rename it to .php) it should would with phpbb 2.0.22 (the version I'm using) bridged...
But I'm not getting any kind of output with the code, none whatsoever
<?php
require_once('./cpmfetch/cpmfetch.php');
$objCpm = "";
$PartialUrlToCPG = "/gallery";
$objCpm = new cpm($PartialUrlToCPG);
$options = array(
"imagelink" => "large",
"windowtarget" => "_blank");
$image = 1;
$objCpm->cpm_viewMediaByPid($image,$options);
$objCpm->cpm_close();
?>
am I doing something wrong?
Suggestion for your installer on the dev version:
Include a few different cpmfetch_dao.php files dependant on bridging, in readme/install files have user rename said included cpm_fetch_dao.php if they are bridged.
example
Default: cpm_fetch_dao.php
phpbb: cpm_fetch_dao_phpbb.php
smf: cpm_fetch_dao_smf.php
It may be an extra step, but it's less of these problems you really have to work with in the end....
nevermind on that last suggestion...I'm looking through your code on the new dev and I see you have a generic solution...
Quote from: FlyingMongoose on January 17, 2007, 06:32:35 PM
nevermind on that last suggestion...I'm looking through your code on the new dev and I see you have a generic solution...
Yes, in fact the last thing really holding up the dev becoming stable is:
1) I want it to autodetect a bridged configuration
2) At least one bridge fully enabled (probably smf since I use that, maybe phpbb also)
3) All other bridges get the default till I work them in.
That way no alternate files, no end user configuration changes, etc...
The dev version should allow you to set the bridged line in the cpmfetch_config.php to "phpbb" which should run the generic code and work for you.
Well, you have my dao file, with that you can probably get the information you need for PHPBB support (2.0.x anyway)
Also, I'm going to try to make current dev version work with it, so far i'm at least getting output from the function earlier discussed, currently I'm getting the following error (I have debug turned on so that I can get more info out of it):
Quotecpm_dao. Setting cfFilesystemPathToAlbums to //albums/
SQL : SELECT p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb, a.aid AS aAid, a.title AS aTitle, a.description AS aDescription, a.visibility as aVisibility, a.pos as aPos, a.category as aCategory, a.thumb as aThumb, a.keyword as aKeyword FROM cpg_pictures AS p, cpg_albums AS a LEFT JOIN cpg_categories AS c ON a.category = c.cid, cpg_users AS u WHERE p.aid = a.aid AND p.pid = 1 AND p.approved='YES' ROWS: 2
Error in getImageTouse: Extension (strtolower): .jpg File://albums/userpics/10003/thumb_k-soccer.jpg
Error in getImageTouse: Extension (strtolower): .jpg File://albums/userpics/10003/thumb_k-soccer.jpg
DEPRECIATED: Avoid using % style option array calls. Pls use {{ }} style
Error in getImageTouse: Extension (strtolower): .jpg File://albums/userpics/10003/thumb_k-soccer.jpg
I have
$cfg['cfBridgedTo'] = 'phpbb2018';
(that's default short bridge name in CPG)
and I have
$cfg['cfDebugMode'] = 'true';
(for the obvious)
I'm getting output, but no actual image is what I mean.
Quote from: FlyingMongoose on January 18, 2007, 01:46:41 AM
I'm getting output, but no actual image is what I mean.
Can you PM me the output from your install page?
The lower part is what I am interested in.
Strange that you are getting a double slash in the dev version... I thought I had that all ironed out.
Oh well.
I found that double slash, but that isn't where the problem is (there's a . "\" .) in _dao.php
if there's anywhere you'd like me to help I will, but I'm not exactly the greatest of coders (this is a brick wall to me...)
Quote from: FlyingMongoose on January 18, 2007, 01:46:41 AM
I'm getting output, but no actual image is what I mean.
Okay, its not finding the albums cause its looking in the wrong place.
One note: You will never see photos in THIS version of the install.php, because you are bridged. Everytime you rerun install it will wipe out your config file that you made the change too. So best to run it, change the bridged setting and move on.
Please post the code from the other page you are calling it from...
<?php
require_once('./gallery/cpmfetch/cpmfetch.php');
/* $objCpm = "";
$objCpm = new cpm($PartialUrlToCPG);*/
$objCpm = new cpm();
$options = array(
"imagelink" => "large",
"windowtarget" => "_blank");
$image = 1;
$objCpm->cpm_viewMediaByPid($image,$options);
$objCpm->cpm_close();
?>
I gave you a link: and I've modified the bridge file and it's not worked in the psat.
I think I told you: it works inside the cpmfetch directory inside my gallery, but I can't put it anywhere else, however I never get any kind of image output.
I pm'd you links
I am just having nothing but problems with the PHPBB bridge :-/ I can't display any images whatsoever...it gets DB info (it seems) it just has no display... :-/
Quote from: FlyingMongoose on January 22, 2007, 04:37:57 AM
I am just having nothing but problems with the PHPBB bridge :-/ I can't display any images whatsoever...it gets DB info (it seems) it just has no display... :-/
I PM'd you a code change to put in. Will be public in the next dev release - hopefully I will have that out tomorrow early evening.
Sorry for the delay in getting it to you.
Quote from: vuud on January 22, 2007, 05:06:59 AM
I PM'd you a code change to put in. Will be public in the next dev release - hopefully I will have that out tomorrow early evening.
Sorry for the delay in getting it to you.
To bring anyone up to date on this issue who may be experiencing the same problem...
The problem has been discovered as being an issue with how that web server is returning the SCRIPT_FILENAME variable. I think it has to do with how PHP is being executed on the server.
Hopefully this will be resolved soon...