forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Jared5755 on May 04, 2009, 06:23:42 pm

Title: cfimageget.php delivers broken image
Post by: Jared5755 on May 04, 2009, 06:23:42 pm
My main goal is to display an image on my phpBB index page.  I've tried displaying it the normal way (with the php function calls described in docs), but can't seem to get it displayed on my forums.  My test page works...where all I do is display a few random images from my gallery.  So, cpmFetch is working it appears.

So, now I'm trying to go the route of using cfimageget.php to display the image.  I am first trying just a test page that should only display 1 random image from my gallery.  But, all it's displaying is a broken image.

Test page:
Quote
<img src="../gal/cpmfetch/cfimageget.php" />

Link to gallery:
Quote
http://freeridelounge.net/gal/

First part of cfimageget.php:
Quote
require_once "cpmfetch_dao.php";

// CHANGE THIS TO TRUE IF PEOPLE ARE ALLOWED QUERIES THROUGH HERE
$ALLOW_DIRECT_ACCESS = true;

if ($ALLOW_DIRECT_ACCESS && substr($_SERVER['SCRIPT_FILENAME'],-14) == "cfimageget.php") {
   
// This one you need to adjust unless your galler is at http://www.youname.com/photos
// If you installed right to the root of your web site, just use a /
// TODO This should be path to config file
$urltocpm = "../gal/";
$pathToConfigFile = "../gal/cpmfetch/";

// If no cmd= is submitted, it will do this:   
   $default_command = "random";

Title: Re: cfimageget.php delivers broken image
Post by: fangweile on May 10, 2009, 11:50:29 am
I have the same problem a long time ago and i used this as a fix for my problem.

I extracted cfimageget.php from the copperminefetch-2.1.1-dev and overwrite the cfimageget.php from v. 2.0 and it works like a charm.
No need to edit any code from file.

Download the attached file cfimageget.txt (change the extension to .php) and upload it to your galleryroot/cpmfetch/ directory.
Then visit that page  http://freeridelounge.net/gal/cpmfetch/cfimageget.php
If the image appears, you will now start embedding random pictures in html tag.

Hope that it will work for you too.

Enjoy
Title: Re: cfimageget.php delivers broken image
Post by: Jared5755 on May 10, 2009, 01:23:00 pm
Thanks a lot!  Will try it out when I get back in town.