CpmFetch - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG - Page 34 CpmFetch - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG - Page 34
 

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 - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG

Started by vuud, December 17, 2004, 10:19:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vuud

Quote from: fogpeople on July 08, 2005, 01:40:27 AM
Hi all,

I'm so very close (I think) to doing what I really want this mod to do.  Here's the URL in question:
http://www.fogpeople.org/test/test.php

Basically, the current background is a random image puller script from a directory of non-coppermine photos for testing.  The thumbs in the box on the page are a currently working install of CPMFetch.  On the right is a static block of what I want to be some stats about the random image pull.

I would like to able to have CPMFetch pull a single, random, full-size image and use it in the "background" declaration for the page, replacing the current random image rotator.  (ultimately I'll replace the coppermine gallery with full size background images)  THEN, I want to include some info about said image in the div on the page, namely the name of the uploader linked to their home page. 

Is there a way to isolate the random pulls so I can just drop the particular info as a variable or something where I want?  Combing the forums currently looking for an answer. 

Thanks!!!
-m


Yes, if the page you are pulling it with is a PHP page and you are using the lastest dev version you can.  I have to run out now, but when I get back I will post an example here for you.  Its slightly more involved than the existing ways, but not by much.

Install 1.3.9 and we will take it from there...  (1.3.9 is pretty much the next stable release, so don't worry) ... also coppermine.php is now cpmfetch.php - so remove the old one.

Talk to you soon


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

stez

hi vuud...

1.39 has fixed the filename problems as you predicted... I must buy your crystal ball...  ;)

Just have to start porting over the website to the new server soon in between yet more interviews...

Cheers,
Kyle

vuud

Quote from: fogpeople on July 08, 2005, 01:40:27 AM
I would like to able to have CPMFetch pull a single, random, full-size image and use it in the "background" declaration for the page, replacing the current random image rotator.  (ultimately I'll replace the coppermine gallery with full size background images)  THEN, I want to include some info about said image in the div on the page, namely the name of the uploader linked to their home page. 

Is there a way to isolate the random pulls so I can just drop the particular info as a variable or something where I want?  Combing the forums currently looking for an answer. 

Here is how you can use 1.3.9 or better to accomplish this:  The comments are inserted for educational purposes


<?php

// This tells it you want the data back, not pretty html tables
$objCpm->cpm_setReturnType('resultset');

// This gets an assocative array of the 1 random image from anywhere public in the album
$data $objCpm->cpm_viewRandomMediaFrom (11""); 

// This gets the image to display...
$imagename $objCpm->cpm->getImageToUse($data[0]['pFilepath'], $data[0]['pFilename'] ,"");

print 
"<img src='$imagename'>";

?>



You have to take the next step and figure out how to get $imagename into your background tag :)



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: marian on July 05, 2005, 09:43:47 AM
Quote from: vuud on July 04, 2005, 05:53:52 PM

Do yourself a favor and download the latest dev version instead.  It will save you time later as the filenames have changed and the install works a bit better...

I think its 1.3.9 and its at http://cpmfetch.fistfullofcode.com

It will be a stable release in about a week so its fine for use..., unless this other program kills me first.

I have done that and changed line 5, but I still have 1 Fail
80   CPG Config file not found: /home/bymnews/public_html/public_html/photos/include/config.inc.php   FAIL
I have tried various changes to the script, but I still get the error message with public_html in twice.
My latest change was to:
$testnumber = 80;
$cpgconfigfile = $_SERVER['DOCUMENT_ROOT'] . $ChangeThisToYourPartialUrlToCPG . '/photos/include/config.inc.php';
if (file_exists($cpgconfigfile)) {
   OutputTestRow($testnumber, "Found CPG config file", "PASS");
Sorry to have to ask, I did try to fix it myself.

Quote

I think I just completely missed this post... sorry about that.

There should not be a "/photos"  on the line above the if statement.

What did you put in for line 5 in the cftest file?  I suspect you put /public_html/photos...

if that is the case, change it to just "/photos"


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

Due to the size of this thread, and the fact that much of the information is from older releases and not really applicable anymore, I have started a new thread at:

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

Sorry for the inconvience, but it had to be done.

And with 1.4.0 STABLE coming out I figured what better time could there possibly be!!!!!!

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