forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: content syndication (cpmFetch) => Topic started by: djib on January 15, 2006, 01:30:56 pm

Title: Display a random image on an external website.
Post by: djib on January 15, 2006, 01:30:56 pm
Hello,
How can I display a random image taken from my coppermine gallerie on some other website ?
Thanks.
Title: Re: Display a random image on an external website.
Post by: djib on January 15, 2006, 04:03:39 pm
I found a solution.
Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - random photo displayer                         //
// ------------------------------------------------------------------------- //
// Based on Dr. Tarique Sani RSS feed for Coppermine                         //
// http://tariquesani.net/                                                  //
//
// Adapted by djib to display a random photo - http://djib.biz              //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
// ------------------------------------------------------------------------- //
// Just put into the same directory as your coppermine installation         //
// ------------------------------------------------------------------------ //

define('IN_COPPERMINE'true);
define('INDEX_PHP'true);
require(
'include/init.inc.php');

//How many items you want to show
$thumb_per_page 1;

$thumb_count 4;
$lower_limit 0;


$album 'random';


//Changes these to point to your site if the following is not giving correct results.
$link_url $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url $CONFIG['ecards_more_pic_target']."albums/";


$data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);


foreach(
$data AS $picture) {

    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$keywords explode(" ",trim($picture[keywords]));
    
$category_string "";
    
$pubDate gmdate("D, d M Y H:i:s"$picture[ctime]);
    
$description '<a href="' $link_url $picture['pid'] . '"><img src="' $thumb_url '"  alt="Random image"/></a>'.bb_decode($picture[caption]).bb_decode($picture[caption_text]);    
    echo 
$description;
}

?>


After that, just add <?php include(http://yoursite/get_photo.php); ?> where you want to display the photo.

Title: Re: Display a random image on an external website.
Post by: Joachim Müller on January 15, 2006, 10:35:59 pm
http://forum.coppermine-gallery.net/index.php?board=57.0
Title: Re: Display a random image on an external website.
Post by: mqcarpenter on February 25, 2006, 05:23:59 pm
djib that is EXACTLY what I needed. Thank you! And it is super simple, unlike the cpmfetch idea.
One note: you forgot your quotes on the include:

Code: [Select]
<?php include("http://yoursite/get_photo.php"); ?>
Title: Re: Display a random image on an external website.
Post by: djib on March 11, 2006, 07:07:18 pm
I'm happy you like it mqcarpenter.
Thanks for spotting the error in the include.

Here is a new version of the script that allows to display a chosen number of photos. Photos are now picked up randomly even in one album.

For example get_photo?album=6&nb=4 will display 4 photos from album 6.


Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) Dr. Tarique Sani                                           //
// http://tariquesani.net/                                                  //
// Adapted by djib to display a random photo - http://djib.biz              //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
// ------------------------------------------------------------------------- //
// Just put into the same directory as your coppermine installation         //
// ------------------------------------------------------------------------ //

define('IN_COPPERMINE'true);
define('INDEX_PHP'true);
require(
'include/init.inc.php');

//How many items you want to show in your get_photo script
if(isset($_GET['nb'])) {
     
$thumb_per_page=$_GET['nb'];
} else {
     
$thumb_per_page 4;
}
$thumb_count 4;
$lower_limit 0;

if(isset(
$_GET['album'])){
    
$album $_GET['album'];
}

//If it is a numeric album get the name and set variables
if ((is_numeric($album))){
     
$album_name_keyword get_album_name($album);
     
$CURRENT_CAT_NAME $album_name_keyword['title'];
     
$ALBUM_SET "AND aid IN (".(int)$_GET['album'].")".$ALBUM_SET;
     
//Set the album to last uploaded
     
$album 'random';
}

//If the album is not set set it to lastup - this is the default
if(!isset($album)){
     
$album 'random';
}


//Changes these to point to your site if the following is not giving correct results.
$link_url $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url $CONFIG['ecards_more_pic_target']."albums/";


$data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);


foreach(
$data AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '"><img src="' $thumb_url '"  alt="Photo aléatoire"/></a>';
    echo 
$description;

}
?>

