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

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.

unknown_girl

Hi!
How do I use the cfimageget to get the 2 last photos uploaded?
Like for example the code:

$urltocpm = "/photos/";
$cpmfetch = new cfimageget($urltocpm);
$cpmfetch->setSourceString("cat=7");           
$cpmfetch->getRandom();


What do I change in this case, to display the 2 last images upload in the gallery?

vuud

Quote from: unknown_girl on July 05, 2005, 05:05:30 PM
Hi!
How do I use the cfimageget to get the 2 last photos uploaded?
Like for example the code:

$urltocpm = "/photos/";
$cpmfetch = new cfimageget($urltocpm);
$cpmfetch->setSourceString("cat=7");           
$cpmfetch->getRandom();


What do I change in this case, to display the 2 last images upload in the gallery?

Cfimageget can only get one photo at a time.

Are you putting this into a PHP page on the same site as the gallery?  cfimageget is for avatars, other web sites, etc...






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

unknown_girl

I'm puting like for example my site is: http://hilaryduff.hostingportugal.com , and the gallery is in http://hilaryduff.hostingportugal.com/fotos
so how can I show in my frontpage site the last uploaded photos...
I don't mind if is only one ... pls give me the code for one

vuud

Quote from: unknown_girl on July 05, 2005, 07:22:05 PM
I'm puting like for example my site is: http://hilaryduff.hostingportugal.com , and the gallery is in http://hilaryduff.hostingportugal.com/fotos
so how can I show in my frontpage site the last uploaded photos...
I don't mind if is only one ... pls give me the code for one

Is your top page a .php file?
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

unknown_girl

its htm... but I have no problem in creating my site in php :)

vuud

Quote from: unknown_girl on July 05, 2005, 10:27:18 PM
its htm... but I have no problem in creating my site in php :)

If want to do interesting things with cpmfetch, make your top page a php page

Then insert this

<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/fotos");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>

The above assumes you are using the latest dev version 1.3.9
The above assumes you put the program into a directory named cpmfetch under the root of the web site (change line 1 if this is not the case)

Once you get that working, poke through the example pages at this link for creative things to do

http://www.fistfullofcode.com/php-lib/showexternal.php?url=http://www.fistfullofcode.com/projects/copperminefetch/tests/index.php
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

unknown_girl


vuud

Quote from: unknown_girl on July 05, 2005, 11:10:27 PM
thanks
stez sorted it ...
Thanks again Stez...

Ah damnit.  I guess now stez is gonna expect his feature to be added...  ;)


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

Haha.   ;D  No, was online last night, noticed she was online too, so I thought why not?  As for the "feature" - it's not something I need atm, but I can see uses for it elsewhere/in future.  ;)

Sorry I haven't replied regarding your fix on the filename in 1.3 - been up and down the country for job interviews so haven't had a chance to play with it. 

kroberson

Hello!

Great Mod! However, Im trying to use the RandomMedia function and it keeps pulling only one image from my gallery (of only 3). Currently I have it set for LastAddedMedia but Id like to use the random one. Any suggestions? http://www.myspecialdog.com

Also, above this random image, Id like to say "Today's Special Dog is (nameofdog)"... how would I pull that from the database... I have nameofdog as File Title...

Kevin

vuud

Quote from: kroberson on July 06, 2005, 11:39:37 PM
Hello!

Great Mod! However, Im trying to use the RandomMedia function and it keeps pulling only one image from my gallery (of only 3). Currently I have it set for LastAddedMedia but Id like to use the random one. Any suggestions? http://www.myspecialdog.com

Also, above this random image, Id like to say "Today's Special Dog is (nameofdog)"... how would I pull that from the database... I have nameofdog as File Title...

Kevin


First, go to the latest dev version if you are not... the 1.4 stable release is imminent and will be exactly the same unless we find some bugs (which is just not possible)

Subtitle above is not possible... would you settle for for below the image?

$styleguide = array("subtitle" => "Today's special dog is %w");
$objCpm->cpm_viewRandomMediaFrom(1,1,"",$styleguide);

You also end up with the file extension on it though... I can probably fix that after the stable release (allow the basename)

Does that help?

Somewhere along the line I improved (with help) the randomization of things...  Forget if that was before the last stable or not.

Does that help?

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

kroberson

well, kinda... Im using CPMFetch v. 1.2.2. Is there a newer version than that? I am using CPG 1.3.3.

Unfortuantely the people's dog's names are attached to "File Title" and not the File Name. I didnt see any tags that allow for title... only name.

is this the reason its not randomizing?

vuud

