I cannot get my images displayed! I cannot get my images displayed!
 

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

Main Menu

I cannot get my images displayed!

Started by surfingcarpet, October 12, 2006, 06:46:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

surfingcarpet

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.



surfingcarpet

Oh, I forgot, I am using the latest Coppermine and the 1.4.9 cpmfetch.

surfingcarpet


my evil twin

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.

surfingcarpet

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">&nbsp;
<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">&nbsp;</p>
<p align="center">&nbsp;</p>
<div align="center">
  <p><img src="images/heart/Afrikaans.gif" width="613" height="121" /></p>
  <p>&nbsp;</p>
  <p><img src="images/heart/Arabic.gif" width="614" height="153" /></p>

vuud

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

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

surfingcarpet

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>

cgc0202

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

surfingcarpet

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...  :-\ :'(


cgc0202

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

surfingcarpet

Anyone have an idea about my problem? I am posting here, because someone has put my topic as "solved", but it is not!  :P


cgc0202

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

cgc0202

I forgot to add in my comments above (posted it prematurely).  If you read the:

CPMFetch Manual

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


vuud

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

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














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

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?

cgc0202


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














vuud

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












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