Title: Re: Display a random image on an external website.
Post by: Joachim Müller on March 11, 2006, 09:47:02 pm
moving this thread accordingly.
Title: Re: Display a random image on an external website.
Post by: IamDeirdre on March 13, 2006, 07:50:33 pm
Pretty cool, thanks for sharing this!
Title: Re: Display a random image on an external website.
Post by: younk on March 19, 2006, 12:28:35 pm
Is it possible to have it show the normal picture.. not the original but the http://www.babez.dk/galleri/displayimage.php?album=7&pos=1 that picture?
Title: Re: Display a random image on an external website.
Post by: Arnaud on March 20, 2006, 12:54:27 pm
Hello

This code is working on a page but not in my vbulletin template page.

include php () seems not working.. any idea?

thanks
Title: Re: Display a random image on an external website.
Post by: jayanthsharma on March 21, 2006, 09:34:31 am
djib,
I am immensly happy with your code. I cant believe i struggled for 2 days with cpmfetch to do what this little script does.
Title: Re: Display a random image on an external website.
Post by: Joachim Müller on March 21, 2006, 05:24:47 pm
This script is a nice little contribution, however it has severe drawbacks as far as I can see:

If you can live with those drawbacks, then fine. However, we don't recommend it - we recommend cpmFetch instead.
Title: Re: Display a random image on an external website.
Post by: pcwfreak on March 30, 2006, 04:49:46 am
This script is nice but how do you get rid of the views and picture name? ???
Title: Re: Display a random image on an external website.
Post by: TuXi on May 01, 2006, 11:50:52 pm
Thanx ALOT!!!  :)
Title: Re: Display a random image on an external website.
Post by: chanfuterboy on May 18, 2006, 06:04:57 pm
ok i see both script

the first one, how to put ( how many views ) under the picture, of my it display aside


The second script.

How to display the picture vertically instead of horrizontly

thanks
Title: Re: Display a random image on an external website.
Post by: truth005 on May 23, 2006, 08:40:12 pm
The code is amazing! But is there a way that the blue border around the pic dosnt show up, or a way to customize the border? Also is there a way to show the latest uploaded pictures but have 1 pic show up for each new album like they have on www.shakiramedia.com on there "latest additons"
Title: Re: Display a random image on an external website.
Post by: justbishop on May 23, 2006, 09:34:55 pm
Awesome little script :)  One question...any way to get it to display the latest picutres, rather than randoms?

And the border can be done away with.  Just add border ="0" in this line, toward the very end of the code:
Code: [Select]
$description = '<a href="' . $link_url . $picture['pid'] . '"><img src="' . $thumb_url . '"  [b]border="0"[/b] alt="Photo aléatoire"/></a>';
I actually crated a class for the picture in my page's css, added the class tag to the above instead of the border one, and can control border color, thickness, etc. from the css now.  note that you can also change the "alt" tag to say something other than "Photo aléatoire."
Title: Re: Display a random image on an external website.
Post by: justbishop on May 23, 2006, 09:36:57 pm
Sorry for the double post.  I didn't see an edit option, and realised only after I posted that bbcode tags don't work within code tags  *headdesk*

so yeah, here's what I really ment to put in the code block above:
Code: [Select]
$description = '<a href="' . $link_url . $picture['pid'] . '"><img src="' . $thumb_url . '"  border="0" alt="Photo aléatoire"/></
Title: Re: Display a random image on an external website.
Post by: truth005 on May 23, 2006, 10:01:08 pm
Awesome little script :)  One question...any way to get it to display the latest picutres, rather than randoms?

And the border can be done away with.  Just add border ="0" in this line, toward the very end of the code:
Code: [Select]
$description = '<a href="' . $link_url . $picture['pid'] . '"><img src="' . $thumb_url . '"  [b]border="0"[/b] alt="Photo aléatoire"/></a>';
I actually crated a class for the picture in my page's css, added the class tag to the above instead of the border one, and can control border color, thickness, etc. from the css now.  note that you can also change the "alt" tag to say something other than "Photo aléatoire."

