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: Modification  (Read 5612 times)

0 Members and 1 Guest are viewing this topic.

tarentaise

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Modification
« on: August 15, 2011, 06:54:21 pm »

Bonjour,

suite à mon poste précédent, http://forum.coppermine-gallery.net/index.php/topic,73211.0.html, et n'ayant pas réussi à faire la modification que je souhaitais j'ai continué mes recherches sur le forum et sur la toile.
J'ai fini par trouver deux scripts qui vont bien et que j'ai en partie modifié pour mes besoins mais là maintenant j'ai atteint mes limites et je suis bloqué .....
Je viens donc vers vous pour éventuellement un petit coup de main.

Pour le premier script je n'arrive pas à faire en sorte qu'il affiche les 5 derniers albums, ni a afficher le nom de ces albums. Actuellement je n'arrive qu'à afficher les 5 dernières photos mises en place.

Code: [Select]
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) Dr. Tarique Sani                                           //
// http://tariquesani.net/                                                  //
// ------------------------------------------------------------------------- //
// 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 RSS feed
$thumb_per_page 5;

$thumb_count 8;
$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 'lastup';
}

//If the album is not set set it to lastup - this is the default
if(!isset($album)){
     
$album 'lastup';
}


if ((isset(
$_GET['cat']) && $_GET['cat'] < 0)){ 
     
$cat = - $_GET['cat'];
     
$album_name_keyword get_album_name($cat);
     
$CURRENT_CAT_NAME $album_name_keyword['title'];
     
     
$ALBUM_SET "AND aid IN (".$cat.")".$ALBUM_SET;
}



//Changes these to point to your site if the following is not giving correct results.
$link_url $CONFIG['ecards_more_pic_target']."thumbnails.php?album=";
$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]";
$thumb_url .= urlencode($picture[filename]);
    
$description '<a href="' $link_url $picture['aid'] . '"><img src="' $thumb_url '"  longdesc="' $link_url $picture['aid'] . '" alt="' .$picture[caption].'"/></a>';
    echo 
$description;
print_r($picture);

}
?>

Pour le deuxième il m'affiche bien 5 photos mais de façon aléatoire alors que je voudrais qu'il affiche les 5 derniers albums avec une photo aléatoire issus de ceux-ci et comme pour le précédent je n'arrive pas à afficher le nom de l'album.
Code: [Select]
<?php
/**************************************************
  Coppermine 1.4.x Plugin - Imageflow v1.2
  *************************************************
  Copyright (c) 2008 Timos-Welt (www.timos-welt.de)
  *************************************************
  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.
  **************************************************/
 
/* Things you may change */

$imageflow_bgcolor      "000000";         // background color; use hex format without leading '#'
$imageflow_width        "350px";          // either use pixel (800px) or percent (50%)
$imageflow_topcorrect   50;               // correct top border of animation 
                                            // (negative values = move to top, positive values = move to bottom)
$imageflow_align        "center";           // allowed: "center" or "left"
$imageflow_intable      1;                // leave this set to 1 normally
$imageflow_numberofpics 5;               // number of random images to select from CPG database
$imageflow_skipportait  0;                // set to 1 if you only want pics where width>height
$imageflow_procent      1;             // The factor that the generated reflexion images are smaller than 
                                            // the intermediate size pictures of your gallery. 1.0 means, they
                                            // have the original size. 0.5 means, they are half as big.
$imageflow_fontcolor    "ffffff";         // font color for captions; use hex format without leading '#'
$imageflow_loading      "Loading Images"// Message displayed while loading



/* Please don't change anything below */
 
echo <<<EOS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
  <head>
    <title>Imageflow for external usage</title>  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

EOS;

define('IN_COPPERMINE'true);
global 
$CONFIG$FORBIDDEN_SET$imageflow_row;
require_once(
'./include/init.inc.php');


echo <<<EOS
    <link rel="stylesheet" title="Standard" href="imgflow_screen.css" type="text/css" media="screen" />
    <script language="JavaScript" type="text/javascript" src="imgflow_imageflow.js"></script>
    <style type="text/css">

