Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Problem with thumbnails on another page  (Read 2841 times)

0 Members and 1 Guest are viewing this topic.

Sabros

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Problem with thumbnails on another page
« on: November 03, 2007, 12:14:43 pm »

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?

Code: [Select]
<!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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Problem with thumbnails on another page
« Reply #1 on: November 03, 2007, 06:28:00 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.