Thanks you! and to have latest pictures change random' to 'lastup'

     $album = 'lastup'; (like this)
Title: Re: Display a random image on an external website.
Post by: justbishop on May 23, 2006, 10:23:02 pm
Yay!  Thank you  ;D
Title: Re: Display a random image on an external website.
Post by: justbishop on May 24, 2006, 02:48:03 am
Again, no edit (am I completely missing it?)

Anyway, I have another question...is there a way to use this code to specify a certain category I'd like to display pictures from, rather than an album?  I saw this earlier in the thread:

get_photo?album=6&nb=4

That worked for me in the include, so I figured that changing "album" to "cat" would be worth a shot, but no luck.
Title: Re: Display a random image on an external website.
Post by: chanfuterboy on May 24, 2006, 08:50:05 pm
about Thanks you! and to have latest pictures change random' to 'lastup'

     $album = 'lastup'; (like this)

if i want to show the last 4 albums in a 4 row of picture
$thumb_per_page = 4;

what should the $album = must become to display one of all 4 picture of last album?
Title: Re: Display a random image on an external website.
Post by: troykristoffer on June 11, 2006, 04:50:12 am
I absolutely love this easy script! Thanks!! I'm using it on my P!nk fansite, PinkJams.com . (No heckling please! hehe)

I have 2 installations of CPG installed, one for video and one for pics. The pic's one is working good (See the front page of www.pinkjams.com) but the video gallery instance of the script is returning "Photo al?atoire" instead of the video's related thumbnail. If you click the words, it does take you directly to the video file as designed, but I was hoping to do one of the following:

1. Display the thumbnail of the video or,
2. Display the file's "Title" that is settable in the 'edit file' interface of CPG.

Any suggestions? I realize this isnt the intended design of your script (displaying vids) but just thought I'd ask. Thanks!

Troy
Title: Re: Display a random image on an external website.
Post by: Joachim Müller on June 12, 2006, 08:08:21 am
This script is a nice little contribution, however it has severe drawbacks as far as I can see:
  • Permissions aren't being taken into account
  • Will only work for images, but not for other file types
  • Will only work if in the coppermine root folder

If you can live with those drawbacks, then fine. However, we don't recommend it - we recommend cpmFetch instead.
Title: Re: Display a random image on an external website.
Post by: mona87 on June 21, 2006, 08:30:25 am

How do i change the border color of it?  I tried it with my style sheet but its not turning out right.  what do i put in that line in the get_photo.php file.

Thanks in advance
Title: Re: Display a random image on an external website.
Post by: gothmandave on June 30, 2006, 09:44:36 pm
Thanks for sharing your code :-) It is working fine from within the copermine directory. Does anyone know how to make it work for a page outside coppermine?
Title: Re: Display a random image on an external website.
Post by: toykilla on July 12, 2006, 09:59:51 pm
How do I use this script to pull from 1 album?

i see this

get_photo?album=6&nb=4

but dont know where to put it?
Title: Re: Display a random image on an external website.
Post by: wfs on August 02, 2006, 04:58:30 am
Hi,

thanks djib - great piece of code.

Just a question :

How do you get rid of the blue border round the pics?

Appreciate any help.

thank you.



Title: Re: Display a random image on an external website.
Post by: wfs on August 02, 2006, 05:44:07 am
so sorry, 
found the answer in an earlier posting.

Title: Re: Display a random image on an external website.
Post by: wfs on August 02, 2006, 05:57:12 am
Hi again,

Just wondering - anybody know how to put some space to separate each image ?

appreciate any help.

thanks.
Title: Re: Display a random image on an external website.
Post by: yacenty on August 20, 2006, 11:07:32 pm
I would like to show 3 top rated and 3 most view pictures on my main page - is it possible to do it with this nice script?

best regards,
Yacenty
Title: Re: Display a random image on an external website.
Post by: ashleyXcore on August 25, 2006, 08:31:51 pm
Hi,

thanks djib - great piece of code.

Just a question :

How do you get rid of the blue border round the pics?

Appreciate any help.

thank you.