Quote from: kroberson on July 07, 2005, 01:08:54 AM
well, kinda... Im using CPMFetch v. 1.2.2. Is there a newer version than that? I am using CPG 1.3.3.

Unfortuantely the people's dog's names are attached to "File Title" and not the File Name. I didnt see any tags that allow for title... only name.

is this the reason its not randomizing?

Ah try super-secret-not-for-just-anyone-if-you-tell-anyone-you-will-pay    %t = picture title

I guess I just never added it into the docs... I suck at docs.  I just dont have any desire - although I am re-writing them into what will hopefully be something useful.  Sorry about the ommission

http://cpmfetch.fistfullofcode.com <- see the downloads section for 1.3.9
(Its got 100's of new things over 1.2.x)

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

kroberson


kroberson

hmmm... well I upgraded to the new 1.3.9 version (which, by the way, you changed the coppermine.php to cpmfetch.php... caused some havoc on some pages but I figured it out  ;D)... the random is still having the "unrandom" features... check it out
http://www.myspecialdog.com on the spotlight at the right... keep refreshing and it pulls up the same every time. This is how Ive invoked the code. Do you see any mistakes?

<?php
include "/home/httpd/vhosts/myspecialdog.com/httpdocs/spotlight/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/spotlight');
$objCpm->cpm_viewRandomMedia ( 1, 1);
$objCpm->cpm_close();
?>


Thanks again for all your help!

vuud

Quote from: kroberson on July 07, 2005, 06:06:30 PM
hmmm... well I upgraded to the new 1.3.9 version (which, by the way, you changed the coppermine.php to cpmfetch.php... caused some havoc on some pages but I figured it out  ;D)... the random is still having the "unrandom" features... check it out
http://www.myspecialdog.com on the spotlight at the right... keep refreshing and it pulls up the same every time. This is how Ive invoked the code. Do you see any mistakes?

<?php
include "/home/httpd/vhosts/myspecialdog.com/httpdocs/spotlight/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/spotlight');
$objCpm->cpm_viewRandomMedia ( 1, 1);
$objCpm->cpm_close();
?>


Thanks again for all your help!

Yeah, I thought I mentioned it, but that must have been to someone else...  I put it in the release notes for the change, and the upcoming and added in a warning in the cftest...  good catch anyway.

The code as shown there looks good.  I just checked mine and my randomization seems okay.  I will check in there and see what is going on. 

Did you remove the coppermine.php file also?  The test shows its still there, but the test could be broken.  It does not matter since you are calling the right one, but you can remove it.

Otherwise you are on linux / apache / php which is what I develop on, so I am not sure why you would have problems and not me.  I will see...





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

kroberson

yup... totally wiped out the old set of files and just uploaded these.

thanks!

HeavenlyCurious

I get the following error:

CoppermineFetch Install test page

Thank you for using CoppermineFetch...
ERROR: Path to Coppermine incorrect. (/home/bnowpics/public_html../public_html/galleryindex//include/config.inc.php)

Your installation seems correct so far, you should see a small grid of thumbnails from your gallery

Fatal error: Call to a member function on a non-object in /home/bnowpics/public_html/cpmfetch/coppermine.php on line 648


I HAVE edited the cftest file. My gallery is stored in the galleryindex folder (../public_html/galleryindex), this addon CPMFetch, is installed in the CPMfetch folder (../public_html/cpmfetch). I edited the path into: ../public_html/galleryindex, but it still doesn't work. What am I doing wrong ?

vuud

Quote from: HeavenlyCurious on July 07, 2005, 10:41:33 PM
I get the following error:

CoppermineFetch Install test page

Thank you for using CoppermineFetch...
ERROR: Path to Coppermine incorrect. (/home/bnowpics/public_html../public_html/galleryindex//include/config.inc.php)

Your installation seems correct so far, you should see a small grid of thumbnails from your gallery

Fatal error: Call to a member function on a non-object in /home/bnowpics/public_html/cpmfetch/coppermine.php on line 648


I HAVE edited the cftest file. My gallery is stored in the galleryindex folder (../public_html/galleryindex), this addon CPMFetch, is installed in the CPMfetch folder (../public_html/cpmfetch). I edited the path into: ../public_html/galleryindex, but it still doesn't work. What am I doing wrong ?


So the partialurl is set to "/galleryindex"

Also try version 1.3.9 from the web site... the test program is actually useful now, and that one will be stable in about 2 days anyway.  Its fine for use..

Mind you coppermine.php is now cpmfetch.php, so remove the old version :)





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

fogpeople

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