Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 20, 2009, 11:27:07 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Private messages disabled
Caused by the massive abuse of the PM system in the past, the sending of personal messages has been disabled for all regular users on the Coppermine forum.
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: SPIP et Coppermine (img aléatoires)  (Read 1314 times)
0 Members and 1 Guest are viewing this topic.
KIKO26 Topic starter
Coppermine newbie

Posts: 8


« on: October 01, 2007, 04: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:
<?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, 05:51:02 pm by PYAP » Logged
Pascal YAP
Moderator
****
Gender: Male
Armenia Armenia

Posts: 3791


He's me, and She's Moon


WWW
« Reply #1 on: October 01, 2007, 05: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:
<?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, 05:52:33 pm by PYAP » Logged

! Pas de PM please ! No PM s'il vous plait !
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.047 seconds with 18 queries.