CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 2 CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 2
 

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

CpmFetch 1.4 On... Displaying data and images from CPG on your website

Started by vuud, July 08, 2005, 06:43:10 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

mikedown

guys i have trouble with this one... i can get the random images to run in my .html site
i already fixed the test and everything works great even saw the thumbnails in the test page

im having trouble with step 4

Step 4. Add a few calls into a test page.
Into a .php page (or one that is executed as one) in the same directory that contains your CoppermineFetch directory , add the following php statements.

Note: This example assumes that you have the Coppermine Photo Gallery installed into a directory named "gallery" right off the root of your websites. So if you were to go to a web browser and enter http://www.yourwebsite.com/gallery - you would get Coppermine.

<?php
include "./CoppermineFetch/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>

The lines above do this:
This includes the cpmfetch program objects.
This creates the cpmfetch object - you include the partial URL to your coppermine install.
This one of many calls you can make to the program. This displays 6 random images in 3 rows x 3 columns.
This line closes the database connections the object has.
In a real page, you could have the first two lines at the top of your file, the close at the bottom and any number of calls in between.


anyone can help me? i can figure this one out

vuud


If you are including them on HTML pages, you need to do it in a PHP and include that file.  See the other thread in the cpmfetch forum for SSI... there is an example.

Also since 1.4 (if you installed that) the coppermine.php is called cpmfetch.php... I have not updated the doc's yet as they are being completely re-written.







Quote from: mikedown on July 09, 2005, 11:03:22 AM
guys i have trouble with this one... i can get the random images to run in my .html site
i already fixed the test and everything works great even saw the thumbnails in the test page

im having trouble with step 4

Step 4. Add a few calls into a test page.
Into a .php page (or one that is executed as one) in the same directory that contains your CoppermineFetch directory , add the following php statements.

Note: This example assumes that you have the Coppermine Photo Gallery installed into a directory named "gallery" right off the root of your websites. So if you were to go to a web browser and enter http://www.yourwebsite.com/gallery - you would get Coppermine.

<?php
include "./CoppermineFetch/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>

The lines above do this:
This includes the cpmfetch program objects.
This creates the cpmfetch object - you include the partial URL to your coppermine install.
This one of many calls you can make to the program. This displays 6 random images in 3 rows x 3 columns.
This line closes the database connections the object has.
In a real page, you could have the first two lines at the top of your file, the close at the bottom and any number of calls in between.


anyone can help me? i can figure this one out

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

mrmike987

Does anyone here know how to add     <?php $objCpm->cpm_viewLastAddedMedia(1,2)  ?>
to a block in phpnuke?

mikedown

i did what was in the other thrend and this is the message that showed up

this is what i placed in my .php file
<?php 
include "gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$objCpm->cpm_viewLastAddedMedia(4,2); 
$objCpm->cpm_close(); 
?>


i was trying to open the .php file with this code...
<iframe src="http://www.reefphilippines.com/gallery/cpmfetch/randomimages.php" framespacing="0" frameborder="no" border="0" bordercolor="#FFFFFF"" height="200" width="600" scrolling="no"></iframe>

and this is what it displayed..

Warning: main(gallery/cpmfetch/cpmfetch.php): failed to open stream: No such file or directory in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 2

Warning: main(gallery/cpmfetch/cpmfetch.php): failed to open stream: No such file or directory in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 2

Warning: main(): Failed opening 'gallery/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 2

Fatal error: Cannot instantiate non-existent class: cpm in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 3


im sooo lost with step 4 pls help me out this is a great program but i can get the final steps....


vuud


If the randomimage thing is in the cpmfetch directory, try this include instead.

include "./cpmfetch.php";


Quote from: mikedown on July 10, 2005, 04:28:56 AM
i did what was in the other thrend and this is the message that showed up

this is what i placed in my .php file
<?php 
include "gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
$objCpm->cpm_viewLastAddedMedia(4,2); 
$objCpm->cpm_close(); 
?>


i was trying to open the .php file with this code...
<iframe src="http://www.reefphilippines.com/gallery/cpmfetch/randomimages.php" framespacing="0" frameborder="no" border="0" bordercolor="#FFFFFF"" height="200" width="600" scrolling="no"></iframe>

and this is what it displayed..

Warning: main(gallery/cpmfetch/cpmfetch.php): failed to open stream: No such file or directory in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 2

Warning: main(gallery/cpmfetch/cpmfetch.php): failed to open stream: No such file or directory in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 2

Warning: main(): Failed opening 'gallery/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 2

Fatal error: Cannot instantiate non-existent class: cpm in /home/virtual/site123/fst/var/www/html/gallery/cpmfetch/randomimages.php on line 3