Where did you find the answer? I looked at this page:
http://cpmfetch.fistfullofcode.com/projects/copperminefetch/tips.php#cssboxes
But it doesn't even tell you where to put that code in order to style it...
Title: Re: Display a random image on an external website.
Post by: Nibbler on August 25, 2006, 08:46:07 pm
You put it in the styesheet of the page you are usng cpmfetch on. If it doesn't use a stylesheet then add it inline using <style> tags.
Title: Re: Display a random image on an external website.
Post by: Joachim Müller on August 26, 2006, 07:15:44 am
This thread doesn't deal with cpmFetch. Don't reply with question related to cpmFetch to this thread. In fact, there's a new support board dedicated to cpmFetch issues: cpg1.4 cpmFetch by vuud (http://forum.coppermine-gallery.net/index.php?board=87.0)
Title: Re: Display a random image on an external website.
Post by: ashleyXcore on August 28, 2006, 05:59:31 am
You put it in the styesheet of the page you are usng cpmfetch on. If it doesn't use a stylesheet then add it inline using <style> tags.

You would put this:
Code: [Select]
cpm_viewRandomMediaFromAlbum(2,2,17,array("tablestyle" => "test1","imagestyle" => "test1"));in a stylesheet?

Sorry to post again in this thread by the way :/
Title: Re: Display a random image on an external website.
Post by: ashleyXcore on August 28, 2006, 06:07:55 am
You would put this:
Code: [Select]
cpm_viewRandomMediaFromAlbum(2,2,17,array("tablestyle" => "test1","imagestyle" => "test1"));in a stylesheet?

EDIT: oh my god, I figured it out... sorry about posting here again >.<
Title: Re: Display a random image on an external website.
Post by: majay on September 02, 2006, 05:49:03 pm
Hi, thanks for this.

I have a question: is there anything in the code for get_photo.php that could stop a page where the random pictures are included from validating in XHTML 1.0 transitional?

I'm trying to validate my page, but I keep getting this message:

Quote
Sorry, I am unable to validate this document because on line 56  it contained one or more bytes that I cannot interpret as utf-8

Line 56 is the line where I include my get_photo.php, like this:
Code: [Select]
<p class="random" align="center"><?include("http://path/to/get_photo.php");?></p>
When I delete the include bit only (not the p tags), the page validates fine.

This is my get_photo.php code (I'm posting it because it's not identical to djib's original code):
Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - random photo displayer                         //
// ------------------------------------------------------------------------- //
// Based on Dr. Tarique Sani RSS feed for Coppermine                         //
// http://tariquesani.net/                                                  //
// Adapted by djib to display a random photo - http://djib.biz              //

define('IN_COPPERMINE'true);
define('INDEX_PHP'true);
require(
'include/init.inc.php');

//How many items you want to show in your get_photo script
if(isset($_GET['nb'])) {
     
$thumb_per_page=$_GET['nb'];
} else {
     
$thumb_per_page 4;
}
$thumb_count 4;
$lower_limit 0;

if(isset(
$_GET['album'])){
    
$album $_GET['album'];
}

//If it is a numeric album get the name and set variables
if ((is_numeric($album))){
     
$album_name_keyword get_album_name($album);
     
$CURRENT_CAT_NAME $album_name_keyword['title'];
     
$ALBUM_SET "AND aid IN (".(int)$_GET['album'].")".$ALBUM_SET;
     
//Set the album to last uploaded
     
$album 'random';
}

//If the album is not set set it to lastup - this is the default
if(!isset($album)){
     
$album 'random';
}


//Changes these to point to your site if the following is not giving correct results.
$link_url $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url $CONFIG['ecards_more_pic_target']."albums/";


$data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);


foreach(
$data AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '"><img src="' $thumb_url '"  alt="Photo aléatoire"/></a> ';
    echo 
$description;

}
?>

Is there something wrong there? Or is my problem unrelated to this?

