Hey,
I tried all the combinations, but did not want to be displayed.
The test is good:
http://surfingcarpet.com/photogal/cpmfetch/cftest.php
I added the following to the html source of my page:
<?php
include "./photogal/cpmfetch/cpmfetch.php";
$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
And all I have is this:
http://surfingcarpet.com/lepetitprince.html
I am not an expert in php programming, but I think I am missing a code or something. I DID read again and again the instructions and the forum, but I cannot find my solution.
Any suggestions, I would very appreciate! ;D ;D ;D ;D
Thanks.
Oh, I forgot, I am using the latest Coppermine and the 1.4.9 cpmfetch.
Soory I meant 1.6.4! Any ideas????????? ::) :o ::) ??? ???
yeah - you can't run php code from a html-file.
you have to name the file .php instead of .html, and of course your server has to support running php-scripts.
Hey thanks bud!! :D
I was sure something was wrong. I changed to .php, now I have a fatal error instead
http://surfingcarpet.com/lepetitprince.php
The line 11 is where the </div> is below.
If any php expert can take a look at my code. I am sure there is just one thing missing ??? ??? ??? ??? :-[ :o... THANKS!!!
Here is my code from line 9 to line 31:
<title>Le Petit Prince: Voici mon secret</title><body background="images/back.gif">
<div align="center"><img src="images/heart/French.gif" width="613" height="96" />
</div>
<p align="center">
<html>
<title></title>
</head>
<body>
<?php
include "./photogal/cpmfetch/cpmfetch.php";
$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
</p>
<p align="center"> </p>
<p align="center"> </p>
<div align="center">
<p><img src="images/heart/Afrikaans.gif" width="613" height="121" /></p>
<p> </p>
<p><img src="images/heart/Arabic.gif" width="614" height="153" /></p>
Quote from: surfingcarpet on October 12, 2006, 08:28:25 PM
Soory I meant 1.6.4! Any ideas????????? ::) :o ::) ??? ???
You need to run it on a PHP page, or run a server side include to include a php page
Not quiet solved! :'(
I tried the ssi as indicated here : http://www.tactis.net/cpgimage/cpmfetch/docs/ch11.html
Followed up all the steps.
I still have an error: http://surfingcarpet.com/lepetitprince.shtml
and when I execute the php directly, I have also errors. http://www.surfingcarpet.com/photogal/cpmfetch/randomimages.php
I don't know what am I doing wrong. ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ???
It must be a directory mix up somewhere..?? :-\
This is the code in my randomimages.php file
<html>
<head>
<title></title>
</head>
<body>
<?php
include "./photogal/cpmfetch.php";
$objCpm = new cpm('/photogal');
$objCpm->cpm_viewLastAddedMedia(4,2);
$objCpm->cpm_close();
?>
</body>
</html>
Hi surfingcarpet,
This is marked solved. But you indicated it was not. What is the story?
I get almost similar error messages as yours. Just like yours, my "cftest.php" worked. [I changed the cpmfetch.php also to indicate the non-standard use of prefixes.]
CGC
Hi Karma,
YES, I don't know why they marked it solved! I am still trying to figure out, but almost gave up now. I will may be do a simple html rotating 10 pictures or so and give up cpmFetch... :-\ :'(
Quote from: surfingcarpet on October 24, 2006, 08:14:06 PM
Hi Karma,
YES, I don't know why they marked it solved! I am still trying to figure out, but almost gave up now. I will may be do a simple html rotating 10 pictures or so and give up cpmFetch... :-\ :'(
Actually CPMFetch is very good. I figured out what caused the error in mine -- it took me several hours of trial and error. The error was very simple really.
As it turned out I have several CPMfetch, they were named "cpmfetch", "cpmfetch-001", ..., "cpmfetch-007", ...etc.
In the opening statement, I was using:
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gal007');
?>
instead of:
<?php
include "./cpmfetch-007/cpmfetch.php";
$objCpm = new cpm('/gal007');
?>
so, it cannot find the correct album in the gallery (as specified in the "cpmfetch" directory). As a result, it spewed out almost the same error messages as you got. Yours may also be a compatibility in the name of the cpmfetch "directory" and the "albums" you are trying to fetch.
Of course, it could be something else.
CGC
Anyone have an idea about my problem? I am posting here, because someone has put my topic as "solved", but it is not! :P
http://forum.coppermine-gallery.net/index.php?topic=37241.0
You had this:
<?php
include "./photogal/cpmfetch/cpmfetch.php";
$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
Is it now in a php page?
If it is, try this:
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
Difference: the "/photogal" was not part of the "partial url". I think that should work. If not, I am curious what "photogal" is. Is it where your photos are kept? Or, a directory where you placed the "cpmfetch" script folder?
CGC
I forgot to add in my comments above (posted it prematurely). If you read the:
CPMFetch Manual (http://www.fistfullofcode.com/php-lib/showexternal.php?url=http://www.fistfullofcode.com/projects/copperminefetch/manual/index.html)
and followed it, your "photogal" should refer to the name of your "Coppermine PhotoGallery (CPG)" directory. Vuud can correct me on this, but as far as I know, before the version 1.9.3***, in general, the "Coppermine Fetch (cpmfetch) " directory (i.e., the v1.6.4) and the "php files" that will display the photos using "Coppermine Fetch" script aregenerally installed outside (separate, indpendent) of the "CPG" directory -- that is the whole point. I usually place mine in a different folder, together with the php files where the images outside of the CPG are displayed. Try that, you can name that separate directory any name you want, let us call it DirA, so that:
DirA
-> cpmfetch (the Coppermine Fetch directory)
-> "php files" (php files that will display your images using the "Coppermine Fetch")
if you do this, your script should still be:
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
Do not include the name of the CPG directory nor the name of the DirA, in the include statement. Just:
include "./cpmfetch/cpmfetch.php";
It works for me. If it does not work for you, then something else is not correct.
CGC
_________
***The procedure is different with the CPMFetch 1.9.3, it uses some features of CPG, so it is installed within the CPG, as one procedure. [It is possible to store outside, but I have not gotten that to work, yet.]
Quote from: surfingcarpet on October 26, 2006, 12:24:02 AM
Anyone have an idea about my problem? I am posting here, because someone has put my topic as "solved", but it is not! :P
yeah, my bad. For some reason when I posted that one you had php in html so I marked it off.
Apologies all around
Quote from: cgc0202 on October 26, 2006, 03:16:14 AM
I forgot to add in my comments above (posted it prematurely). If you read the:
CPMFetch Manual (http://www.fistfullofcode.com/php-lib/showexternal.php?url=http://www.fistfullofcode.com/projects/copperminefetch/manual/index.html)
and followed it, your "photogal" should refer to the name of your "Coppermine PhotoGallery (CPG)" directory. Vuud can correct me on this, but as far as I know, before the version 1.9.3***, in general, the "Coppermine Fetch (cpmfetch) " directory (i.e., the v1.6.4) and the "php files" that will display the photos using "Coppermine Fetch" script aregenerally installed outside (separate, indpendent) of the "CPG" directory -- that is the whole point. I usually place mine in a different folder, together with the php files where the images outside of the CPG are displayed. Try that, you can name that separate directory any name you want, let us call it DirA, so that:
DirA
-> cpmfetch (the Coppermine Fetch directory)
-> "php files" (php files that will display your images using the "Coppermine Fetch")
if you do this, your script should still be:
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
Do not include the name of the CPG directory nor the name of the DirA, in the include statement. Just:
include "./cpmfetch/cpmfetch.php";
It works for me. If it does not work for you, then something else is not correct.
CGC
_________
***The procedure is different with the CPMFetch 1.9.3, it uses some features of CPG, so it is installed within the CPG, as one procedure. [It is possible to store outside, but I have not gotten that to work, yet.]
Prior to the latest dev versions you could put it anywhere you wanted. If you wanted to put it inside the cpg directory you could. Due to 10000 user problems from figuring out relational directory stuff ( .. means up one ) I gave up and just started recommending you put it inside CPG so I could make a guess as to where it was without troubling anyone to know anything.
If the posts here from cgc0202 do not help, post here again. Sorry for closing the other topic... no idea what I was thinking.
This is your page you say is not working...
http://www.surfingcarpet.com/photogal/cpmfetch/randomimages.php
This is your error...
Failed opening './photogal/cpmfetch.php'
You are already in the cpmfetch directory... do you have a subdirectory named photogal inside that directory with another copy of cpmfetch.php inside it.
Change your include to have
./cpmfetch.php
. = same directory, .. = go up one, ../.. = means go up two directories...
Quote from: surfingcarpet on October 26, 2006, 12:24:02 AM
Anyone have an idea about my problem? I am posting here, because someone has put my topic as "solved", but it is not! :P
You should have kept replying to that thread instead of starting another one. After all, the "solved" label is just a tag. Your initial thread hasn't been locked to keep you from replying.
Merging your new thread with the original one, removing the "solved" label if this bothers you so much. Even though the thread has been labelled as "solved", supporters kept on answering your replies, so what's the actual issue?
Quote from: vuud on October 26, 2006, 04:15:32 AM
Change your include to have
./cpmfetch.php
. = same directory, .. = go up one, ../.. = means go up two directories...
Vuud,
The aforemention clarification has finally made me understand. Let me use the example, where the
cpmfetch is in
DirA while the "
static1.php files" are found in the following cases:
Case 1:"
cpmfetch" and "
static1.php files" in the same directory
DirA:
->"
cpmfetch" (the "coppermine fetch" script directory)
-> "
static1.php files" in group A1 including the common files, "top1.php" and "bottom.php" (files)
Case 2: "
static2.php files" are one sub-directory below "
cpmfetch". This is similar to the statement: "
cpmfetch" is one directory up the "
static2.php files"
->
DirA1: (sub-directory of DirA)
->-> "
static2.php files" in group A1 including the common files, "top2.php" and "bottom.php" (files)
Case 3: same as
Case 2:
->
DirA2: (sub-directory of DirA)
->-> "
static3.php files" in group A2 including the common files, "top3.php" and "bottom.php" (files)
Case 4: "
static2.php files" are two sub-directory levels below "
cpmfetch". This is similar to the statement: "
cpmfetch"are two sub-directory levels up the "
static2.php files"
->->
DirA2b: (sub-directory of DirA2)
->->-> "
static4.php files" in group A2b including the common files, "top4.php" and "bottom.php" (files)
etc.
So, here is the correct format, that works for most folks with just a single gallery:
Case 1<?php
include "./cpmfetch/cpmfetch.php";$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
Cases 2 & 3<?php
include "../cpmfetch/cpmfetch.php";$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
Case 4<?php
include "../../cpmfetch/cpmfetch.php";$objCpm = new cpmfetch("/photogal");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_viewLastAddedMedia(3,3);
$objCpm->cpm_close();
?>
Thanks.
CGC
Quote from: cgc0202 on October 26, 2006, 06:39:06 AM
... see post above...
No, but at least I see consistency in your madness.
Think of it this way. Whatever file you are using to display pictures in needs to know how to get from where it is, to where cpmfetch.php is... not the cpmfetch directory, that is just there because most of the time you are coming from outside.
So if you are in the same directory as cpmfetch.php then all of the following would work:
include "cpmfetch.php";
You are already in the same directory, so you just need to point at the file
include "./cpmfetch.php";
The single dot means "this directory" so this would work as well
include "../cpmfetch/cpmfetch.php";
The two dots means go up one directory (aka parent directory). So in this case this works, but is stupid. You are effectively going up one directory, then back into the cpmfetch directory and there is the file cpmfetch.php
So lets say your testpage.php is located like so:
/mystuff/subdirectory/testpage.php
and cpmfetch.php is installed like so:
/photos/cpmfetch/cpmfetch.php
How do you tell testpage.php where cpmfetch.php is in your include?
include "../../photos/cpmfetch/cpmfetch.php";
The first two dots bring you up into the mystuff directory
The second two dots bring you up into the root of your web site
The photos takes you down into the photo directory
The cpmfetch brings you into the cpmFetch directory
The cpmfetch.php names the file you want to include
I can't be much more help beyond this... So hopefully this cleared a few things up to you.
Vuud
@Vuud: I admire your patience ;)
Quote from: GauGau on October 27, 2006, 07:15:12 AM
@Vuud: I admire your patience ;)
Heh, it comes and goes.
I tend to be willing to match efforts with people... This guy obviously put a lot of thought and effort into working it out (see the length of posts) so I don't mind. Its the ones that just sit there saying "do it for me" that I don't go that far for.
So mileage varies :) But thanks for the compliment
I MADE IT!!!! IT WORKS!!!!!!!!!!!! ;D ;D ;D ;D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :) :) :) ;) :D :D ;D ;D!!!!!!!
I TOTALLY MADE IT YEEEAAAHHHH!!!!
Thanks guys!!!!!!!! your help SOLVED my problem!
As you said, it was precisely the location of my cpmfetch folder the problem.
The cpmfetch folder is inside the photogal folder where the coppermine was installed.
The confusion was that I had to be careful where to put the commands (different path in the php function and in the shtml).
for the php function, this was my code:
<html>
<head>
<title></title>
</head>
<body>
<?php
include "./cpmfetch.php";
$objCpm = new cpm('/photogal');
$objCpm->cpm_viewLastAddedMedia(4,2);
$objCpm->cpm_close();
?>
</body>
</html>
Logic, because it the file was inside the cpmfetch directory, no need to put ./photogal/cpmfetch/cpmfetch.php
And that worked perfectly:
http://www.surfingcarpet.com/photogal/cpmfetch/randomimages1.php
Once that worked, I had to tell the shtml code to execute this php and of course to be careful where is that file so I added this sentence where I wanted the pictures to be added:
<!--#include virtual="./photogal/cpmfetch/randomimages1.php" -->
AND THAT WORKED!
Thanks all of you guys!
I hope this problem will help troubleshoot other users. In that purpose, I named all the files differently and will keep the error files available on my server.
Good luck everyone and thanks again!
www.surfingcarpet.com
Quote from: surfingcarpet on October 30, 2006, 03:45:07 AM
I MADE IT!!!! IT WORKS!!!!!!!!!!!! ;D ;D ;D ;D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :) :) :) ;) :D :D ;D ;D!!!!!!!
I TOTALLY MADE IT YEEEAAAHHHH!!!!
Thanks guys!!!!!!!! your help SOLVED my problem!
The fact that you understand why it works and can now apply that makes all the help worthwhile - it makes my whole evening.
Good luck, CPG and PHP are your oyster now... lots you can do.