Advanced search  

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

Pages: 1 [2] 3 4   Go Down

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

0 Members and 1 Guest are viewing this topic.

chanfuterboy

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

troykristoffer

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

Joachim Müller

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

mona87

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

gothmandave

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

toykilla

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

wfs

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



Logged

wfs

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
Re: Display a random image on an external website.
« Reply #27 on: August 02, 2006, 05:44:07 am »

so sorry, 
found the answer in an earlier posting.

Logged

wfs

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

yacenty

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

ashleyXcore

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 49
    • Magazine Junkie
Re: Display a random image on an external website.
« Reply #30 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...
Logged
"There are many kinds of eyes. Even the sphinx has eyes — and consequently there are many kinds of 'truths', and consequently there is no truth."

Nibbler

  • Guest
Re: Display a random image on an external website.
« Reply #31 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.
Logged

Joachim Müller

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

ashleyXcore

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 49
    • Magazine Junkie
Re: Display a random image on an external website.
« Reply #33 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 :/
Logged
"There are many kinds of eyes. Even the sphinx has eyes — and consequently there are many kinds of 'truths', and consequently there is no truth."

ashleyXcore

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 49
    • Magazine Junkie
Re: Display a random image on an external website.
« Reply #34 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 >.<
Logged
"There are many kinds of eyes. Even the sphinx has eyes — and consequently there are many kinds of 'truths', and consequently there is no truth."

majay

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

helitown

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

Joachim Müller

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

helitown

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Display a random image on an external website.
« Reply #38 on: October 01, 2006, 11:31:22 pm »

Thanks GauGau so I can stop trying. I am checking cpmFetch now.
Logged

tommytomato

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 43
    • http://gallery.rockinghamgateway.com/
Re: Display a random image on an external website.
« Reply #39 on: October 10, 2006, 10:29:08 am »

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

TT
Logged
Pages: 1 [2] 3 4   Go Up
 

Page created in 0.056 seconds with 20 queries.