Advanced search  


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.

Pages: [1]   Go Down

Author Topic: open thumbnail double click in a new explorer window  (Read 2195 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine newbie
  • Offline Offline
  • Posts: 1
open thumbnail double click in a new explorer window
« on: February 02, 2005, 09:58:12 am »

Hi all,

I am trying to modify the gallery, that when a picture is pressed the link will open in a new window and not the same, How do I do that ?

function display_thumbnails($album, $cat, $page, $thumbcols, $thumbrows, $display_tabs)
global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;

$thumb_per_page = $thumbcols * $thumbrows;
$lower_limit = ($page-1) * $thumb_per_page;

$pic_data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);

$total_pages = ceil($thumb_count / $thumb_per_page);

$i = 0;
if (count($pic_data) > 0) {
foreach ($pic_data as $key => $row) {

$pic_title =$lang_display_thumbnails['filename'].$row['filename']."\n".
$lang_display_thumbnails['filesize'].($row['filesize'] >> 10).$lang_byte_units[1]."\n".
$lang_display_thumbnails['date_added'].localised_date($row['ctime'], $album_date_fmt);

$pic_url = get_pic_url($row, 'thumb');
if (!is_image($row['filename'])) {
$image_info = getimagesize($pic_url);
$row['pwidth'] = $image_info[0];
$row['pheight'] = $image_info[1];

$image_size = compute_img_size($row['pwidth'], $row['pheight'], $CONFIG['thumb_width']);

$thumb_list[$i]['pos'] = $key < 0 ? $key : $i - 1 + $lower_limit;
$thumb_list[$i]['image'] = "<img src=\"" . $pic_url . "\" class=\"image\" {$image_size['geom']} border=\"0\" alt=\"{$row['filename']}\" title=\"$pic_title\">";
$thumb_list[$i]['caption'] = $row['caption_text'];
$thumb_list[$i]['admin_menu'] = '';
$thumb_list[$i]['aid'] = $row['aid'];
theme_display_thumbnails($thumb_list, $thumb_count, $album_name, $album, $cat, $page, $total_pages, is_numeric($album), $display_tabs);
} else {


Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
Re: open thumbnail double click in a new explorer window
« Reply #1 on: February 02, 2005, 05:17:16 pm »

edit themes/yourtheme/theme.php, find
Code: [Select]
// HTML template for thumbnails displayand within this section, replace
Code: [Select]
<a href="{LINK_TGT}">{THUMB}<br /></a>with
Code: [Select]
<a href="{LINK_TGT}" target="_blank">{THUMB}<br /></a>Making every page open in a new window is not recommended though - users know how to do a rightclick-"open link in new window". Forcing them to open a new window will make them leave your site - at least I would in the very moment an unneeded new window pops up. Also you should bear in mind that there a lot of opo-up blockers around your new "feature" will fall victim to.

Pages: [1]   Go Up

Page created in 0.02 seconds with 20 queries.