forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: content syndication (cpmFetch) => Topic started by: kousik on November 10, 2005, 12:17:36 pm

Title: Thumbnail of the last uploaded image
Post by: kousik on November 10, 2005, 12:17:36 pm
Hi. I was trying to fetch the thumbnail of the last uploaded image from some other webpage. I ended up writing a few lines:
Code: [Select]
<?php
Header
('Content-Type: image/jpeg');
define('IN_COPPERMINE'true);
require(
'include/init.inc.php');
$pic_data get_pic_data('lastup'$thumb_count$album_name, -11);
$pic_url =  get_pic_url($pic_data[0], 'thumb');
readfile($pic_url);
?>

Saved it as "lastimage.php", and in the original page, all we need to do
Code: [Select]
<img src="http://my.photo.gallery/cpg/lastimage.php">Any correction/heads up would be most welcome.

regards
Kousik.
http://kousik.blogspot.com/2005/10/last-image-in-coppermine.html
Title: Re: Thumbnail of the last uploaded image
Post by: johnner on January 04, 2006, 06:31:36 pm
Is there anyway to just get the date that the last image was uploaded?  I would like to include a link on my main page that says Images last uploaded x/xx/xxxx, and then a link to the latest uploads.  Any info would be greatly appreciated.
Title: Re: Thumbnail of the last uploaded image
Post by: vuud on January 04, 2006, 08:45:07 pm
Is there anyway to just get the date that the last image was uploaded?  I would like to include a link on my main page that says Images last uploaded x/xx/xxxx, and then a link to the latest uploads.  Any info would be greatly appreciated.


You can extend cpmfetch to get stuff like the last dates and stuff...
http://www.fistfullofcode.com/projects/copperminefetch/tests/test6.php

http://www.fistfullofcode.com/projects/copperminefetch is the actual site.

Title: Re: Thumbnail of the last uploaded image
Post by: johnner on January 04, 2006, 10:50:23 pm
Awesome!  Thanks, however I am getting an error despite having the config.inc.php in the correct location.  I did find some issues like this on the forum, but they are all in French :(  Here is the error I get.

80   CPG Config file not found: /www/.../gallery/include/config.inc.php
Title: Re: Thumbnail of the last uploaded image
Post by: bajs on May 23, 2006, 08:26:07 pm
I tried and I ended up with a red cross  ???
Title: Re: Thumbnail of the last uploaded image
Post by: bajs on May 24, 2006, 11:51:09 am
im not even sure if THIS is the code I am lookin for.

I simply want something exactly like
http://jessicaalba.org
http://bynesonline.com/
http://brendonurie.net/

In the sidebar, you can see "latest photos added" and thena  link to the gallery with the photos.

I want that. I tried your code but it wouldn't work out for me. Instead, I got a "red cross"

Worth mentioning is that I have my gallery and main site hosted on two different servers
Title: Re: Thumbnail of the last uploaded image
Post by: Tranz on May 24, 2006, 03:53:20 pm
If you are using hotlink protection, make sure to whitelist the second domain in your gallery's list. If that's not the problem, post a link to the page showing the red cross.
Title: Re: Thumbnail of the last uploaded image
Post by: bajs on May 24, 2006, 11:36:27 pm
i don have hotlinking disabled.

http://elijah.netg.se/header.php
under "projects" sidebar, left side, middle/top
Title: Re: Thumbnail of the last uploaded image
Post by: bajs on June 03, 2006, 01:01:23 pm
oho?
Title: Re: Thumbnail of the last uploaded image
Post by: Joachim Müller on June 03, 2006, 01:46:34 pm
If that's not the problem, post a link to the page showing the red cross.
Title: Re: Thumbnail of the last uploaded image
Post by: bajs on June 17, 2006, 01:34:11 pm


I did post a link.
Title: Re: Thumbnail of the last uploaded image
Post by: David McKim on August 19, 2006, 07:01:35 am
I don't know if this is possible, but if it is please give me the code.

I was hoping to be able to show the latest image from a specific user, can this be done?
Title: Re: Thumbnail of the last uploaded image
Post by: Joachim Müller on August 19, 2006, 12:49:59 pm
I did post a link.
but not one that leads to the page you're having issues with. Are you trying to be confrontational? Just do as suggested.
Title: Re: Thumbnail of the last uploaded image
Post by: appelmoes2008 on November 20, 2006, 10:15:49 pm
I would like to display just one picture on the frontpage of my website. So far, so good.

Works fine like this:

<?php
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm('/departementen/archief/fotoalbum');
$objCpm->cpm_viewLastAddedMedia(1,1, array( 'imagewidth' => '282' , 'imagesize' => 'int' ));
$objCpm->cpm_close();
?>

But I would actually like this to be a random picture picked only from the last album added.

Anyone know's if this is possible?

Thanks
Title: Re: Thumbnail of the last uploaded image
Post by: Joachim Müller on November 21, 2006, 05:40:51 am
This thread doesn't deal with cpmFetch, but with another unrelated hack that deals with content syndication. Don't try to hijack this thread. In fact, there's a whole sub-board dedicated to cpmFetch-support (http://forum.coppermine-gallery.net/index.php?board=87.0). Post your question there. Locking this thread.