EOS;
echo 
"      #imageflow{background-color:#".$imageflow_bgcolor.";width:".$imageflow_width.";}\n";
echo 
"      #imgflowcontainer{margin-top:".$imageflow_topcorrect."px;width:".$imageflow_width.";}\n";
echo 
"      #imgflowslider{background-image:url('imgflow_slider.gif');}\n";
echo 
"      #imgflowcaptions{color:#".$imageflow_fontcolor.";}\n";
echo 
"      #imgflowloading{color:#".$imageflow_fontcolor.";}\n";
echo 
"      body{background-color:#".$imageflow_bgcolor.";}\n";
echo 
"    </style>\n";
echo 
"  </head>\n";
echo 
"  <body>\n";
if (
$imageflow_align == "center") echo "   <center>\n";
if (
$imageflow_intable) echo "      <div id=\"imgflowcontainer\" style=\"width:".$imageflow_width.";\">\n";
echo 
"            <div id=\"imageflow\">\n";
echo 
"                <div id=\"imgflowloading\">\n";
echo 
"                  <b>".$imageflow_loading."</b><br/>\n";
echo 
"                  <img src=\"imgflow_loading.gif\" width=\"208\" height=\"13\" alt=\"loading\" />\n";
echo 
"                </div>\n";
echo 
"                <div id=\"imgflowimages\">\n";

  
// maximum pics to show
  
$imageflowlimit=$imageflow_numberofpics;
  
// request of your database
  
$imageflow_pics='';
  
$imageflow_FORBIDDEN_SET "";
  if (
$FORBIDDEN_SET != ""$imageflow_FORBIDDEN_SET "AND $FORBIDDEN_SET";
  
$imageflow_query "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p WHERE filename like '%.jpg' AND filename not like 'youtube_%' AND approved = 'YES' $imageflow_FORBIDDEN_SET ORDER BY RAND() LIMIT $imageflowlimit";
  
// result of request
  
$imageflow_result cpg_db_query($imageflow_query);
  
// For reading result
  
$imageflow_rowset = array();
  
// Index of tab
  
$i=0;
  
// max height : will be 75px or 100px
  
$max_height=0;
  
// For each pic.....building javascript in php
  
while($imageflow_row mysql_fetch_array($imageflow_result)){
    if ((
$imageflow_skipportrait == 0) || ($imageflow_row['pwidth'] > $imageflow_row['pheight'])) {
      
// reading pid of pic
      
$imageflow_key=$imageflow_row['pid'];
      
// reading height of pic
      
$imageflow_image_size compute_img_size($imageflow_row['pwidth'], $imageflow_row['pheight'], $CONFIG['thumb_width']);
    
// path of pic
    
$imageflow_file="albums/".$imageflow_row['filepath']."normal_".$imageflow_row['filename'];
    
// link of pic
    
$imageflow_lien="<img class=\"imgflowimg\" src=\"imgflow_reflect.php?bgc=".$imageflow_bgcolor."&amp;procent=".$imageflow_procent."&amp;cache=0&amp;img=".$imageflow_file."\" longdesc=\"thumbnails.php?album=".$imageflow_row['aid']."\"  alt=\"".$imageflow_row['caption']."\" />";
    
// building javascript code
    
$imageflow_pics .= $imageflow_lien."\n";
    
$i=$i+1;
    }
  }
  
// free memory
  
mysql_free_result($imageflow_result);
  echo 
$imageflow_pics;

echo 
"</div><div id=\"imgflowcaptions\"></div><div id=\"imgflowscrollbar\"><div id=\"imgflowslider\"></div></div></div>";

            if (
$imageflow_intable) echo "</div>";

if (
$imageflow_align == "center") { echo "</center>
"
; }
echo 
"<!-- End Imageflow PlugIn -->\n";
echo 
"</body>";
echo 
"</html>";
?>


Je suis sur que cela n'est pas grand chose mais depuis le temps que je tourne autour je commence à ne plus savoir comment faire.
Logged
Pages: [1]   Go Up
 

Page created in 0.031 seconds with 20 queries.