CoolIris est un plugin pour Firefox, IE, et Safari, pas un plugin pour Coppermine !
Il vous faut :
1/ Installer le plugin pour votre navigateur préféré.
2/ Installer un RSS Feed (Easy-Rss par exemple, dspo sur notre forum)
3/ l'adapter comme ci-dessous
4/ Créer un fichier XML comme ci-dessous.
cooliris-rss.php (attention à la ligne 42.
<?php
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) Dr. Tarique Sani                                           //
// http://tariquesani.net/                                                  //
// modifications by versus7 - www.oixalia.gr - oixalia@oixalia.gr //
// further modifications by Brent Gerig
// 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         //
// ------------------------------------------------------------------------ //
// Mod by Andiwe to generate XML RSS Feed for PicLens Gallery
//  Feed will only load a defined amount of pics at once and give prev an next
//  URL to the Feed for large Album support.
//  Annotations marked with A/
define('IN_COPPERMINE', true);
define('INDEX_PHP', true);
global $CONFIG,$ALBUM_SET,$META_ALBUM_SET,$CURRENT_CAT_NAME,$FORBIDDEN_SET_DATA,$lang_plugin_easyrss,$lastup_date_fmt;
require('include/init.inc.php');
require('plugins/Easy_RSS/include/init.inc.php');
//How many items you want to show in RSS feed
//A/How many pictures do you want to be loaded at a time ?
//A/Should be the count of pictures in the album View to make the start at a
//A/ specific Page working.
//A/4 Rows with 5 Colums of Pictures means 20
//A/oldconfig $thumb_per_page = intval($CONFIG[plugin_easyrss_num]);
$thumb_per_page = ((intval($CONFIG[thumbrows]))*(intval($CONFIG[thumbcols])));
//A/ We need the count of Pictures in your Movieslide below the preview Image.
//A/ Thats for to make the play Button at the start and end of pages working.
//A/oldconfig $pics_in_movieslide = intval($CONFIG[plugin_easyrss_mvslnum]);
$pics_in_movieslide = intval($CONFIG[max_film_strip_items]);
//A/URL of your Gallery
$gallery_home_url = 'http://www.?????????.com/galerie/';
// $gallery_home_url = $CONFIG['ecards_more_pic_target'];
//A/Get Gallery descriptions
$gallery_name = $CONFIG['gallery_name'];
$gallery_desc = $CONFIG['gallery_description'];
//A/Logo to be displayed on to of the PicLens View
//A/think this is buggy in 3D View but shows correctly in Flash Player (lite)
//A/if you don't wanna have logo or music just comment the hole line out.
//$site_logo = 'plugins/Easy_RSS/sitelogo.gif';
$site_logo = $CONFIG['plugin_easyrss_logo'];
//$site_music = 'plugins/Easy_RSS/site_music.mp3';
//A/ If you want to display the Normal-Pictures instead of
//A/ the Thumbnails at initial Wall-View give it the value 1
$fullsizethumbs = intval($CONFIG[plugin_easyrss_fullsizethumbs]);
//A/ If you want to diyplay the Full-Pictures instead of
//A/ the Normals at detailed Wall-View give it the value 1
$fullsizepics = intval($CONFIG[plugin_easyrss_fullsizepics]);
//A/set initial values
$thumb_count = 0;
$lower_limit = 0;
$album = '';
$umlautArray = Array("&auml;","&ouml;","&uuml;","&Auml;","&Ouml;","&Uuml;","&szlig;");
$replaceArray = Array("/ä/","/ö/","/ü/","/Ä/","/Ö/","/Ü/","/ß/");
if(count($FORBIDDEN_SET_DATA) > 0 ){
    $forbidden_set_string =" AND aid NOT IN (".implode(",", $FORBIDDEN_SET_DATA).")";
} else {
    $forbidden_set_string = '';
}
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'];
     $META_ALBUM_SET = "AND aid IN (".(int)$_GET['album'].")".$ALBUM_SET;
}
else {
  //If the album is not set, set it to lastup - this is the default
  if(!isset($album)){
       $album = 'lastup';
       }
  else {
    if ($album == 'topn') {
      //if topviewed is selected
      //$album = 'topn';
    }
    else {
      if ($album == 'random') {
      //$album = 'random');
      }
      else {
      //maybe someone injected something else
      $album = 'lastup';
      }
    }
  }
}
//A/ok lets get the correct start point (picture) at wich the rss shall begin
//A/that's when it's called by the prev and next links from piclens
if(isset($_GET['start'])){
    $start_at_var = $_GET['start'];
}
//A/set the lower limit to that point
if ((is_numeric($start_at_var))){
   $lower_limit = intval($start_at_var); 
   //A/ lets make sure $lower_limit is a multiple of $thumb_per_page
   $lower_limit = ( (intval(($lower_limit)/($thumb_per_page))) * $thumb_per_page );
}
//A/get the album page from where the feed was loaded
if(isset($_GET['page'])){
    $start_at_page = $_GET['page'];
}
//A/lets define the start lower_limit by a multiple (page) of the thumb_per_page
if ((is_numeric($start_at_page))){
   $lower_limit = ((intval($start_at_page) - 1) * $thumb_per_page); 
}
//A/ get the image position when clicking on big preview
if(isset($_GET['imgpos'])){
    $start_at_imgpos = $_GET['imgpos'];
}
//A/set the lower limit to that point
if ((is_numeric($start_at_imgpos))){
//A/try to reduce that to the cases where those overlapping pictures are displayed
//$pics_in_movieslide = 5; // =5
      $movieslideleft = intval(($pics_in_movieslide -1) / 2); // =2
      $moviesliderest = $pics_in_movieslide - $movieslideleft; // =3
     
   if ($start_at_imgpos < ($thumb_per_page)) {
      $lower_limit = 0;
      if ( ( ($start_at_imgpos % $thumb_per_page) > ($thumb_per_page - $moviesliderest) ) ) {
      //Awe got overlapping picture on the first page
      $thumb_per_page_multi = 2;
      $thumb_per_page = $thumb_per_page_multi * $thumb_per_page; 
      }
   }
   else {
      $lower_limit = ( (intval(($start_at_imgpos)/($thumb_per_page))) * $thumb_per_page );
      //A/sorry we got to load more pictures to show all play buttons on the thumbnails
      //A/in preview. especially when in the movie-clip view there are pictures that are
      //A/not on the same page with the viewed image, the button won't be displayed
      //A/because the feed doesn't contain that datasets.
     
      if ( (($start_at_imgpos % $thumb_per_page) < $movieslideleft) ) {
      //A/we got overlapping pictures at the start of a page
      $lower_limit = $lower_limit - $thumb_per_page;
      $thumb_per_page_multi = 2;
      $thumb_per_page = $thumb_per_page_multi * $thumb_per_page;     
      }
      if (($start_at_imgpos % $thumb_per_page) > ($thumb_per_page - $moviesliderest) ) {
      //A/we got overlapping pictures at the end of a page
      $thumb_per_page_multi = 2;
      $thumb_per_page = $thumb_per_page_multi * $thumb_per_page;     
      }
      //A/no overlapping pictures and nothing to do ;-)
     
      //A/so now we have got to make sure that we can set the previous and next feed links
      //A/correctly we will do that when it comes to generate the links.
      //A/therefor we reset the $thumb_per_page to it's original value when it comes
      //A/to the url generation in next oder prev cases.
   } 
}
//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=-";
$link_url_alb = $CONFIG['ecards_more_pic_target']."displayimage.php?album=";
//A/Choose between Full Path and relative one depending on where this file resides.
//A/relative one is shorter and makes smaller rss feeds.
//$image_url = $CONFIG['ecards_more_pic_target']."albums/";
$image_url = "albums/";
$META_ALBUM_SET .= $forbidden_set_string;
$data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);
/*
//A/we wan't to have linkback to the correct album id and not the absolute picture pos
//A/if we are have not opened the feed out of an album but a cat like e.g. lastup instead
if $start_at_imgpos < 0 {
}
*/
header ("content-type: text/xml");
//A/we need less code than easy rss what makes the rss smaller
$rssHeader = <<<EOT
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
EOT;
$rssHeader .= <<<EOT
<generator>Easy RSS Feed Mod 4 PicLens by Andiwe b016</generator>
EOT;
echo $rssHeader;
//A/ ok lets create the "previous" and "next" links in the rss feed
//A/ the if construction needs to be sorted ... that sure was some alcoholic stuff ;-)
$item = '';
if ($thumb_count > $thumb_per_page) {
//A/ so we got to make sure that the album has more pictures than $thumb_per_page
//A/ if it has less we do not need any links
if ($lower_limit < $thumb_per_page) {
//A/ so we are at the start of the gallery and need only a next link
$nextfeednum = $thumb_per_page;
$item .= '<atom:link rel="next" href="cooliris-rss.php?album='.$album.'&start='.$nextfeednum.'" />';
$item .= "\n";
}
if (($thumb_count - $lower_limit) > $thumb_per_page) {
//A/ so we are anywhere in the middle of the gallery
if ($lower_limit > ($thumb_per_page - 1)) {
//A/ just check again if we are not at the start ... why ??? don't know anymore ;-)
$nextfeednum = $lower_limit + $thumb_per_page;
if ($thumb_per_page_multi > 1) {
$thumb_per_page = $thumb_per_page / $thumb_per_page_multi;
}
$previousfeednum = $lower_limit - $thumb_per_page;
$item .= '<atom:link rel="previous" href="cooliris-rss.php?album='.$album.'&start='.$previousfeednum.'" />';
$item .= '<atom:link rel="next" href="cooliris-rss.php?album='.$album.'&start='.$nextfeednum.'" />';
}
if ($lower_limit > ($thumb_count - $thumb_per_page)) {
//A/ so what was this for ???
if ($thumb_per_page_multi > 1) {
$thumb_per_page = $thumb_per_page / $thumb_per_page_multi;
}
$previousfeednum = $lower_limit;
$item .= '<atom:link rel="previous" href="cooliris-rss.php?album='.$album.'&start='.$previousfeednum.'" />';
}
}
if (($thumb_count - $lower_limit) < ($thumb_per_page + 1)) {
//A/ we are at the end of the gallery because there are less or equal than $thumb_per_page images left
//A/ so just create a previous link
if ($lower_limit > ($thumb_count - $thumb_per_page)) {
if ($thumb_per_page_multi > 1) {
$thumb_per_page = $thumb_per_page / $thumb_per_page_multi;
}
$previousfeednum = $lower_limit - $thumb_per_page;
$item .= '<atom:link rel="previous" href="cooliris-rss.php?album='.$album.'&start='.$previousfeednum.'" />';
}
}
}
echo $item;
//A/ prev and next feed links maybe ;-) have now been generated.
//A/ we've lost some Easy_RSS Code here ;-)
$rssHeader = '';
if ($site_logo > '') {
$rssHeader .= <<<EOT
<atom:icon>$site_logo</atom:icon>
EOT;
}
if ($site_music > '') {
$rssHeader .= <<<EOT
<atom:link rel="enclosure" type="audio/mpeg" length="1337" href="$site_music" />
EOT;
}
echo $rssHeader;
$description_header = "<title>".$gallery_name."</title>\n<link>".$gallery_home_url."</link>\n<description>".$gallery_desc;
// $description_header .= " <a href"rss.php?album=".$album."&start=".$previosfeednum."">Prev</a> <a href"rss.php&album=".$album."&start=".$nextfeednum."">Next</a>";
$description_header .= "</description>";
echo $description_header;
echo "\n";
//A/ i replaced the thumbnails with the normals and the normals with the full sized pics
//A/ thumbnails are looking bad in wall view
//A/ linking in the picture by the icon doesn't work anymore with that option :-(
//A/ as you can see i now have 2 thumbnail urls
//A/ only the first will be used to load the pictures
//A/ the second one is to publish the real thumbnail filenames to piclens
//A/ without that the play button won't appear in the thumbs in album view.
$tmp_count = $lower_limit;
foreach($data AS $picture) {
$full_url = "$image_url$picture[filepath]$picture[filename]";
$normal_url = "$image_url$picture[filepath]$picture[filename]";
$thumb_url = "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
$title = $picture[filename];
$picmd5 = md5($picture[pid]);
$item = '<item>';
$item .= "\n";
$item .= '<title>'.$title.'</title>';
$item .= "\n";
//following line is for debugging only
//$item .= '<title>'.$title.'-'.$album.'-'.$album_name_keyword.'-'.$lower_limit.'-'.$thumb_count.'-'.$lower_limit.'-'.$start_at_imgpos.'-'.$start_at_page.'-Mod'.$start_at_imgpos % $thumb_per_page.'</title>';
if ((is_numeric($album))) {
$item .= '<link>' .$link_url_alb . $picture[aid] . '&pos='. $tmp_count . '</link>';
$item .= "\n";
$tmp_count = $tmp_count + 1;
}
else {
$item .= '<link>' .$link_url . $picture[pid]. '</link>';
$item .= "\n";
}
$item .= '<description><a href="'.$link_url.$picture[pid].'"><img src="';
$item .= $gallery_home_url.$thumb_url.'" border="1" vspace="2" hspace="2"></a><br><br>';
if((strlen($picture[caption])) > 0) {
$item .= 'Description: '.preg_replace($replaceArray , $umlautArray , $picture[caption]).'<br>';
}
if((strlen($album_name_keyword[title])) > 0) {
$item .= 'Album: '.preg_replace($replaceArray , $umlautArray , $album_name_keyword[title]).'<br>';
}
$item .= 'Hits: '.$picture[hits].'<br>';
$item .= 'Posted: '.localised_date($picture[ctime], $album_date_fmt);
$item .= '</description>';
$item .= "\n";
$item .= "<guid>".$picmd5."</guid>\n";
if ($fullsizethumbs == 1) {
$item .= '<media:thumbnail url="'.$gallery_home_url.$normal_url.'" />';
$item .= "\n";
}
$item .= '<media:thumbnail url="'.$gallery_home_url.$thumb_url.'" />';
$item .= "\n";
if ($fullsizepics == 0) {
$item .= '<media:content url="'.$gallery_home_url.$normal_url.'" type="image/jpeg" />';
}
if ($fullsizepics == 1) {
$item .= '<media:content url="'.$gallery_home_url.$full_url.'" type="image/jpeg" />';
}
$item .= "\n";
$item .= "</item>\n";
$item .= "\n";
echo $item;
}
$rssFooter = <<<EOT
</channel>\n
</rss>
EOT;
echo $rssFooter;
$album = 'random';
?>
cooliris-quick.xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<cooliris-quick version="1.0">
<src>^http\:\/\/www\.pays\-dignois\.com\/galerie\/albums\_(.+?)\.jpg$</src>
<dst>http://www.pays-dignois.com/galerie/albums/{1}.jpg</dst>
</cooliris-quick>
Correctement configuré il y a une version Standalone de PicsLens/CoolIris disponible au moyen d'un lien de ce type =>
javascript:PicLensLite.start({feedUrl:'http ://www.pays-dignois.com/galerie/cooliris-rss.php'}); (
expl sur ma Galerie Coppermine.
Lien "Ouvrez Pays-Dignois.com avec CoolIris")
Ainsi les Utilisateurs de Google-Chrome (par expl) ou autres navigateurs non supportés par le plugin CoolIris, peuvent quand même profiter de la technologie PicsLens/CoolIris :-)