Thanks
Title: Re: Display a random image on an external website.
Post by: helitown on October 01, 2006, 10:34:34 pm
I have tried this code - it works with a regular website but not with phpbb forum. Am I missing something or this code was not designed for a forum? Also, can I remove the title of the thumptail and only have the thumpnails displayed?
Title: Re: Display a random image on an external website.
Post by: Joachim Müller on October 01, 2006, 11:07:33 pm
It wasn't specifically designed to work with phpBB. It may or may not work with it - we don't know. Probably doesn't.
Title: Re: Display a random image on an external website.
Post by: helitown on October 01, 2006, 11:31:22 pm
Thanks GauGau so I can stop trying. I am checking cpmFetch now.
Title: Re: Display a random image on an external website.
Post by: tommytomato on October 10, 2006, 10:29:08 am
All i'm geting is a blank page, any idea on why its not working ?

TT
Title: Re: Display a random image on an external website.
Post by: wfs on October 13, 2006, 10:10:39 am
Hi, appreciate it if any body can help.
I don't know enough of PHP to amend the code by djib.

I just want to get one random image from a particular album.

thanks.

Title: Re: Display a random image on an external website.
Post by: Pascal YAP on October 13, 2006, 10:55:22 am
Morming,

@Tommytomato :
Quote
All i'm geting is a blank page, any idea on why its not working ?

Yes  ;D
You do not setup your CpmFetch's config correctly  ???


PYAP
Title: Re: Display a random image on an external website.
Post by: DevilBrain on November 01, 2006, 04:13:03 pm
Hi
I have my site in root folder but copermine is installed in a "wallpapers" named folder which is located is root, plz tell me how can i get random wallpapers from my wallpapers gallery folder to show on root index file ?

I am not familiar with php, plz tell me what should i have to do with code that you give in quote and where to put include tag ?

Please help me i will be very thankfull.
Title: Re: Display a random image on an external website.
Post by: DevilBrain on November 02, 2006, 04:54:10 pm
Hi
I have my site in root folder but copermine is installed in a "wallpapers" named folder which is located is root, plz tell me how can i get random wallpapers from my wallpapers gallery folder to show on root index file ?

I am not familiar with php, plz tell me what should i have to do with code that you give in quote and where to put include tag ?

Please help me i will be very thankfull.

Anyone here to please help me ?
Title: Re: Display a random image on an external website.
Post by: debragrant on November 09, 2006, 03:28:17 pm
I found a solution.
Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - random photo displayer                         //
// ------------------------------------------------------------------------- //
// Based on Dr. Tarique Sani RSS feed for Coppermine                         //
// http://tariquesani.net/                                                  //
//
// Adapted by djib to display a random photo - http://djib.biz              //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
// ------------------------------------------------------------------------- //
// Just put into the same directory as your coppermine installation         //
// ------------------------------------------------------------------------ //

define('IN_COPPERMINE'true);
define('INDEX_PHP'true);
require(
'include/init.inc.php');

//How many items you want to show
$thumb_per_page 1;

$thumb_count 4;
$lower_limit 0;


$album 'random';


//Changes these to point to your site if the following is not giving correct results.
$link_url $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url $CONFIG['ecards_more_pic_target']."albums/";


$data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);


foreach(
$data AS $picture) {

    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$keywords explode(" ",trim($picture[keywords]));
    
$category_string "";
    
$pubDate gmdate("D, d M Y H:i:s"$picture[ctime]);
    
$description '<a href="' $link_url $picture['pid'] . '"><img src="' $thumb_url '"  alt="Random image"/></a>'.bb_decode($picture[caption]).bb_decode($picture[caption_text]);    
    echo 
$description;
}

?>