im sooo lost with step 4 pls help me out this is a great program but i can get the final steps....


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: mrmike987 on July 09, 2005, 05:49:56 PM
Does anyone here know how to add     <?php $objCpm->cpm_viewLastAddedMedia(1,2)  ?>
to a block in phpnuke?

There is a thread for that sort of thing... gotta keep the place clean ya know

http://forum.coppermine-gallery.net/index.php?topic=19528.0
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

Daethian

Okay I'm sure this is something simple but I have no idea what I'm doing!  I want to use cpmfetch to show random images on my xoops set up.  I installed it and ran the test and I got pass/info and no errors.   I made the custom block but no images will show up in it.  I just want one image. 


include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I also tried

include "./coppermine/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I'm an intermediate user
my test set up is http://foreverpurple.com/xoopstest/index.php
my gallery is http://foreverpurple.com/gallery/index.php
version is 1.3.2
"How naked?
4th base naked."

vuud

Quote from: Daethian on July 12, 2005, 08:51:27 AM
Okay I'm sure this is something simple but I have no idea what I'm doing!  I want to use cpmfetch to show random images on my xoops set up.  I installed it and ran the test and I got pass/info and no errors.   I made the custom block but no images will show up in it.  I just want one image. 


include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I also tried

include "./coppermine/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();


I'm an intermediate user
my test set up is http://foreverpurple.com/xoopstest/index.php
my gallery is http://foreverpurple.com/gallery/index.php
version is 1.3.2


I guess Xoop is some sort of framework?  Like Nuke or e101?  Where in xoop are you inserting the code?  Where ever you put it has to be able to execute PHP otherwise it will not work.  Check that and then post back to the board about embedding in other programs ...  also in the cpmfetch child board here.

Thanks
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

Daethian

Yes its like Nukeportal.

The custom module I created  has an option to use 'php script'  I'm also fairly certain it should work because someone from XOOPS sent me here to get this program from you.
"How naked?
4th base naked."

vuud

Quote from: Daethian on July 12, 2005, 10:37:49 PM
Yes its like Nukeportal.

The custom module I created  has an option to use 'php script'  I'm also fairly certain it should work because someone from XOOPS sent me here to get this program from you.

I'd be simply thrilled if you posted to the other forum

http://forum.coppermine-gallery.net/index.php?topic=19528.0

I will check out Xoops and respond in that forum
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

xmystique

would i be able to use this to put a random image block onto the sidebar of an existing gallery template?

for instance, i am using the grey satin template. instead of having the "Random Image" block in the {GALLERY} section, could i move it over to the sidebar under where all the navigational links {MAIN_MENU} is located?

would i just use a php include in the "template.html" file? or is this not possible at all?

vuud

Quote from: xmystique on July 13, 2005, 06:40:31 AM
would i be able to use this to put a random image block onto the sidebar of an existing gallery template?

for instance, i am using the grey satin template. instead of having the "Random Image" block in the {GALLERY} section, could i move it over to the sidebar under where all the navigational links {MAIN_MENU} is located?

would i just use a php include in the "template.html" file? or is this not possible at all?

Sorry, if I yell at one person I have to yell at them all.

This post belongs thus-in:
http://forum.coppermine-gallery.net/index.php?topic=19528.0


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

mikedown

thanks vuud! your code works great! :)
can i mod the random images so when i click the random image it opens a new browser for the image?
target="_blank" kinda thing?

xmystique

i apologize, i looked at the other thread you mentioned, and noticed that someone had a question very similar to mine that was never answered. i assumed i wouldnt be using CPIMAGEGET for this since you mention under "bad uses" that using it on the same page as the gallery itself is no good, which is exactly what i want to do.

i have checked out cftest.php and there are no problems. http://www.seventhstranger.net/gallery/cpmfetch/cftest.php
i created a new file with the given code and it works fine : http://www.seventhstranger.net/gallery/cpmfetch/random.php

however, when i try to include the random.php file into my template.html, nothing comes up. (i am trying to put the "random image" feature in my sidebar along with the navigation) It's not messing up my template, the gallery template still works fine, however the php include isnt working, it just shows nothing.

am i supposed to put this include in a different file? is there another magical way to include my random.php file into my gallery template?

EDIT: well i just tried to include the random.php file into another html file other than template.html and it worked fine: http://www.seventhstranger.net/gallery/whatever.html

so is this just impossible to use in the template at all? or am i completely missing something?

vuud

Quote from: xmystique on July 13, 2005, 03:32:18 PM
i apologize, i looked at the other thread you mentioned, and noticed that someone had a question very similar to mine that was never answered. i assumed i wouldnt be using CPIMAGEGET for this since you mention under "bad uses" that using it on the same page as the gallery itself is no good, which is exactly what i want to do.

