Is there a better way? "Calling CPMFetch" and Fetching Multiple Galleries Is there a better way? "Calling CPMFetch" and Fetching Multiple Galleries
 

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

Is there a better way? "Calling CPMFetch" and Fetching Multiple Galleries

Started by cgc0202, October 26, 2006, 12:10:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cgc0202

Multiple CPMFetch calls to different galleries in one Page?

The point raised here is related to the aforementioned topic, but addresses a different issue, altogether.  To summarize the previous thread, I was able to use a single CPMFetch program to access and display images coming from multiple galleries -- thanks to a more elegant script suggested by Vuud,  simplifying my suggested strategy, outlined in the aforementioned thread. 

The issue raised here deals with how best to group (potentially) tens of thousands of the static php files -- more systematically --  that will display the images fetched by "copperminefetch" developed by Vuud.  Right now here is what I do, to systematically order the static php files that present the images.  Let us refer to DirA, as the directory where the "copperminefetch" and the files are located:

DirA:
->"copperminefetch" (a script directory)
-> "static php files" including the common files, "top.php" and "bottom.php" (files)

from the above format, here is the "open" script (placed in a separate page, called "top.php"):

<?php
include "./cpmfetch/cpmfetch.php";
$objCpm001 = new cpm('/gal001');
(etc.)
?>

where "(etc)" refer to the other statements in the "open" script. The "close" script is in a separate page, called "bottom.php" and both are summoned as part of "include" scripts in each of the static pages. Anyway, the above set up works.

[I had the "include "./cpmfetch/cpmfetch.php";" statement in the "open" in bold because I think it will be key to solving the error I encountered.  The solution might actually be very simple, but I have no background in scripting and it has eluded me so far.  I found a solution as outlined below, but  I do not think it is the best strategy.]

So, here is what I plan to do:  I want to place the "static php" files in subfolders, so that it is easier to find them, in case there is a need to edit:

DirA:
->"cpmfetch" (the "coppermine fetch" script directory)
->DirA1: (sub-directory of DirA)
->-> "static php files" in group A1 including the common files, "top.php" and "bottom.php"  (files)
->DirA2: (sub-directory of DirA)
->-> "static php files" in group A2  including the common files, "top.php" and "bottom.php" (files)
->->DirA2b: (sub-directory of DirA2)
->->-> "static php files" in group A2b  including the common files, "top.php" and "bottom.php" (files)
etc.

The bottom line, it does not work.  I think, it is because I have not written the correct address of the "cpmfetch.php" in the statement:

include "./cpmfetch/cpmfetch.php";

in the "open script" part of cpmfetch, included in the  common "top.php" file.  I tried all sorts of variations as suggested in the v1.9.3 -- such as changing it to

include "../cpmfetch/cpmfetch.php";
include "././cpmfetch/cpmfetch.php";
include "../../cpmfetch/cpmfetch.php";

etc. (adding the directory path of the "cpmfetch" -- short of including the complete URL. [I tried the latter too.] I got error messages in various examples (see below).

The only solution I found to work was including a complete "cpmfetch" in each of the subdirectories created.  I can live with it, if that is the only way to do it.  However, there must be a simpler way, and I think it has got to do with the way

include "../cpmfetch/cpmfetch.php";

was summoned.

Thanks.

CGC

Note: 

An even better solution is the possible presence of "open source" programs that creates databases of the php files, so that there is no need to group them manually in subdirectories as outlined above.

___________


Warning: main(./cpmfetch/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in/(website-dir-route)/top-test2b.php on line 4

Warning: main(./cpmfetch/cpmfetch.php) [function.main]: failed to open stream: No such file or directory in/(website-dir-route)/top-test2b.php on line 4

Warning: main() [function.include]: Failed opening './cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in/(website-dir-route)/top-test2b.php on line 4

Fatal error: Cannot instantiate non-existent class: cpm in/(website-dir-route)/top-test2b.php on line 5

where (website-dir-route) is the website route path in the server.




Joachim Müller

Including cpmFetch several times would re-define functions and classes. What you're up to doesn't work that way.

cgc0202

Thanks Gaugau,

I think the more clarification of Vuud in the another thread (of another poster) made it more clear for me now.... I  will post the correct procedure here, after Vuud clarified my  response to his more recent post.

CGC

vuud

Quote from: cgc0202 on October 26, 2006, 05:43:42 AM
Thanks Gaugau,

I think the more clarification of Vuud in the another thread (of another poster) made it more clear for me now.... I  will post the correct procedure here, after Vuud clarified my  response to his more recent post.

CGC

I won't pretend to understand what you are doing up there... but I recently wrote a proposal that may involve extended cpmFetch to get more information at a higher level (like gallery listings and such).  Those will be imported into the program.  That may help you to accomplish what you want in one file instead of creating a lot of seperate files.

I always prefer an hour of programming over an hour of making static files...


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