After that, just add <?php include(http://yoursite/get_photo.php); ?> where you want to display the photo.



I would make a .php file with the first code right where does it need to be placed? in the root?
The second code I add to the area I want the images displayed right?

Is it posisble to have moving images like this site -

http://penelopecruz.com/

my main site is in the root then coppermine in is the gallery folder.
Title: Re: Display a random image on an external website.
Post by: DevilBrain on November 11, 2006, 04:24:02 pm
How to make thumbnail size bigger and get ride of views count.
Infact i need a clear one image thumbnail withou views.

I think no one here help others, as no one reply for my last post, however i am putting this post in just a hope.
Title: Re: Display a random image on an external website.
Post by: pcotter on November 11, 2006, 09:32:57 pm
A beautiful script!!! Thanks!
Title: Re: Display a random image on an external website.
Post by: celeritycat on November 12, 2006, 06:47:25 am
Ok I created a php file called it get_photo.php uploaded it to my coppermine folder which is pixleparty. This is what is in the php file.
Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) Dr. Tarique Sani                                           //
// http://tariquesani.net/                                                  //
// Adapted by djib to display a random photo - http://djib.biz              //
// This program is free software; you can redistribute it and/or modify     //
// it under the terms of the GNU General Public License as published by     //
// the Free Software Foundation; either version 2 of the License, or        //
// (at your option) any later version.                                      //
// ------------------------------------------------------------------------- //
// Just put into the same directory as your coppermine installation         //
// ------------------------------------------------------------------------ //

define('IN_COPPERMINE'true);
define('INDEX_PHP'true);
require(
'include/init.inc.php');

//How many items you want to show in your get_photo script
if(isset($_GET['nb'])) {
     
$thumb_per_page=$_GET['nb'];
} else {
     
$thumb_per_page 1;
}
$thumb_count 1;
$lower_limit 1;

if(isset(
$_GET['album'])){
    
$album $_GET['album'];
}

//If it is a numeric album get the name and set variables
if ((is_numeric($album))){
     
$album_name_keyword get_album_name($album);
     
$CURRENT_CAT_NAME $album_name_keyword['title'];
     
$ALBUM_SET "AND aid IN (".(int)$_GET['album'].")".$ALBUM_SET;
     
//Set the album to last uploaded
     
$album 'lastup';
}

//If the album is not set set it to lastup - this is the default
if(!isset($album)){
     
$album 'lastup';
}


//Changes these to point to your site if the following is not giving correct results.
$link_url $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url $CONFIG['ecards_more_pic_target']."albums/";



$data get_pic_data($album$thumb_count$album_name$lower_limit$thumb_per_page);


foreach(
$data AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '"><img src="' $thumb_url '"  border="0" alt=" Galleria Latest"/></a>';
    echo 
$description;

}
?>


after that I put this where I wanted the image to show up.
Code: [Select]
<?php include("http://mysite.com/pixelparty/get_photo.php"); ?>
A picture place holder shows up, but no image and when you click on it, I get this page can not be found. I am using this on my index with express engine and I have set permissions to use php in my pages. Also I am using the latest version (1.4.10) of Coppemine and The user pictures are in /albums/userpics/.
So any help or suggestion would be aprreciated very much.
Title: Re: Display a random image on an external website.
Post by: pcotter on November 12, 2006, 10:29:36 pm
Well after a few tests i changed my mind! Is not so beautiful.... :)
You can c it in action integrated with Joomla. http://joomla.pcotter.com , but as Gaugau said, the script will bypass Coppermine permissions, and display random thumbs from private albums.

Anyway, due to my server settings and early stage of joomla implementation, i will keep this script for a couple days till i get my hands in cpmfetch
Title: Re: Display a random image on an external website.
Post by: DevilBrain on November 15, 2006, 04:35:17 pm
Hey dear i am satisfied with this script, plz just tell me how to control image size and how to remove views text.
Title: Re: Display a random image on an external website.
Post by: toy2666 on December 18, 2006, 03:30:54 pm
I like this script!!!

it is possible to have 4 rows with 5 thumbs on each?

I want to put the thumbs on a table with 600 width like this website: http://www.trekearth.com/gallery/