i have checked out cftest.php and there are no problems. http://www.seventhstranger.net/gallery/cpmfetch/cftest.php
i created a new file with the given code and it works fine : http://www.seventhstranger.net/gallery/cpmfetch/random.php

however, when i try to include the random.php file into my template.html, nothing comes up. (i am trying to put the "random image" feature in my sidebar along with the navigation) It's not messing up my template, the gallery template still works fine, however the php include isnt working, it just shows nothing.

am i supposed to put this include in a different file? is there another magical way to include my random.php file into my gallery template?

EDIT: well i just tried to include the random.php file into another html file other than template.html and it worked fine: http://www.seventhstranger.net/gallery/whatever.html

so is this just impossible to use in the template at all? or am i completely missing something?


Sorry for the confusion... the thread I referred you to is for embedding in into templates and such, not specifically using cfimageget or any particular type.

I know this would be possible via cfimageget as you would just need to call it in a img src tag... but that is not the best.  I have to check the templates to see if you can execute PHP in them...  if you can, this is doable, if not then its gonna be more complicated.  I'll poke at mine a little later and see how it works...  I did my own theme awhile back, but forget how all that comes together.  I'll post into the other thread the results.

Later

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

marian

I'm not really a newbie, it's just that I don't have time to really learn php, so stay in a state of not really understanding instructions. I guess I'm not alone in that, so I thought I'd post something about how I, with vuud's help, discovered what I should be doing.
During the course of various goes at trying to sort it, I had coppermine fetch installed in the root directory and in public_html. It didn't work at all when installed in the root directory.
When trying to sort out cftest.php I made a lot of mistakes and got in a complete muddle, so I uninstalled everything to do with CMF, from the server and my laptop, and started again. This time I intended to change one thing at a time in cftest and try it to see what FAILS remained, before going on to the next change. To my amazement, having just put the partial URL /photos in line 5, I was rewarded by images. So DO NOT change anything in cftest except line 5 (the file gives a newbie the impression that you need to change to the partial URL in several places, but you dont) and DO NOT put the partial URL as /public_html/photos even though copperminefetch is in public html; the name of your coppermine directory is all that is neededl.
I still had probs when I tried to get a test php file to work, even though I tried putting it in various directories I kept getting an error message "cannot open string ............  does not exist" Then I found a post that told someone else to try just using include "./cpmfetch.php" and it worked instantly.
Hope this helps some people.


Hooligan

I don't know where to post this question, so I'll post it here.

Got Cpmfetch working in a test htm page, by adding a couple of line to my .htaccess:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

and the following to an htm file:

<?php
include "gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');

$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMedia (2,4);

$objCpm->cpm_close();
?>

But what I'd like to be able to do is have the Album display on the htm page just the way it does in cpg. Possible with fetch? Or is there another way?
You know, Hobbes, some days even my lucky rocketship underpants don't help.

vuud

Quote from: Hooligan on July 13, 2005, 07:02:43 PM
I don't know where to post this question, so I'll post it here.

Got Cpmfetch working in a test htm page, by adding a couple of line to my .htaccess:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

and the following to an htm file:

<?php
include "gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/gallery');

$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewLastAddedMedia (2,4);

$objCpm->cpm_close();
?>

But what I'd like to be able to do is have the Album display on the htm page just the way it does in cpg. Possible with fetch? Or is there another way?

Wow, so basically you just convinced the web server that all you html pages are really PHP pages.  Interesting approach.

You can also serve cpmfetch information up via the SSI in apache - which would allow you to probably get away with the XBITHACk on....

Check out this thread... it has an example.  You should not have too much trouble with it.

http://forum.coppermine-gallery.net/index.php?topic=18547.0

I am going to add your approach to the docs though...  :)


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

mrmike987

From old forum:

$objCpm->cpm_viewLastAddedMediaFromAlbum(1,1,4,array("subtitle" => "The gallery was last updated:<br>%w","imagelink" => "album", cellattributes" => array("align"=>"center")));

Will align the contents of the TD tag
----------------------------------------------------------------
Gives error:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'

vuud

Quote from: mrmike987 on July 14, 2005, 01:10:03 AM
From old forum:

$objCpm->cpm_viewLastAddedMediaFromAlbum(1,1,4,array("subtitle" => "The gallery was last updated:<br>%w","imagelink" => "album", cellattributes" => array("align"=>"center")));

Will align the contents of the TD tag
----------------------------------------------------------------
Gives error:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'


Parse errors almost always mean you did something wrong.  I would have caught something like that before shipping code.

In this case... you are missing a quote before cellattributes.


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