Problem with thumbnails on another page Problem with thumbnails on another page
 

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

Main Menu

Problem with thumbnails on another page

Started by Sabros, November 03, 2007, 12:14:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sabros

Hi,

I have a problem with this script. I need it to display thumbnails of other types of files than images. How can I achieve this?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<body bgcolor="#98CB54">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td width="387" align="center" valign="middle">
<?php 
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) 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');
require(
"include/smilies.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 1;
}
$thumb_count 0;
$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        
     
$album1 'lasthits';
     
$album2 'lastcom';
     
$album3 'lastup';
     
$album4 'random';
     
$album5 'topn';
}

//If the album is not set set it to lastup - this is the default
if(!isset($album)){     
     
$album1 'lasthits';
     
$album2 'lastcom';
     
$album3 'lastup';
     
$album4 'random';
     
$album5 'topn';
}

//Changes these to point to your site if the following is not giving correct results.
$link_url "displayimage.php?pos=-";
$image_url "albums/";

$data1 get_pic_data($album1$thumb_count$album_name$lower_limit$thumb_per_page);
$data2 get_pic_data($album2$thumb_count$album_name$lower_limit$thumb_per_page);
$data3 get_pic_data($album3$thumb_count$album_name$lower_limit$thumb_per_page);
$data4 get_pic_data($album4$thumb_count$album_name$lower_limit$thumb_per_page);
$data5 get_pic_data($album5$thumb_count$album_name$lower_limit$thumb_per_page);


foreach(
$data1 AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '" target="_top"><img src="' $thumb_url '"  border="0"/></a><a href="thumbnails.php?album=lasthits" target="_top"><img src="themes/123/images/last_view.jpg" border="0"/></a><br><br>';
    echo 
$description;
}
foreach(
$data2 AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '" target="_top"><img src="' $thumb_url '"  border="0"/></a><a href="thumbnails.php?album=lastcom" target="_top"><img src="themes/123/images/last_com.jpg" border="0"/></a><br><br>';
    echo 
$description;
}
foreach(
$data3 AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '" target="_top"><img src="' $thumb_url '"  border="0"/></a><a href="thumbnails.php?album=lastup" target="_top"><img src="themes/123/images/last_upload.jpg" border="0"/></a><br><br>';
    echo 
$description;
}
foreach(
$data4 AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '" target="_top"><img src="' $thumb_url '"  border="0"/></a><a href="thumbnails.php?album=random" target="_top"><img src="themes/123/images/random.jpg" border="0"/></a><br><br>';
    echo 
$description;
}
foreach(
$data5 AS $picture) {
    
$thumb_url "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    
$description '<a href="' $link_url $picture['pid'] . '" target="_top"><img src="' $thumb_url '"  border="0"/></a><a href="thumbnails.php?album=topn" target="_top"><img src="themes/123/images/most_view.jpg" border="0"/></a>';
    echo 
$description;
}
?>

</td>
</tr>
</table>
</body>
</html>


Thanks.

Joachim Müller

Not related to "Photography -> Tips/Tricks". Moving thread accordingly. It's not a bright idea to start your thread on an unrelated board, as moving stuff around requires additional moderation effort, which makes supporters reluctant to look into your actual issues.