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]   Go Down

Author Topic: SPIP et Coppermine (img aléatoires)  (Read 4383 times)

0 Members and 1 Guest are viewing this topic.

KIKO26

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
SPIP et Coppermine (img aléatoires)
« on: October 01, 2007, 05:59:51 pm »

J'utilise SPIP 1.9.2c et je suis à la recherche du Plugin nécessaire dont il est question dans toutes les docs.
Avez-vous un conseil à me donner?
Salut, j'ai récupéré le script que j'ai mis en place pour récupérer et placer dans un site fait sous SPIP, des photos aléatoires tirées d'une Galerie Coppermine.

à mettre dans le fichier html du squelette actif, chez moi c'est le fichier sommaire.html, qui est en fait la page d'accueil qui s'affiche lorsque l'internaute ouvre le site.
Code: [Select]
<?php $r=@file_get_contents("http://MonSiteWeb.com/RepertoireDeCoppermine/get_photo.php?nb=2"); if ($r===false) { echo("Server down"); } else { echo $r;} ?>
Ne pas oublier de transférer en FTP le fichier get_photo.php à la racine de Coppermine.
J'ai mis nb=2 pour voir 2 photos aléatoires. Mettre le chiffre voulu.
Le fichier get_photo.php est derrière cette URL ou dans le POST suivant placé par PYAP : http://fusion.laboitemail.com/infusions/pro_download_panel/download.php?did=86
@+

KIKO26
« Last Edit: October 01, 2007, 06:51:02 pm by PYAP »
Logged

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: SPIP et Coppermine (img aléatoires)
« Reply #1 on: October 01, 2007, 06:25:17 pm »

Bonjour,

Dans l'éventualité de voir disparaitre le lien ci-dessus, voici le script SPIP et Coppermine...
GET_PHOTO.PHP
Copiez le code et nommez-le get_photo.php !

Code: [Select]
<?php 
// Coppermine Photo Gallery - get_image script
// Based on the RSS feed by 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
// Combien d images désirez-vous faire apparaitre

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;
     
$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 class="get_photo" src="' $thumb_url '"  alt="Photo aléatoire"/></a>&nbsp;';
    echo 
$description;

}
?>

PYAP
« Last Edit: October 01, 2007, 06:52:33 pm by PYAP »
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.