Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 2 [3] 4   Go Down

Author Topic: Display a random image on an external website.  (Read 87204 times)

0 Members and 1 Guest are viewing this topic.

wfs

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
Re: Display a random image on an external website.
« Reply #40 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.

Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: Display a random image on an external website.
« Reply #41 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
Logged

DevilBrain

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Display a random image on an external website.
« Reply #42 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.
Logged

DevilBrain

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Display a random image on an external website.
« Reply #43 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 ?
Logged

debragrant

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 127
Re: Display a random image on an external website.
« Reply #44 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.
Logged

DevilBrain

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Display a random image on an external website.
« Reply #45 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.
Logged

pcotter

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 28
  • Cotter
    • Personal Page
Re: Display a random image on an external website.
« Reply #46 on: November 11, 2006, 09:32:57 pm »

A beautiful script!!! Thanks!
« Last Edit: November 12, 2006, 10:16:14 pm by pcotter »
Logged
Dum Spiro, Spero
http://foto.pcotter.com

celeritycat

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: Display a random image on an external website.
« Reply #47 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.
Logged

pcotter

  • Translator
  • Coppermine novice
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 28
  • Cotter
    • Personal Page
Re: Display a random image on an external website.
« Reply #48 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
Logged
Dum Spiro, Spero
http://foto.pcotter.com

DevilBrain

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Display a random image on an external website.
« Reply #49 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.
Logged

toy2666

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: Display a random image on an external website.
« Reply #50 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
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: Display a random image on an external website.
« Reply #51 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 (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
Logged

toy2666

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re : Display a random image on an external website.
« Reply #52 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.
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: Display a random image on an external website.
« Reply #53 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)

CpmFetch, is a very usefull script.


PYAP
« Last Edit: December 18, 2006, 11:12:00 pm by PYAP »
Logged

SolidSnake2003

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 82
  • Solid Snake/Joshua Harris Fan
    • Legacy Designs
Re: Display a random image on an external website.
« Reply #54 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Display a random image on an external website.
« Reply #55 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.
Logged

SolidSnake2003

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 82
  • Solid Snake/Joshua Harris Fan
    • Legacy Designs
Re: Display a random image on an external website.
« Reply #56 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Display a random image on an external website.
« Reply #57 on: December 28, 2006, 09:44:01 am »

Basically, the mod presented on this board comes as is (without support). Sorry.
Logged

TecShdw

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Display a random image on an external website.
« Reply #58 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!
Logged

doctoreast

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: Display a random image on an external website.
« Reply #59 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
Logged
Pages: 1 2 [3] 4   Go Up
 

Page created in 0.027 seconds with 19 queries.