sorry for my english...  :(

est-ce possible d'avoir 4 rangé de 5 images au lieu d'avoir tout cela sur la meme ligne?
Je veux créer un tableau de 600 pixel de large qui serait centré sur ma page avec mes images qui serait justifié (et non collé) sur chaque ligne.
Voici un exemple qui ressemble un peu a ce que je veux: http://www.trekearth.com/gallery/

merci a tous
Title: Re: Display a random image on an external website.
Post by: Pascal YAP on December 18, 2006, 05:32:34 pm
Quote
sorry for my english...
Your english is perfect  ;D
But if mine is poor you can visit us in our French Coppermine Board (http://forum.coppermine-gallery.net/index.php?board=38.0) (started in 2004)

Quote
it is possible to have 4 rows with 5 thumbs on each?
Yes. Perhaps you can change some settings in the begining of this script.

In my opinion try CpmFetch for security reason instead this script (sorry celeritycat  ;) )

PYAP
Title: Re : Display a random image on an external website.
Post by: toy2666 on December 18, 2006, 07:06:42 pm
I know Cpmfetch but it seem very difficult to use to display picture on another website.

What is the security problem of this script?

If the problem is because he display random thumbs from private albums, it's not a problem for me because i don't have private album on my gallery, only public.
Title: Re: Display a random image on an external website.
Post by: Pascal YAP on December 18, 2006, 11:04:58 pm
Quote
I know Cpmfetch but it seem very difficult to use to display picture on another website.
No it's very simple !
But, be sure to correctly set CpmFetch with correct paths.

I use CpmFetch on my personnal Gallery here (refresh screen every 10s) :
www.pays-dignois.com/galerie
and if you will visit my Gallery, i use also CpmFetch inside a FLASH animation (direct link (http://www.pays-dignois.com/galerie/Banniere-CPMfetch.html))

CpmFetch, is a very usefull script.


PYAP
Title: Re: Display a random image on an external website.
Post by: SolidSnake2003 on December 27, 2006, 02:13:21 pm
Is there a way using this script for me to display pics from a certain gallery for one page on my site, then on another page display a pic from different galleries instead of just randomly picking images?
Title: Re: Display a random image on an external website.
Post by: Joachim Müller on December 27, 2006, 03:27:23 pm
This very thread you're posting on does not deal with cpmFetch, but another unsupported little mod - the one explained on the very first posting of this thread. There is no support for cpmFetch on this very thread, but there is a whole sub-board dedicated to cpmFetch support.

@Supporters: please do not promote cpmFetch on this thread without making it totally clear that this thread is not meant for discussions on cpmFetch.

@people looking for support: please help us maintaining the board helpful - avoid thread-drift and cross-postings.
Title: Re: Display a random image on an external website.
Post by: SolidSnake2003 on December 27, 2006, 06:03:35 pm
Im not wanting support for cpmFetch, I was wanting support on the script that was presented here that isnt cpmfetch.
Title: Re: Display a random image on an external website.
Post by: Joachim Müller on December 28, 2006, 09:44:01 am
Basically, the mod presented on this board comes as is (without support). Sorry.
Title: Re: Display a random image on an external website.
Post by: TecShdw on January 14, 2007, 01:27:59 am
This is GREAT!  I've been trying to do it for some time myself with no success.  HA HA also, it took me a while to realize why it wasn't working right for me, I had to re-name my index.html to index.php (just in case anyone else has that issue) which is no issue, my old site was all php anyhow.

Thanks everyone!  I had to register just so I could express my appreciation (plus there is alot of other great info on the site)  If you want to see how I used it check out www.themotens.com I'm still going to sit down when I have more time and work on making the thumb image a bit larger so it fits my little window I have it in!
Title: Re: Display a random image on an external website.
Post by: doctoreast on January 21, 2007, 07:06:07 am
Tec,
  Just use coppermine's settings and admin tools to resize your thumbs.
All you do is set the size to 125 or 150 and run the wizard across all images.
pe
Title: Re: Display a random image on an external website.
Post by: doctoreast on January 21, 2007, 07:24:16 am
HI,
  This random image code get_photo also
supposedly has an option to call random
images from specific albums.

// For example get_photo?album=6&nb=4 will
// display 4 photos from album 6.
<?php include("http://yoursite/gallery/get_photo.php?album=2&nb=1"); ?>

  Please, has anyone had luck with this?  Mine
is still pulling random pics from random albums,
and I'm unsure of how to modify the script.

Please Help?
Mikey
Title: Coppermine/Cpmfetch Newbie
Post by: doctoreast on January 21, 2007, 10:06:33 am
Hi,
  It is now 3am, and I've been through pages and freaking pages,
looked at all other options because I am no freaking PHP programmer.
What cpmfetch needs is a wizard to build the scripts and link include
strings,  to where people like me can just copy and paste from there. 
Adsense/Adbrite type wizard is what I"m thinking of.  Other than that,
I really don't see the point; and I can understand why you guys have
this support category locked from new titles.

  Can someone please point me to a very well documented cpmfetch
script which will grab one random thumb from one specific album, with
no text or links around it? 

Code: [Select]
<?php 
///  PATH TO cmpfetch.php  ////
include "http://mysite.com/cmpfetch/cpmfetch.php";
/// PATH TO ???????? ////
$objCpm = new cpm('/photos');
/////  Syntax: cpm_viewRandomMediaFromAlbum( # rows, # cols, album id#, styleHas?h); ////
$objCpm->cpm_viewRandomMediaFromAlbum(1,1,2);
///  CLOSING TAG  ////
$objCpm->cpm_close();
?>

Title: Re: Display a random image on an external website.
Post by: doctoreast on January 22, 2007, 01:05:55 am
For the record, as this might help others:

   Install fetch folder in your gallery folder,
and get it configed so that the test file
works.  The latest dev verson has a
install file, but you have to change permissions
on the folders and files to get past the errors
that you will see, so that it can "install".

  When building or using any cpmfetch scripts,
always upload and leave them in the cpmfetch
folder.  If you put them elsewhere, fetch will
not be able to process that code, as it can't
see it.  In your website pages, use another
include string to call the fetch scripts into action.

East
Title: Re: Display a random image on an external website.
Post by: jam583 on February 09, 2007, 11:13:46 pm
I couldn't figure out how to start a new thread in the main area so here goes ..

The error I am getting is:

CPG Config file not found: /home/gmpt/public_html/home/gmpt/public_html/gallery/include/config.inc.php

Test is at :

http://www.gmperformancetuning.com/cpmfetch/cpmfetch/cftest.php

Please advise .. the config.inc.php file is there!
Title: Re: Display a random image on an external website.
Post by: doctoreast on February 10, 2007, 04:16:15 am
jam,
  you may need to play around with the path on your script.
Try the full http://site/gallery/cpmfetch/ absolute URL instead.
Be sure to leave the script in the cpmfetch folder, and call it
from elsewhere using an include.

  Post your script code, that we can see it.
I have mine working on 3 different websites.  Here's the
script's I'm using, if it might help you.

Code: [Select]
<?php 
///  PATH TO cmpfetch.php  ////
include "./cpmfetch.php";
/// PATH TO COPPERMINE IF IRREGULAR ////
$objCpm = new cpm();
/////  Syntax: cpm_viewRandomMediaFromAlbum( # rows, # cols, album id#, styleHas?h); ////
$objCpm->cpm_viewRandomMediaFromAlbum(1,1,18);
///  CLOSING TAG  ////
$objCpm->cpm_close();
?>




Code: [Select]
<?php 
///  PATH TO cmpfetch.php  ////
include "./cpmfetch.php";
/// PATH TO COPPERMINE IF IRREGULAR ////
$objCpm = new cpm();
/////  Syntax: cpm_viewRandomMediaFromAlbum( # rows, # cols, album id#, styleHas?h); ////
$objCpm->cpm_viewRandomMediaFromAlbum(1,1,17);
///  CLOSING TAG  ////
$objCpm->cpm_close();
?>





pe
Title: Re: Display a random image on an external website.
Post by: paulo.nesso on February 21, 2007, 12:47:26 am
how to show by category?????
Title: Re: Display a random image on an external website.
Post by: WebGhost on July 11, 2007, 03:08:32 am
As my question is relevant about this hack so cannot start new topic so i hope mods admin will not annoy on me.
I have three question about this hack, will anyone help ?
1: How to control thumbnails size ?
2: How to show thumbs vertically ?
3: How to put space between thumbs ?
Title: Re: Display a random image on an external website.
Post by: Joachim Müller on July 12, 2007, 09:50:15 am
This mod goes unsupported. We don't recommend using it. You're on your own if you decide to use it anyway. Locking.